Mining Function Call Sequence Patterns Across Different Versions of the Project for Defect Detection

Large scale programs usually imply many programming rules, which are missing from specification documents. However, if programmers violate these rules in the process of programming, they may introduce software defects. Mining programming rules for detecting defect is an effective way to alleviate this problem. However, previous works suffer from a large number of candidate rules and suspicious defects which need manual validation. This issue affects the applicability and scalability of these previously proposed approaches. This paper proposes a novel approach to detect defects based on programming rules mined from different versions of a project. Firstly, it mines function call sequence patterns from the version under analysis and a previous stable version; secondly, it filters useful function call sequence patterns based on the patterns contained in the previous version; thirdly, the programs are automatically checked against filtered patterns for detecting suspicious defects. Experiments are carried out on three open source projects varies from 12k to 142k LOC to evaluate the effectiveness of our proposed approach. The experiment results show that the approach can improve the efficiency of defect detection by reducing 55% suspicious defects for the three projects without comprising the defect detection capability.

[1]  Bertrand Meyer,et al.  Inferring better contracts , 2011, 2011 33rd International Conference on Software Engineering (ICSE).

[2]  Tao Xie,et al.  Alattin: Mining Alternative Patterns for Detecting Neglected Conditions , 2009, 2009 IEEE/ACM International Conference on Automated Software Engineering.

[3]  Hridesh Rajan,et al.  Mining preconditions of APIs in large-scale code corpus , 2014, FSE 2014.

[4]  Ramakrishnan Srikant,et al.  Mining Sequential Patterns: Generalizations and Performance Improvements , 1996, EDBT.

[5]  Mei Hong Software Analysis:A Road Map , 2009 .

[6]  Zhenmin Li,et al.  PR-Miner: automatically extracting implicit programming rules and detecting violations in large software code , 2005, ESEC/FSE-13.

[7]  Xiang Chen,et al.  PSP-Finder: A Defect Detection Method Based on Mining Correlations from Function Call Paths , 2018 .

[8]  Grigore Rosu,et al.  How good are the specs? A study of the bug-finding effectiveness of existing Java API specifications , 2016, 2016 31st IEEE/ACM International Conference on Automated Software Engineering (ASE).

[9]  Hoan Anh Nguyen,et al.  Graph-based mining of multiple object usage patterns , 2009, ESEC/FSE '09.

[10]  Swarat Chaudhuri,et al.  Bayesian specification learning for finding API usage errors , 2017, ESEC/SIGSOFT FSE.

[11]  Dawson R. Engler,et al.  Bugs as deviant behavior: a general approach to inferring errors in systems code , 2001, SOSP.

[12]  Thomas R. Gross,et al.  Automatic Generation of Object Usage Specifications from Large Method Traces , 2009, 2009 IEEE/ACM International Conference on Automated Software Engineering.

[13]  Houari A. Sahraoui,et al.  An observational study on API usage constraints and their documentation , 2015, 2015 IEEE 22nd International Conference on Software Analysis, Evolution, and Reengineering (SANER).

[14]  Andreas Zeller,et al.  Mining object behavior with ADABU , 2006, WODA '06.

[15]  Ramakrishnan Srikant,et al.  Mining sequential patterns , 1995, Proceedings of the Eleventh International Conference on Data Engineering.

[16]  Mira Mezini,et al.  Ieee Transactions on Software Engineering 1 Automated Api Property Inference Techniques , 2022 .

[17]  Manuvir Das,et al.  Perracotta: mining temporal API rules from imperfect traces , 2006, ICSE.

[18]  Hong Mei,et al.  Inferring Specifications of Object Oriented APIs from API Source Code , 2008, 2008 15th Asia-Pacific Software Engineering Conference.

[19]  Mauro Pezzè,et al.  Software testing and analysis - process, principles and techniques , 2007 .

[20]  Jonathan I. Maletic,et al.  An approach to mining call-usage patternswith syntactic context , 2007, ASE.

[21]  Yan Zhang,et al.  AntMiner: Mining More Bugs by Reducing Noise Interference , 2016, 2016 IEEE/ACM 38th International Conference on Software Engineering (ICSE).