A Search-Based Testing Framework for Deep Neural Networks of Source Code Embedding
Not on the map. Why?
Abstract (arXiv)
Over the past few years, deep neural networks (DNNs) have been continuously expanding their real-world applications for source code processing tasks across the software engineering domain, e.g., clone detection, code search, comment generation. Although quite a few recent works have been performed on testing of DNNs in the context of image and speech processing, limited progress has been achieved so far on DNN testing in the context of source code processing, that exhibits rather unique characteristics and challenges. In this paper, we propose a search-based testing framework for DNNs of source code embedding and its downstream processing tasks like Code Search. To generate new test inputs, we adopt popular source code refactoring tools to generate the semantically equivalent variants. For more effective testing, we leverage the DNN mutation testing to guide the testing direction. To demonstrate the usefulness of our technique, we perform a large-scale evaluation on popular DNNs of source code processing based on multiple state-of-the-art code embedding methods (i.e., Code2vec, Code2seq and CodeBERT). The testing results show that our generated adversarial samples can on average reduce the performance of these DNNs from 5.41% to 9.58%. Through retraining the DNNs with our generated adversarial samples, the robustness of DNN can improve by 23.05% on average. The evaluation results also show that our adversarial test generation strategy has the least negative impact (median of 3.56%), on the performance of the DNNs for regular test data, compared to the other methods.
Key facts. Cited by 12 papers in the map (data through 7 Oct 2026). First posted on arXiv 20 Jan 2021.
Builds on
No reference list yet.
Built on by
Citing papers per year: 2021: 2; 2022: 1; 2023: 2; 2024: 2; 2025: 3; 2026: 2.
12 papers.
- 2021A Survey on Machine Learning Techniques for Source Code Analysiscited by 23
- 2024LiCoEval: Evaluating LLMs on License Compliance in Code Generationcited by 13
- 2021DeepMetis: Augmenting a Deep Learning Test Set to Increase its Mutation Scorecited by 12
- 2023An Extensive Study on Adversarial Attack against Pre-trained Models of Codecited by 8
- 2023Boosting Source Code Learning with Text-Oriented Data Augmentation: An Empirical Studycited by 5
- 2022MIXCODE: Enhancing Code Classification by Mixup-Based Data Augmentationcited by 4
- 2024GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understandingcited by 2
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detectioncited by 2
- 2025Assessing Code Understanding in LLMscited by 2
- 2025On Accelerating Deep Neural Network Mutation Analysis by Neuron and Mutant Clusteringcited by 1
- 2026Operational Robustness of LLMs on Code Generationcited by 0
- 2026Quality-Driven Selective Mutation for Deep Learningcited by 0
- 2026Quality-Driven Selective Mutation for Deep Learning24 Apr 2026
- 2026Operational Robustness of LLMs on Code Generation21 Feb 2026
- 2025Assessing Code Understanding in LLMs31 Mar 2025
- 2025Semantic-Preserving Transformations as Mutation Operators: A Study on Their Effectiveness in Defect Detection30 Mar 2025
- 2025On Accelerating Deep Neural Network Mutation Analysis by Neuron and Mutant Clustering22 Jan 2025
- 2024LiCoEval: Evaluating LLMs on License Compliance in Code Generation5 Aug 2024
- 2024GenCode: A Generic Data Augmentation Framework for Boosting Deep Learning-Based Code Understanding24 Feb 2024
- 2023An Extensive Study on Adversarial Attack against Pre-trained Models of Code13 Nov 2023
- 2023Boosting Source Code Learning with Text-Oriented Data Augmentation: An Empirical Study13 Mar 2023
- 2022MIXCODE: Enhancing Code Classification by Mixup-Based Data Augmentation6 Oct 2022
- 2021A Survey on Machine Learning Techniques for Source Code Analysis18 Oct 2021
- 2021DeepMetis: Augmenting a Deep Learning Test Set to Increase its Mutation Score15 Sep 2021