一句话:提出 smart selection,通过覆盖相关性与目标包含关系选择覆盖目标子集,减少多准则优化目标并提升基于搜索的单元测试生成效果。
单元测试用于保证程序基本单元的正确性,基于搜索的软件测试(SBST)通过遗传算法按指定覆盖准则(如分支覆盖)自动生成测试用例。单一覆盖准则难以刻画良好测试套件所需的多种性质,因此已有工作组合多个准则;但多准则引入多目标优化,可能反而降低某些准则的覆盖。论文提出 smart selection:根据覆盖准则间的相关性与覆盖目标间的包含关系,选择覆盖目标子集,以减少优化目标,同时避免遗漏各准则的性质。作者在400个Java类上使用三种先进遗传算法评估;在两种方法存在显著差异的类上,smart selection 平均优于组合全部目标的方法。
Unit testing is a critical part of 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 by using an individual coverage criterion. Therefore, the state-of-the-art approach combines multiple criteria to generate test cases. As 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 smart selection. Based on the coverage correlations among criteria and the coverage goals’ subsumption relationships, 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. On average, smart selection outperforms combining all goals on of the classes having significant differences between the two approaches.
@inproceedings{paperbot7250,
title = {Selectively Combining Multiple Coverage Goals in Search-Based Unit Test Generation},
author = {Zhichao Zhou and Yuming Zhou and Chunrong Fang and Zhenyu Chen and Yutian Tang},
booktitle = {ASE},
year = {2022},
doi = {10.1145/3551349.3556902}
}