一句话:提出 FPDiff,自动发现不同数值库中的同义函数,并通过差分测试定位结果不一致与缺陷。
数值库是数值计算应用的基础,因此其结果的准确性和一致性至关重要。本文研究如何通过发现不同数值库中同义函数之间的结果差异来识别错误行为。作者提出自动寻找跨库同义函数、合成测试驱动程序并执行差分测试的方法,实现工具 FPDiff。在 GNU Scientific Library (GSL)、SciPy、mpmath 和 jmat 四个流行数值库上评估,FPDiff 以 95.8% 的精确率和 79% 的召回率找到 126 个等价类,发现 655 个输入使同义函数产生不一致输出的实例,其中 150 个代表 125 个唯一缺陷。所有缺陷均已报告给维护者,目前 30 个已修复,9 个为已知问题,另有 25 个已被开发者确认。
Numerical libraries constitute the building blocks for software applications that perform numerical calculations. Thus, it is paramount that such libraries provide accurate and consistent results. To that end, this paper addresses the problem of finding discrepancies between synonymous functions in different numerical libraries as a means of identifying incorrect behavior. Our approach automatically finds such synonymous functions, synthesizes testing drivers, and executes differential tests to discover meaningful discrepancies across numerical libraries. We implement our approach in a tool named FPDiff, and provide an evaluation on four popular numerical libraries: GNU Scientific Library (GSL), SciPy, mpmath, and jmat. FPDiff finds a total of 126 equivalence classes with a 95.8% precision and 79% recall, and discovers 655 instances in which an input produces a set of disagreeing outputs between function synonyms, 150 of which we found to represent 125 unique bugs. We have reported all bugs to library maintainers; so far, 30 bugs have been fixed, 9 have been found to be previously known, and 25 more have been acknowledged by developers.