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

变异测试作为测试代码重构的安全网

Mutation Testing as a Safety Net for Test Code Refactoring

Ali Parsai, Alessandro Murgia, Quinten David Soetens, Serge Demeyer

摘要:

重构是一种改进代码内部结构而不改变其外部行为的活动。当在生产代码上执行时,测试可以用于验证生产代码的外部行为是否被保留。然而,当对测试代码执行重构时,没有安全网来确保测试代码的外部行为得到保留。在本文中,我们建议采用突变测试作为一种手段,以验证测试代码的行为被重构后保留。此外,我们还展示了如何使用这种方法来识别部分的测试代码是不正确的重构。

英文摘要:

Refactoring is an activity that improves the internal structure of the code without altering its external behavior. When performed on the production code, the tests can be used to verify that the external behavior of the production code is preserved. However, when the refactoring is performed on test code, there is no safety net that assures that the external behavior of the test code is preserved. In this paper, we propose to adopt mutation testing as a means to verify if the behavior of the test code is preserved after refactoring. Moreover, we also show how this approach can be used to identify the part of the test code which is improperly refactored.

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

↑