An ensemble meta-estimator to predict source code testability
Not on the map. Why?
Abstract (arXiv)
Unlike most other software quality attributes, testability cannot be evaluated solely based on the characteristics of the source code. The effectiveness of the test suite and the budget assigned to the test highly impact the testability of the code under test. The size of a test suite determines the test effort and cost, while the coverage measure indicates the test effectiveness. Therefore, testability can be measured based on the coverage and number of test cases provided by a test suite, considering the test budget. This paper offers a new equation to estimate testability regarding the size and coverage of a given test suite. The equation has been used to label 23,000 classes belonging to 110 Java projects with their testability measure. The labeled classes were vectorized using 262 metrics. The labeled vectors were fed into a family of supervised machine learning algorithms, regression, to predict testability in terms of the source code metrics. Regression models predicted testability with an R2 of 0.68 and a mean squared error of 0.03, suitable in practice. Fifteen software metrics highly affecting testability prediction were identified using a feature importance analysis technique on the learned model. The proposed models have improved mean absolute error by 38% due to utilizing new criteria, metrics, and data compared with the relevant study on predicting branch coverage as a test criterion. As an application of testability prediction, it is demonstrated that automated refactoring of 42 smelly Java classes targeted at improving the 15 influential software metrics could elevate their testability by an average of 86.87%.
Key facts. Cited by 5 papers in the map (data through 7 Oct 2026). Builds on 3 of its 82 references that are in the map. First posted on arXiv 20 Aug 2022.
Builds on
3 of 82 references.
References · 3
- 2018code2vec: Learning Distributed Representations of Codecited by 249
- 2018code2seq: Generating Sequences from Structured Representations of Codecited by 177
- 2018A survey on software testabilitycited by 6
Built on by
Citing papers per year: 2023: 2; 2024: 2; 2025: 1.
5 papers.
- 2023A systematic literature review on source code similarity measurement and clone detection: techniques, applications, and challengescited by 14
- 2025How Diversely Can Language Models Solve Problems? Exploring the Algorithmic Diversity of Model-Generated Codecited by 9
- 2024Is Functional Correctness Enough to Evaluate Code Language Models? Exploring Diversity of Generated Codescited by 5
- 2023A systematic literature review on the code smells datasets and validation mechanismscited by 2
- 2024Natural Language Requirements Testability Measurement Based on Requirement Smellscited by 0
- 2025How Diversely Can Language Models Solve Problems? Exploring the Algorithmic Diversity of Model-Generated Code2 Mar 2025
- 2024Is Functional Correctness Enough to Evaluate Code Language Models? Exploring Diversity of Generated Codes24 Aug 2024
- 2024Natural Language Requirements Testability Measurement Based on Requirement Smells26 Mar 2024
- 2023A systematic literature review on source code similarity measurement and clone detection: techniques, applications, and challenges28 Jun 2023
- 2023A systematic literature review on the code smells datasets and validation mechanisms2 Jun 2023