arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2309.07518cs.SE
收藏

用于在基于搜索单元测试生成中结合多种准则的覆盖目标选择器

Coverage Goal Selector for Combining Multiple Criteria in Search-Based Unit Test Generation

Zhichao Zhou, Yuming Zhou, Chunrong Fang, Zhenyu Chen, Xiapu Luo, Jingzhu He, Yutian Tang

AI总结:

针对基于搜索的软件测试中多覆盖准则结合导致部分准则覆盖率下降的问题,提出smart selection方法,通过利用准则间覆盖相关性和目标间包含关系选择覆盖目标子集以减少优化目标,实验证明其在多种时间预算下均优于结合所有目标的方法并提升缺陷检测效果。

摘要:

单元测试对软件开发过程至关重要,它能确保程序中基本编程单元(如方法)的正确性。基于搜索的软件测试(SBST)是一种自动生成测试用例的方法。SBST通过指定覆盖准则(如分支覆盖),利用遗传算法生成测试用例。然而,优秀的测试套件必须具备多种属性,而单一的覆盖准则无法捕捉这些属性。因此,最先进的方法结合了多种准则来生成测试用例。由于结合多种覆盖准则会给优化带来多个目标,与使用单一准则相比,这会损害测试套件在某些准则上的覆盖率。为了应对这个问题,我们提出了一种名为smart selection的新方法。基于准则之间的覆盖相关性和覆盖目标之间的包含关系,smart selection选择一个覆盖目标子集,以减少优化目标的数量,并避免遗漏所有准则的任何属性。我们进行了实验,在2分钟的时间预算下,使用三种最先进的遗传算法在400个Java类上评估了smart selection。平均而言,在两种方法之间存在显著差异的类中,smart selection在65.1%的类上优于结合所有目标的方法。其次,我们进行了实验以验证关于覆盖准则关系的假设。此外,我们在5分钟、8分钟和10分钟的不同预算下评估了smart selection的覆盖性能,并探讨了其对缺陷检测的影响,证实了smart selection优于结合所有目标的方法。

英文摘要:

Unit testing is critical to the software development process, ensuring the correctness of basic programming units in a program (e.g., a method). Search-based software testing (SBST) is an automated approach to generating test cases. SBST generates test cases with genetic algorithms by specifying the coverage criterion (e.g., branch coverage). However, a good test suite must have different properties, which cannot be captured using an individual coverage criterion. Therefore, the state-of-the-art approach combines multiple criteria to generate test cases. Since combining multiple coverage criteria brings multiple objectives for optimization, it hurts the test suites' coverage for certain criteria compared with using the single criterion. To cope with this problem, we propose a novel approach named \textbf{smart selection}. Based on the coverage correlations among criteria and the subsumption relationships among coverage goals, smart selection selects a subset of coverage goals to reduce the number of optimization objectives and avoid missing any properties of all criteria. We conduct experiments to evaluate smart selection on $400$ Java classes with three state-of-the-art genetic algorithms under the $2$-minute budget. On average, smart selection outperforms combining all goals on $65.1\%$ of the classes having significant differences between the two approaches. Secondly, we conduct experiments to verify our assumptions about coverage criteria relationships. Furthermore, we assess the coverage performance of smart selection under varying budgets of $5$, $8$, and $10$ minutes and explore its effect on bug detection, confirming the advantage of smart selection over combining all goals.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑