Exposing Library API Misuses via Mutation Analysis

被引:30
作者
Wen, Ming [1 ]
Liu, Yepang [2 ]
Wu, Rongxin [1 ]
Xie, Xuan [3 ]
Cheung, Shing-Chi [1 ]
Su, Zhendong [4 ,5 ]
机构
[1] Hong Kong Univ Sci & Technol, Dept Comp Sci & Engn, Hong Kong, Peoples R China
[2] Southern Univ Sci & Technol, Shenzhen Key Lab Computat Intelligence, Shenzhen, Peoples R China
[3] Sun Yat Sen Univ, Guangzhou, Guangdong, Peoples R China
[4] Swiss Fed Inst Technol, Zurich, Switzerland
[5] Univ Calif Davis, Davis, CA USA
来源
2019 IEEE/ACM 41ST INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING (ICSE 2019) | 2019年
基金
中国国家自然科学基金;
关键词
Mutation Analysis; Library API Misuses; RULES;
D O I
10.1109/ICSE.2019.00093
中图分类号
TP18 [人工智能理论];
学科分类号
081104 ; 0812 ; 0835 ; 1405 ;
摘要
Misuses of library APIs are pervasive and often lead to software crashes and vulnerability issues. Various static analysis tools have been proposed to detect library API misuses. They often involve mining frequent patterns from a large number of correct API usage examples, which can be hard to obtain in practice. They also suffer from low precision due to an over-simplified assumption that a deviation from frequent usage patterns indicates a misuse. We make two observations on the discovery of API misuse patterns. First, API misuses can be represented as mutants of the corresponding correct usages. Second, whether a mutant will introduce a misuse can be validated via executing it against a test suite and analyzing the execution information. Based on these observations, we propose MUTAPI, the first approach to discovering API misuse patterns via mutation analysis. To effectively mimic API misuses based on correct usages, we first design eight effective mutation operators inspired by the common characteristics of API misuses. MUTAPI generates mutants by applying these imitation operators on a set of client projects and collects mutant-killing tests as well as the associated stack traces. Misuse patterns are discovered from the killed mutants that are prioritized according to their likelihood of causing API misuses based on the collected information. We applied MUTAPI on 16 client projects with respect to 73 popular Java APIs. The results show that MUTAPI is able to discover substantial API misuse patterns with a high precision of 0.73. It also achieves a recall of 0.49 on the MUBENCH benchmark, which outperforms the state-of-the-art techniques.
引用
收藏
页码:866 / 877
页数:12
相关论文
共 39 条
[1]   You Get Where You're Looking For The Impact of Information Sources on Code Security [J].
Acar, Yasemin ;
Backes, Michael ;
Fahl, Sascha ;
Kim, Doowon ;
Mazurek, Michelle L. ;
Stransky, Christian .
2016 IEEE SYMPOSIUM ON SECURITY AND PRIVACY (SP), 2016, :289-305
[2]   Analysis of the Encoding Scheme for CS-ACELP Codec for Secured VoIP Communication [J].
Acharya, G. Prasad ;
Reddy, B. Veerender ;
Kumar, P. Naveen .
2009 2ND IEEE INTERNATIONAL CONFERENCE ON COMPUTER SCIENCE AND INFORMATION TECHNOLOGY, VOL 1, 2009, :287-+
[3]  
Acharya M, 2009, LECT NOTES COMPUT SC, V5503, P370
[4]   Applying Mutation Analysis On Kernel Test Suites: An Experience Report [J].
Ahmed, Iftekhar ;
Jensen, Carlos ;
Groce, Alex ;
McKenney, Paul E. .
10TH IEEE INTERNATIONAL CONFERENCE ON SOFTWARE TESTING, VERIFICATION AND VALIDATION WORKSHOPS - ICSTW 2017, 2017, :110-115
[5]  
Amann S, 2018, IEEE T SOFTWARE ENG
[6]  
Baudry B., 2006, 28th International Conference on Software Engineering Proceedings, P82, DOI 10.1145/1134285.1134299
[7]   Improving API Documentation Usability with Knowledge Pushing [J].
Dekel, Uri ;
Herbsleb, James D. .
2009 31ST INTERNATIONAL CONFERENCE ON SOFTWARE ENGINEERING, PROCEEDINGS, 2009, :320-330
[8]  
Egele M, 2013, P 2013 ACM SIGSAC C, P73, DOI DOI 10.1145/2508859.2516693
[9]  
Fahl Sascha, 2012, ACM CCS 12, P50
[10]  
Georgiev Martin, 2012, Proceedings of the 2012 ACM conference on Computer and communications security - CCS'12, page, P38, DOI 10.1145/2382196.2382204