当前位置: X-MOL 学术arXiv.cs.PL › 论文详情
Our official English website, www.x-mol.net, welcomes your feedback! (Note: you will need to create a separate account there.)
Out of Sight, Out of Place: Detecting and Assessing Swapped Arguments
arXiv - CS - Programming Languages Pub Date : 2020-09-18 , DOI: arxiv-2009.09117
Roger Scott, Joseph Ranieri, Lucja Kot, Vineeth Kashyap

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.

中文翻译:

眼不见心不烦:检测和评估交换的参数

程序员在命名程序实体(如变量、函数和宏)时,通常会添加有关程序语义的有意义的信息。但是,静态分析工具在查找程序中的错误时通常会忽略此信息。在这项工作中,我们描述了一个名为 SwapD 的静态分析检查器的设计和实现,它使用程序中的自然语言信息来警告调用站点上错误交换的参数。SwapD 结合了两种独立的检测策略,以提高整体检查器的有效性。我们展示了对总共 4.17 亿行代码的大型 C 和 C++ 程序语料库对 SwapD 进行综合评估的结果。在这次评估中,SwapD 发现了 154 个经过人工审查的错误交换参数的真实案例,表明此类错误,
更新日期:2020-09-22
down
wechat
bug