共 50 条
Out of Sight, Out of Place: Detecting and Assessing Swapped Arguments
被引:5
|作者:
Scott, Roger
[1
]
Ranieri, Joseph
[1
]
Kot, Lucja
[1
]
Kashyap, Vineeth
[1
]
机构:
[1] GrammaTech Inc, Ithaca, NY USA
来源:
关键词:
static analysis;
natural language;
swapped arguments;
big code;
D O I:
10.1109/SCAM51674.2020.00031
中图分类号:
TP31 [计算机软件];
学科分类号:
081202 ;
0835 ;
摘要:
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.
引用
收藏
页码:227 / 237
页数:11
相关论文