当前位置: X-MOL 学术Int. J. Intell. Syst. › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Learning to predict test effectiveness
International Journal of Intelligent Systems ( IF 5.0 ) Pub Date : 2021-10-29 , DOI: 10.1002/int.22722
Morteza Zakeri‐Nasrabadi 1 , Saeed Parsa 1
Affiliation  

The high cost of the test can be dramatically reduced, provided that the coverability as an inherent feature of the code under test is predictable. This article offers a machine learning model to predict the extent to which the test could cover a class in terms of a new metric called Coverageability. The prediction model consists of an ensemble of four regression models. The learning samples consist of feature vectors, where features are source code metrics computed for a class. The samples are labeled by the Coverageability values computed for their corresponding classes. We offer a mathematical model to evaluate test effectiveness in terms of size and coverage of the test suite generated automatically for each class. We extend the size of the feature space by introducing a new approach to define submetrics in terms of existing source code metrics. Using feature importance analysis on the learned prediction models, we sort sources code metrics in the order of their impact on the test effectiveness. As a result of which we found the class strict cyclomatic complexity as the most influential source code metric. Our experiments with our prediction models on a large corpus of Java projects containing about 23,000 classes demonstrate the Mean Absolute Error (MAE) of 0.032, Mean-Squared Error (MSE) of 0.004, and an R2 score of 0.855. Compared with the state-of-the-art coverage prediction models, our models improve MAE, MSE, and an R2 score by 5.78%, 2.84%, and 20.71%, respectively.

中文翻译:

学习预测测试有效性

如果作为被测代码固有特征的可覆盖性是可预测的,则可以显着降低测试的高成本。本文提供了一个机器学习模型,可以根据称为覆盖率的新指标来预测测试覆盖类别的程度. 预测模型由四个回归模型的集合组成。学习样本由特征向量组成,其中特征是为类计算的源代码度量。样本由为其相应类别计算的覆盖率值标记。我们提供了一个数学模型,根据为每个类自动生成的测试套件的大小和覆盖率来评估测试的有效性。我们通过引入一种新方法来根据现有源代码度量定义子度量,从而扩展了特征空间的大小。使用对学习预测模型的特征重要性分析,我们按照它们对测试有效性的影响顺序对源代码度量进行排序。结果,我们发现类严格圈复杂度是最有影响力的源代码度量。R 2得分为 0.855。与最先进的覆盖预测模型相比,我们的模型分别将 MAE、MSE 和R 2得分提高了 5.78%、2.84% 和 20.71%。
更新日期:2021-10-29
down
wechat
bug