Synthesis of interface specifications for Java classes

While a typical software component has a clearly specified (static) interface in terms of the methods and the input/output types they support, information about the correct sequencing of method calls the client must invoke is usually undocumented. In this paper, we propose a novel solution for automatically extracting such temporal specifications for Java classes. Given a Java class, and a safety property such as "the exception E should not be raised", the corresponding (dynamic) interface is the most general way of invoking the methods in the class so that the safety property is not violated. Our synthesis method first constructs a symbolic representation of the finite state-transition system obtained from the class using predicate abstraction. Constructing the interface then corresponds to solving a partial-information two-player game on this symbolic graph. We present a sound approach to solve this computationally-hard problem approximately using algorithms for learning finite automata and symbolic model checking for branching-time logics. We describe an implementation of the proposed techniques in the tool JIST--- Java Interface Synthesis Tool---and demonstrate that the tool can construct interfaces accurately and efficiently for sample Java2SDK library classes.

[1]  Howard Barringer,et al.  Assumption generation for software component verification , 2002, Proceedings 17th IEEE International Conference on Automated Software Engineering,.

[2]  Laurie Hendren,et al.  Soot---a java optimization framework , 1999 .

[3]  Sriram K. Rajamani,et al.  The SLAM project: debugging system software via static analysis , 2002, POPL '02.

[4]  Hassen Saïdi,et al.  Construction of Abstract State Graphs with PVS , 1997, CAV.

[5]  Ronald L. Rivest,et al.  Inference of finite automata using homing sequences , 1989, STOC '89.

[6]  Nicolas Halbwachs,et al.  Automatic discovery of linear restraints among variables of a program , 1978, POPL.

[7]  Howard Barringer,et al.  Proof Rules for Automated Compositional Verification through Learning , 2003 .

[8]  David Walker,et al.  A type system for expressive security policies , 2000, POPL '00.

[9]  Corina S. Pasareanu,et al.  Learning Assumptions for Compositional Verification , 2003, TACAS.

[10]  Marco Pistore,et al.  NuSMV 2: An OpenSource Tool for Symbolic Model Checking , 2002, CAV.

[11]  Thomas A. Henzinger,et al.  Interface Compatibility Checking for Software Modules , 2002, CAV.

[12]  Bengt Jonsson,et al.  Insights to Angluin's Learning , 2005, SVV@ICLP.

[13]  George C. Necula,et al.  Temporal-Safety Proofs for Systems Code , 2002, CAV.

[14]  Dana Angluin,et al.  Learning Regular Sets from Queries and Counterexamples , 1987, Inf. Comput..

[15]  Ronald L. Rivest,et al.  Inference of finite automata using homing sequences , 1989, STOC '89.

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

[17]  John H. Reif,et al.  Universal games of incomplete information , 1979, STOC.

[18]  Patrick Cousot,et al.  Abstract interpretation: a unified lattice model for static analysis of programs by construction or approximation of fixpoints , 1977, POPL.

[19]  Matthew B. Dwyer,et al.  Automated environment generation for software model checking , 2003, 18th IEEE International Conference on Automated Software Engineering, 2003. Proceedings..

[20]  References , 1971 .

[21]  Thomas A. Henzinger,et al.  Interface automata , 2001, ESEC/FSE-9.

[22]  Gerard J. Holzmann,et al.  SOFTWARE TESTING, VERIFICATION AND RELIABILITY , 2022 .

[23]  Francesco Logozzo,et al.  Automatic Inference of Class Invariants , 2004, VMCAI.

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

[25]  Robert DeLine,et al.  Enforcing high-level protocols in low-level software , 2001, PLDI '01.

[26]  Thomas A. Henzinger,et al.  Alternating-time temporal logic , 1997, Proceedings 38th Annual Symposium on Foundations of Computer Science.

[27]  Marco Pistore,et al.  Nusmv version 2: an opensource tool for symbolic model checking , 2002, CAV 2002.

[28]  Wolfgang Thomas,et al.  Infinite Games and Verification (Extended Abstract of a Tutorial) , 2002, CAV.

[29]  Thomas A. Henzinger,et al.  Abstractions from proofs , 2004, POPL.

[30]  Michael D. Ernst,et al.  Automatic generation of program specifications , 2002, ISSTA '02.

[31]  Gerard J. Holzmann,et al.  Software Model Checking , 1999, FORTE.

[32]  James C. Corbett,et al.  Bandera: extracting finite-state models from Java source code , 2000, ICSE.

[33]  Deepak Goyal,et al.  Deriving specialized program analyses for certifying component-client conformance , 2002, PLDI '02.