Automated Random Testing to Detect Specification-Code Inconsistencies

An interface specification language such as JML provides a means to document precisely the behavior of program modules such as Java classes, and it is being adopted by industry. However, few practical tools exist for programmers to assure the correctness of their interface specifications. Nonetheless, the correctness of an interface specification is a prerequisite for the use of the specification, both as a precise API documentation and as a foundation for formal verification of and reasoning about the implementation. We propose automated random testing as a practical tool to assure the correctness of interface specifications. The key idea of our approach is to fully automate dynamic, random testing to detect as many inconsistencies as possible between the specification and its implementation. For this, we use a runtime assertion checker as a test oracle, and the goal of our testing is to generate as many non-duplicate test cases as possible that incur a certain type of runtime assertion violations. Our approach has been implemented for Java/JML in a prototype tool called JET, and a preliminary experiment shows that it has a potential to be a valuable testing tool for Java/JML. Our approach can be adapted for other interface specification languages.

[1]  David Lorge Parnas,et al.  Using Test Oracles Generated from Program Documentation , 1998, IEEE Trans. Software Eng..

[2]  Albert L. Baker,et al.  JML: A Notation for Detailed Design , 1999, Behavioral Specifications of Businesses and Systems.

[3]  Software and Component Testing: Using Jtest ® to Automate Unit Testing and Coding Standard Enforcement , .

[4]  Michael D. Ernst,et al.  An overview of JML tools and applications , 2003, Electron. Notes Theor. Comput. Sci..

[5]  Yoonsik Cheon,et al.  A Fitness Function for Modular Evolutionary Testing of Object-Oriented Programs , 2005 .

[6]  Wolfram Schulte,et al.  The ABCs of specification: asml, behavior, and components , 2001, Informatica.

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

[8]  Fabrice Bouquet,et al.  Symbolic Animation of JML Specifications , 2005, FM.

[9]  Gary T. Leavens,et al.  How the design of JML accommodates both runtime assertion checking and formal verification , 2003, Sci. Comput. Program..

[10]  João Abreu,et al.  Checking the Conformance of Java Classes Against Algebraic Specifications , 2006, ICFEM.

[11]  Yoonsik Cheon,et al.  Specifying and checking method call sequences of Java programs , 2006, Software Quality Journal.

[12]  Yoonsik Cheon,et al.  A Runtime Assertion Checker for the Java Modeling Language (JML) , 2003, ICSE 2003.

[13]  Gary T. Leavens,et al.  A Simple and Practical Approach to Unit Testing: The JML and JUnit Way , 2002, ECOOP.

[14]  Kent Beck,et al.  Test-infected: programmers love writing tests , 2000 .

[15]  Elaine J. Weyuker,et al.  Automatically Generating Test Data from a Boolean Specification , 1994, IEEE Trans. Software Eng..

[16]  Bertrand Meyer,et al.  Applying 'design by contract' , 1992, Computer.

[17]  Albert L. Baker,et al.  Preliminary design of JML: a behavioral interface specification language for java , 2006, SOEN.

[18]  Matthew B. Dwyer,et al.  Checking JML specifications using an extensible software model checking framework , 2006, International Journal on Software Tools for Technology Transfer.

[19]  Yoonsik Cheon,et al.  A Complete Automation of Unit Testing for Java Programs , 2005, Software Engineering Research and Practice.

[20]  Yannis Smaragdakis,et al.  JCrasher: an automatic robustness tester for Java , 2004, Softw. Pract. Exp..

[21]  David Notkin,et al.  Rostra: a framework for detecting redundant object-oriented unit tests , 2004, Proceedings. 19th International Conference on Automated Software Engineering, 2004..

[22]  Michael D. Ernst,et al.  Eclat: Automatic Generation and Classification of Test Inputs , 2005, ECOOP.

[23]  Wolfram Schulte,et al.  Runtime verification of .NET contracts , 2003, J. Syst. Softw..