论文标题
视线不合时间:检测和评估交换论点
Out of Sight, Out of Place: Detecting and Assessing Swapped Arguments
论文作者
论文摘要
当命名程序实体(例如变量,函数和宏)命名程序实体时,程序员通常会添加有关程序语义的有意义的信息。但是,静态分析工具通常在程序中寻找错误时会折扣此信息。在这项工作中,我们描述了称为SWAPD的静态分析检查器的设计和实现,该检查器使用程序中的自然语言信息来警告呼叫网站上错误汇总的参数。 SWAPD结合了两种独立的检测策略,以提高整体检查器的有效性。我们介绍了对SWAPD的全面评估的结果,该SWAPD在大量的C和C ++程序中,总计4.17亿行代码。在此评估中,SWAPD发现了154个手动vet的现实世界案件错误地叠加了论点,这表明此类错误虽然在发布的代码中并不普遍,但是一个真正的问题,是一个真正的问题,也是一个有价值的静态分析目标。
Programmers often add meaningful information about program semantics when naming program entities such as variables, functions, and macros. However, static analysis tools typically discount this information when they look for bugs in a program. In this work, we describe the design and implementation of a static analysis checker called SwapD, which uses the natural language information in programs to warn about mistakenly-swapped arguments at call sites. SwapD combines two independent detection strategies to improve the effectiveness of the overall checker. We present the results of a comprehensive evaluation of SwapD over a large corpus of C and C++ programs totaling 417 million lines of code. In this evaluation, SwapD found 154 manually-vetted real-world cases of mistakenly-swapped arguments, suggesting that such errors, while not pervasive in released code, are a real problem and a worthwhile target for static analysis.