Combining Specification-Based Testing, Correctness Proof, and Inspection for Program Verification in Practice

Specification-based testing is limited in detecting program errors; correctness proof based on Hoare logic is difficult to perform in practice; and inspection is heavily dependent on human decisions. Each of these three is difficult to do a satisfactory job alone, but they complement each other when they come together in an appropriate manner. This paper puts forward a new method that makes good use of Hoare logic and inspection to improve the effectiveness of specification-based testing in detecting errors. The underlying principle of the method is first to use specification-based testing to discover traversed program paths and then to use Hoare logic to prove their correctness, but when proof is impossible to conduct, a special inspection is applied. During the proof or inspection process, all faults on the paths are expected to be detected. A case study is conducted to show its feasibility; an example taken from the case study is used to illustrate how the proposed method is applied; and a discussion on the important issues to be addressed in the future is presented.

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

[2]  Sarfraz Khurshid,et al.  TestEra: Specification-Based Testing of Java Programs Using SAT , 2004, Automated Software Engineering.

[3]  David Lorge Parnas,et al.  Precise Documentation of Well-Structured Programs , 1994, IEEE Trans. Software Eng..

[4]  Shaoying Liu Utilizing Hoare Logic to Strengthen Testing for Error Detection in Programs , 2012, Turing-100.

[5]  Bertrand Meyer,et al.  Eiffel: The Language , 1991 .

[6]  Shaoying Liu Formal Engineering for Industrial Software Development: Using the SOFL Method , 2004 .

[7]  Shaoying Liu,et al.  Formal Engineering for Industrial Software Development , 2004, Springer Berlin Heidelberg.

[8]  Gul A. Agha,et al.  Concurrent object-oriented programming , 1993, CACM.

[9]  Shaoying Liu,et al.  A Decompositional Approach to Automatic Test Case Generation Based on Formal Specifications , 2010, 2010 Fourth International Conference on Secure Software Integration and Reliability Improvement.

[10]  Alan Mycroft,et al.  Logical Testing , 2009, FASE.

[11]  Shaoying Liu,et al.  A "Vibration" Method for Automatically Generating Test Cases Based on Formal Specifications , 2011, 2011 18th Asia-Pacific Software Engineering Conference.

[12]  Shaoying Liu,et al.  A Rigorous Method for Inspection of Model-Based Formal Specifications , 2010, IEEE Transactions on Reliability.

[13]  Claes Wohlin,et al.  State‐of‐the‐art: software inspections after 25 years , 2002, Softw. Test. Verification Reliab..

[14]  Shaoying Liu,et al.  Automatic Transformation from Formal Specifications to Functional Scenario Forms for Automatic Test Case Generation , 2010, SoMeT.

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

[16]  C. A. R. Hoare,et al.  An axiomatic definition of the programming language PASCAL , 1972, Acta Informatica.

[17]  Shaoying Liu,et al.  Formal Specification-Based Inspection for Verification of Programs , 2012, IEEE Transactions on Software Engineering.

[18]  Ernesto Pimentel,et al.  Design by Contract in Smalltalk , 1996, J. Object Oriented Program..