Out of Sight, Out of Place: Detecting and Assessing Swapped Arguments

09/18/2020
by   Roger Scott, et al.
0

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.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
04/10/2023

QChecker: Detecting Bugs in Quantum Programs via Static Analysis

Static analysis is the process of analyzing software code without execut...
research
07/11/2019

R Melts Brains -- An IR for First-Class Environments and Lazy Effectful Arguments

The R programming language combines a number of features considered hard...
research
09/13/2017

Liveness-Driven Random Program Generation

Randomly generated programs are popular for testing compilers and progra...
research
04/10/2017

ROSA: R Optimizations with Static Analysis

R is a popular language and programming environment for data scientists....
research
10/26/2021

Neural Program Generation Modulo Static Analysis

State-of-the-art neural models of source code tend to be evaluated on th...
research
12/20/2022

Augmenting Diffs With Runtime Information

Source code diffs are used on a daily basis as part of code review, insp...
research
02/10/2023

C-rusted: The Advantages of Rust, in C, without the Disadvantages

C-rusted is an innovative technology whereby C programs can be (partly) ...

Please sign up or login with your details

Forgot password? Click here to reset