Test Case Recommendations with Distributed Representation of Code Syntactic Features
Not on the map. Why?
Abstract (arXiv)
Frequent modifications of unit test cases are inevitable due to software's continuous underlying changes in source code, design, and requirements. Since manually maintaining software test suites is tedious, timely, and costly, automating the process of generation and maintenance of test units will significantly impact the effectiveness and efficiency of software testing processes. To this end, we propose an automated approach which exploits both structural and semantic properties of source code methods and test cases to recommend the most relevant and useful unit tests to the developers. The proposed approach initially trains a neural network to transform method-level source code, as well as unit tests, into distributed representations (embedded vectors) while preserving the importance of the structure in the code. Retrieving the semantic and structural properties of a given method, the approach computes cosine similarity between the method's embedding and the previously-embedded training instances. Further, according to the similarity scores between the embedding vectors, the model identifies the closest methods of embedding and the associated unit tests as the most similar recommendations. The results on the Methods2Test dataset showed that, while there is no guarantee to have similar relevant test cases for the group of similar methods, the proposed approach extracts the most similar existing test cases for a given method in the dataset, and evaluations show that recommended test cases decrease the developers' effort to generating expected test cases.
Key facts. No citing papers in the map yet (data through 14 Oct 2026). Builds on 10 of its 26 references that are in the map. First posted on arXiv 4 Oct 2023.
Builds on
10 of 26 references.
References · 10
- 2013Distributed Representations of Words and Phrases and their Compositionalitycited by 3,474
- 2020CodeBERT: A Pre-Trained Model for Programming and Natural Languagescited by 1,310
- 2018code2vec: Learning Distributed Representations of Codecited by 250
- 2018The Adverse Effects of Code Duplication in Machine Learning Models of Codecited by 126
- 2020Unit Test Case Generation with Transformers and Focal Contextcited by 118
- 2019A Literature Study of Embeddings on Source Codecited by 18
- 2020TreeCaps: Tree-Based Capsule Networks for Source Code Processingcited by 16
- 2021On using distributed representations of source code for the detection of C security vulnerabilitiescited by 10
- 2018Path-Based Function Embedding and its Application to Specification Miningcited by 8
- 2019Semantic Source Code Models Using Identifier Embeddingscited by 6
Built on by
Not cited yet.