Back to Search Start Over

Detecting Compiler Warning Defects Via Diversity-Guided Program Mutation

Authors :
Zhilei Ren
Weiqiang Kong
Xiaochen Li
Zhide Zhou
He Jiang
Yixuan Tang
Source :
IEEE Transactions on Software Engineering. 48:4411-4432
Publication Year :
2022
Publisher :
Institute of Electrical and Electronics Engineers (IEEE), 2022.

Abstract

Compiler diagnostic warnings help developers identify potential programming mistakes during program compilation. However, these warnings could be erroneous due to the defects of compiler warning diagnostics. Although many techniques have been proposed to automatically generate test programs for compiler warning defect detection, the effectiveness of these techniques on defect-nding is still limited, due to their ability at generating warning-sensitive test program structures. Therefore, in this paper, we propose a DIversity-guided PROgram Mutation approach, called DIPROM, to construct diverse warning-sensitive programs for effective compiler warning defect detection. Given a seed test program, DIPROM rst removes its dead code to reduce false positive warning defects. Then, the abstract syntax tree (AST) of the test program is constructed; DIPROM iteratively mutates the structures of the AST to generate warning-sensitive program variants. To improve the diversity of program variants, DIPROM applies a novel diversity function to guide the selection of the best program variants in each iteration. With the selected program variants, differential testing is conducted to effectively detect warning defects in different compilers. In the experiments, we evaluate DIPROM with two popular C compilers (i.e., GCC and Clang). Experimental results show that DIPROM can detect 75.36% and 218.42% more warning defects than two state-of-the-art approaches (i.e., Epiphron and Csmith), respectively. Meanwhile, DIPROM is efcient, which only spends 61.14% of the time of comparative approaches on average in nding the same number of warning defects. We at last applied DIPROM on the latest development versions of GCC and Clang. After two months running, DIPROM reported 12 new warning defects; nine of them have been conrmed/xed by developers.

Details

ISSN :
23263881 and 00985589
Volume :
48
Database :
OpenAIRE
Journal :
IEEE Transactions on Software Engineering
Accession number :
edsair.doi...........3b265c1de1740e71ee3b2528529ae8b3