计算机科学 > 程序设计语言
[提交于 2020年9月18日]
标题:Out of Sight, Out of Place: Detecting and Assessing Swapped Arguments
查看原文 PDF 中文 PDF (下批处理) EasyResearch 阅读摘要: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.
提交历史
来自:Vineeth Kashyap[v1] 2020年9月18日 星期五 23:07:39 UTC