预测source code可测性的集成元估计器
An ensemble meta-estimator to predict source code testability
摘要:
与大多数其他软件质量属性不同,可测试性不能仅仅基于源代码的特性进行评估。测试套件的有效性和分配给测试的预算极大地影响了被测代码的可测试性。测试集的大小决定了测试工作量和成本,而覆盖度量则表明了测试的有效性。因此,考虑到测试预算,可测试性可以根据测试套件提供的测试用例的覆盖率和数量来衡量。本文提供了一个新的方程来估计一个给定的测试套件的大小和覆盖率的可测性。该公式已被用于标记属于110个Java项目的23,000个类及其可测试性度量。使用262个度量对标记的类进行向量化。标记的向量被送入一系列有监督的机器学习算法,回归,以预测源代码度量的可测试性。回归模型预测的R2为0.68,均方误差为0.03,适用于实践的可测试性。15个软件度量高度影响可测试性预测确定使用的学习模型上的特征重要性分析技术。与预测分支覆盖率作为测试标准的相关研究相比,由于采用了新的标准、度量和数据,所提出的模型将平均绝对误差提高了38%。作为可测试性预测的一个应用,它表明,42个臭Java类的自动重构,旨在提高15个有影响力的软件度量,可以提高其可测试性的平均86.87%。
英文摘要:
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%.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。