arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1108.1068cs.SE
收藏

状态测试:在代码和合同中发现更多错误

Stateful Testing: Finding More Errors in Code and Contracts

Yi Wei, Hannes Roth, Carlo A. Furia, Yu Pei, Alexander Horton, Michael Steindorfer, Martin Nordio, Bertrand Meyer

摘要:

自动化随机测试已被证明是一种有效的方法来发现故障,但仍然面临着一个主要的未解决的问题:如何生成足够多样化的测试输入,以发现许多故障,并快速找到它们。状态测试,本文中介绍的自动化测试技术,生成新的测试用例来改进现有的测试套件。生成的测试用例被设计为违反动态推断的合同(不变量)表征现有的测试套件。因此,他们能够很好地发现新的错误,并通过发现那些不合理的合同来提高推断合同的准确性。在13个数据结构类上进行的总计超过28,000行代码的实验证明了状态测试在改进长时间随机测试结果方面的有效性:状态测试发现了68.4%的新错误,并将自动推断合同的准确性提高到99%以上,而时间开销仅为7%。

英文摘要:

Automated random testing has shown to be an effective approach to finding faults but still faces a major unsolved issue: how to generate test inputs diverse enough to find many faults and find them quickly. Stateful testing, the automated testing technique introduced in this article, generates new test cases that improve an existing test suite. The generated test cases are designed to violate the dynamically inferred contracts (invariants) characterizing the existing test suite. As a consequence, they are in a good position to detect new errors, and also to improve the accuracy of the inferred contracts by discovering those that are unsound. Experiments on 13 data structure classes totalling over 28,000 lines of code demonstrate the effectiveness of stateful testing in improving over the results of long sessions of random testing: stateful testing found 68.4% new errors and improved the accuracy of automatically inferred contracts to over 99%, with just a 7% time overhead.

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

↑