Mining Quantified Temporal Rules: Formalism, Algorithms, and Evaluation

Libraries usually impose constraints on how clients should use them. Often these constraints are not well-documented. In this paper, we address the problem of recovering such constraints automatically, a problem referred to as specification mining. Given some client programs that use a given library, we identify constraints on the library usage that are (almost) satisfied by the given set of clients.The class of rules we target for mining combines simple binary temporal operators with state predicates (involving equality constraints) and quantification. This is a simple yet expressive subclass of temporal properties that allows us to capture many common API usage rules. We focus on recovering rules from execution traces and apply classical data mining concepts to be robust against bugs (API usage rule violations) in clients. We present new algorithms for mining rules from execution traces. We show how a propositional rule mining algorithm can be generalized to treat quantification and state predicates in a unified way. Our approach enables the miner to be complete — mine all rules within the targeted class that are satisfied by the given traces — while avoiding an exponential blowup.We have implemented these algorithms and used them to mine API usage rules for several Windows APIs. Our experiments show the efficiency and effectiveness of our approach.

[1]  David Evans,et al.  Dynamically inferring temporal properties , 2004, PASTE.

[2]  Leonardo Mariani,et al.  Automatic generation of software behavioral models , 2008, 2008 ACM/IEEE 30th International Conference on Software Engineering.

[3]  Sebastián Uchitel,et al.  Detecting Implied Scenarios from Execution Traces , 2007, 14th Working Conference on Reverse Engineering (WCRE 2007).

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

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

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

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

[8]  Grigore Rosu,et al.  Mining Parametric State-Based Specifications from Executions , 2008 .

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

[10]  Ramakrishnan Srikant,et al.  Fast algorithms for mining association rules , 1998, VLDB 1998.

[11]  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).

[12]  Kamran Sartipi,et al.  Dynamic Analysis of Software Systems using Execution Pattern Mining , 2006, 14th IEEE International Conference on Program Comprehension (ICPC'06).