通过无约束编程实现浮点代码的高覆盖率(扩展版)
Achieving High Coverage for Floating-point Code via Unconstrained Programming (Extended Version)
摘要:
实现高代码覆盖率在测试中至关重要,这使我们对代码质量充满信心。测试浮点代码通常需要在处理浮点约束方面付出艰苦的努力,例如,象征性的处决本文将测试浮点代码的挑战转化为应用无约束编程的机会--在整个搜索空间上计算函数最小点的数学解决方案。我们的核心见解是从浮点程序中导出一个表示函数,其任何最小点都是一个测试输入,保证可以运行被测试程序的一个新分支。这种保证允许我们通过反复最小化表示函数来实现浮点程序的高覆盖率。我们已经在一个名为CoverMe的工具中实现了这种方法,并在Sun的C数学库上对其进行了广泛的评估。我们的评估结果表明,CoverMe平均在6.9秒内实现了90.8%的分支覆盖率,大大优于我们比较的工具:(1)随机测试,(2)AFL,Google发布的高度优化,强大的模糊器,以及(3)Austin,一种最先进的基于覆盖率的测试工具,旨在支持浮点代码。
英文摘要:
Achieving high code coverage is essential in testing, which gives us confidence in code quality. Testing floating-point code usually requires painstaking efforts in handling floating-point constraints, e.g., in symbolic execution. This paper turns the challenge of testing floating-point code into the opportunity of applying unconstrained programming --- the mathematical solution for calculating function minimum points over the entire search space. Our core insight is to derive a representing function from the floating-point program, any of whose minimum points is a test input guaranteed to exercise a new branch of the tested program. This guarantee allows us to achieve high coverage of the floating-point program by repeatedly minimizing the representing function. We have realized this approach in a tool called CoverMe and conducted an extensive evaluation of it on Sun's C math library. Our evaluation results show that CoverMe achieves, on average, 90.8% branch coverage in 6.9 seconds, drastically outperforming our compared tools: (1) Random testing, (2) AFL, a highly optimized, robust fuzzer released by Google, and (3) Austin, a state-of-the-art coverage-based testing tool designed to support floating-point code.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。