Dynamic inference of likely data preconditions over predicates by tree learning

Sriram Sankaranarayanan, Swarat Chaudhuri, Franjo Ivančić, Aarti Gupta
2008 Proceedings of the 2008 international symposium on Software testing and analysis - ISSTA '08  
We present a technique to infer likely data preconditions for procedures written in an imperative programming language. Given a procedure and a set of predicates over its inputs, our technique enumerates different truth assignments to the predicates, deriving test cases from each feasible truth assignment. The predicates themselves are derived automatically using simple heuristics. The enumeration of truth assignments is performed using a propositional SAT solver along with a theory
more » ... ty checker capable of generating unsatisfiable cores. For each assignment of truth values, a corresponding set of test cases are generated and executed. Based on the result of the execution, the truth assignment is classified as being safe or buggy. Finally, a decision tree classifier is used to generate a Boolean formula over the input predicates that explains the data obtained from the test cases. The resulting Boolean formula is, in effect, a likely data precondition for the procedure under consideration. We apply our techniques on a wide variety of functions from the standard C library. Our experiments show that the proposed technique is quite robust. For most cases, it successfully learns a precondition that captures a safe and permissive calling environment.
doi:10.1145/1390630.1390666 dblp:conf/issta/SankaranarayananCIG08 fatcat:lqxl43hcx5a2vfnnupkbjtlcc4