Mining temporal specifications from object usage

A caller must satisfy the callee’s precondition—that is, reach a state in which the callee may be called. Preconditions describe the state that needs to be reached, but not how to reach it. We combine static analysis with model checking to mine Fair Computation Tree Logic (CTLF) formulas that describe the operations a parameter goes through: “In parseProperties(String xml), the parameter xml normally stems from getProperties().” Such operational preconditions can be learned from program code, and the code can be checked for their violations. Applied to AspectJ, our Tikanga prototype found 169 violations of operational preconditions, uncovering 7 unique defects and 27 unique code smells—with 52% true positives in the 25% top-ranked violations.

[1]  William Chan Temporal-logic queries , 2000 .

[2]  George C. Necula,et al.  Mining Temporal Specifications for Error Detection , 2005, TACAS.

[3]  Andreas Zeller,et al.  Why Programs Fail: A Guide to Systematic Debugging , 2005 .

[4]  Nikolai Tillmann,et al.  DySy: dynamic symbolic execution for invariant inference , 2008, ICSE.

[5]  Zhendong Su,et al.  Online inference and enforcement of temporal properties , 2010, 2010 ACM/IEEE 32nd International Conference on Software Engineering.

[6]  Rastislav Bodík,et al.  Jungloid mining: helping to navigate the API jungle , 2005, PLDI '05.

[7]  Zhendong Su,et al.  Javert: fully automatic mining of general temporal properties from dynamic traces , 2008, SIGSOFT '08/FSE-16.

[8]  Eric Bodden,et al.  Finding programming errors earlier by evaluating runtime monitors ahead-of-time , 2008, SIGSOFT '08/FSE-16.

[9]  Suresh Jagannathan,et al.  Static specification inference using predicate mining , 2007, PLDI '07.

[10]  James R. Larus,et al.  Mining specifications , 2002, POPL '02.

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

[12]  Andreas Zeller,et al.  Lightweight Defect Localization for Java , 2005, ECOOP.

[13]  Pavol Cerný,et al.  Synthesis of interface specifications for Java classes , 2005, POPL '05.

[14]  Bernhard Ganter,et al.  Formal Concept Analysis: Mathematical Foundations , 1998 .

[15]  Eran Yahav,et al.  Effective typestate verification in the presence of aliasing , 2006, TSEM.

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

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

[18]  William G. Griswold,et al.  Dynamically discovering likely program invariants to support program evolution , 1999, Proceedings of the 1999 International Conference on Software Engineering (IEEE Cat. No.99CB37002).

[19]  Kajal T. Claypool,et al.  XSnippet: mining For sample code , 2006, OOPSLA '06.

[20]  Tao Xie,et al.  Mining Interface Specifications for Generating Checkable Robustness Properties , 2006, 2006 17th International Symposium on Software Reliability Engineering.

[21]  Monica S. Lam,et al.  Automatic extraction of object-oriented component interfaces , 2002, ISSTA '02.

[22]  Andreas Zeller,et al.  Generating test cases for specification mining , 2010, ISSTA '10.

[23]  Jian Pei,et al.  Mining API patterns as partial orders from source code: from usage scenarios to specifications , 2007, ESEC-FSE '07.

[24]  Eran Yahav,et al.  Static Specification Mining Using Automata-Based Abstractions , 2008, IEEE Transactions on Software Engineering.

[25]  Steven P. Reiss Specifying and checking component usage , 2005, AADEBUG'05.

[26]  Andreas Zeller,et al.  Mining temporal specifications from object usage , 2009, 2009 IEEE/ACM International Conference on Automated Software Engineering.

[27]  Bertrand Meyer,et al.  A comparative study of programmer-written and automatically inferred contracts , 2009, ISSTA.

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

[29]  Benjamin Livshits,et al.  DynaMine: finding common error patterns by mining software revision histories , 2005, ESEC/FSE-13.

[30]  Tao Xie,et al.  Mining exception-handling rules as sequence association rules , 2009, 2009 IEEE 31st International Conference on Software Engineering.

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

[32]  M. Lam,et al.  Tracking down software bugs using automatic anomaly detection , 2002, Proceedings of the 24th International Conference on Software Engineering. ICSE 2002.

[33]  K. Rustan M. Leino,et al.  Houdini, an Annotation Assistant for ESC/Java , 2001, FME.

[34]  Amer Diwan,et al.  Discovering Algebraic Specifications from Java Classes , 2003, ECOOP.

[35]  Bengt Jonsson,et al.  Implementing a Model Checking Algorithm by Adapting Existing Automated Tools , 1989, Automatic Verification Methods for Finite State Systems.

[36]  M. Fowler Improving the Design of Existing Code , 2000 .

[37]  Richard G. Hamlet,et al.  Automatically Checking an Implementation against Its Formal Specification , 2000, IEEE Trans. Software Eng..

[38]  Andrzej Wasylkowski Object Usage: Patterns and Anomalies , 2010 .

[39]  Rajeev Motwani,et al.  Dynamic itemset counting and implication rules for market basket data , 1997, SIGMOD '97.

[40]  Alexander L. Wolf,et al.  Discovering models of software processes from event-based data , 1998, TSEM.

[41]  Andreas Zeller,et al.  Detecting object usage anomalies , 2007, ESEC-FSE '07.

[42]  Jian Pei,et al.  MAPO: Mining and Recommending API Usage Patterns , 2009, ECOOP.

[43]  Marsha Chechik,et al.  Temporal Logic Query Checking: A Tool for Model Exploration , 2003, IEEE Trans. Software Eng..

[44]  Jiong Yang,et al.  Discovering Neglected Conditions in Software by Mining Dependence Graphs , 2008, IEEE Transactions on Software Engineering.