A Practical Approach to Programming With Assertions

Embedded assertions have been recognized as a potentially powerful tool for automatic runtime detection of software faults during debugging, testing, maintenance and even production versions of software systems. Yet despite the richness of the notations and the maturity of the techniques and tools that have been developed for programming with assertions, assertions are a development tool that has seen little widespread use in practice. The main reasons seem to be that (1) previous assertion processing tools did not integrate easily with existing programming environments, and (2) it is not well understood what kinds of assertions are most effective at detecting software faults. This paper describes experience using an assertion processing tool that was built to address the concerns of ease-of-use and effectiveness. The tool is called APP, an Annotation PreProcessor for C programs developed in UNIX-based development environments, APP has been used in the development of a variety of software systems over the past five years. Based-on this experience, the paper presents a classification of the assertions that were most effective at detecting faults. While the assertions that are described guard against many common kinds of faults and errors, the very commonness of such faults demonstrates the need for an explicit, high-level, automatically checkable specification of required behavior. It is hoped that the classification presented in this paper will prove to be a useful first step in developing a method of programming with assertions. >

[1]  David C. Luckham Programming with Specifications: An Introduction to ANNA, A Language for Specifying Ada Programs , 1990 .

[2]  Steven M. German,et al.  Stanford Pascal Verifier user manual , 1979 .

[3]  Elaine J. Weyuker,et al.  Collecting and categorizing software error data in an industrial environment , 2018, J. Syst. Softw..

[4]  Dewayne E. Perry,et al.  EMPIRICAL STUDY OF SOFTWARE INTERFACE FAULTS. , 1985 .

[5]  Dewayne E. Perry The inscape environment , 1989, ICSE '89.

[6]  Philippe Gautron An Assertion Mechanism Based on Exceptions , 1992, C++ Conference.

[7]  Leon G. Stucki,et al.  New assertion concepts for self-metric software validation , 1975, Reliable Software.

[8]  Sriram Sankar,et al.  Concurrent Runtime Checking of Annotated Ada Programs , 1986, FSTTCS.

[9]  Nancy G. Leveson,et al.  The Use of Self Checks and Voting in Software Error Detection: An Empirical Study , 1990, IEEE Trans. Software Eng..

[10]  Cliff B. Jones,et al.  Systematic software development using VDM , 1986, Prentice Hall International Series in Computer Science.

[11]  Glenn S. Fowler A case for make , 1990, Softw. Pract. Exp..

[12]  S. Yau,et al.  Design of self-checking software , 1975, Reliable Software.

[13]  Olaf Owe,et al.  ANNA A Language for Annotating Ada Programs , 1987, Lecture Notes in Computer Science.

[14]  J. Michael Spivey,et al.  The Z notation - a reference manual , 1992, Prentice Hall International Series in Computer Science.

[15]  Sriram Sankar,et al.  An implementation of Anna , 1985 .

[16]  Yelena Yesha,et al.  Extensions to the C programming language for enhanced fault detection , 1993, Softw. Pract. Exp..

[17]  Bjarne Stroustrup,et al.  The C++ programming language (2nd ed.) , 1991 .

[18]  Sriram Sankar,et al.  Two-dimensional pinpointing: debugging with formal specifications , 1991, IEEE Software.

[19]  Robert O. Hastings,et al.  Fast detection of memory leaks and access errors , 1991 .

[20]  Todd M. Austin,et al.  Efficient detection of all pointer and array access errors , 1994, PLDI '94.

[21]  David C. Luckham,et al.  An Overview of Anna, a Specification Language for Ada , 1985, IEEE Software.

[22]  Stuart I. Feldman,et al.  Make — a program for maintaining computer programs , 1979, Softw. Pract. Exp..

[23]  Sriram Sankar Run-time consistency checking of algebraic specifications , 1991, TAV4.

[24]  Bjarne Stroustrup,et al.  C++ Programming Language , 1986, IEEE Softw..

[25]  Sriram Sankar,et al.  Automatic runtime consistency checking and debugging of formally specified programs , 1989 .

[26]  Balachander Krishnamurthy,et al.  An event-based model of software configuration management , 1991, SCM '91.

[27]  Leon G. Stucki,et al.  New assertion concepts for self-metric software validation , 1975 .

[28]  Albert Endres,et al.  An analysis of errors and their causes in system programs , 1975, IEEE Transactions on Software Engineering.

[29]  Barry Boehm,et al.  Some experience with automated aids to the design of large-scale reliable software , 1975 .

[30]  Doug Lea,et al.  Using Annotated C , 1990 .

[31]  Richard C. Holt,et al.  The Turing programming language , 1988, CACM.

[32]  Barry W. Boehm,et al.  Some experience with automated aids to the design of large-scale reliable software , 1975, IEEE Transactions on Software Engineering.

[33]  Robert W. Floyd,et al.  Assigning Meanings to Programs , 1993 .

[34]  Sriram Sankar,et al.  Concurrent runtime monitoring of formally specified programs , 1993, Computer.

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

[36]  Albert Endres An Analysis of Errors and Their Causes in System Programs , 1975, IEEE Trans. Software Eng..

[37]  Sriram Sankar,et al.  The complete transformation methodology for sequential runtime checking of an ANNA subset , 1986 .