Using specifications to check source code

Traditional static checkers are limited to detecting simple anomalies since thy have no information regarding the intent of the code. Program verifiers are too expensive for nearly all applications. This thesis investigates the possibilities of using specifications too lightweight static checks to detect inconsistencies between specifications and implementations. A tool, LCLint, was developed to do static checks on C source code using LCL specifications. It is similar to traditional lint, except it uses information in specifications to do more powerful checks. Some typical problems detected by LCLint include violations of abstraction barriers and modifications of caller-visible state that are inconsistent with the specification. Experience using LCLint to check a specified program and to understand and maintain a program with no specifications illustrate some applications of LCLint and suggest future directions for using specifications to check source code.

[1]  D. Perry The Logic of Propagation in the Inscape Environment , 1989, Symposium on Testing, Analysis, and Verification.

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

[3]  Andrew Koenig,et al.  C Traps and Pitfalls , 1989 .

[4]  Brian W. Kernighan,et al.  The C Programming Language, Second Edition , 1988 .

[5]  Stephen J. Garland,et al.  Larch: Languages and Tools for Formal Specification , 1993, Texts and Monographs in Computer Science.

[6]  William E. Howden,et al.  Comments analysis and programming errors , 1990, IEEE Transactions on Software Engineering.

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

[8]  Leon J. Osterweil,et al.  Omega -- A Data Flow Analysis Tool for the C Programming Language ; CU-CS-217-82 , 1982 .

[9]  Craig Schaffert,et al.  CLU Reference Manual , 1984, Lecture Notes in Computer Science.

[10]  Sriram Sankar,et al.  The Stanford ADA style checker: an application of the ANNA tools and methodology , 1991 .

[11]  Keith W. Miller,et al.  Adding data abstraction to Fortran software , 1988, IEEE Software.

[12]  Daniel Jackson,et al.  Aspect: a formal specification language for detecting bugs , 1992 .

[13]  Leon J. Osterweil,et al.  Omega—A Data Flow Analysis Tool for the C Programming Language , 1985, IEEE Transactions on Software Engineering.

[14]  V. Stavridou,et al.  Abstraction and specification in program development , 1988 .

[15]  M. F.,et al.  Bibliography , 1985, Experimental Gerontology.

[16]  Leon J. Osterweil,et al.  Interprocedural static analysis of sequencing constraints , 1992, TSEM.

[17]  Frank Pfenning,et al.  Refinement types for ML , 1991, PLDI '91.

[18]  Nagui Halim,et al.  A New Programming Methodology for Long-Lived Software Systems , 1984, IBM J. Res. Dev..

[19]  Leon J. Osterweil,et al.  Cesar: a static sequencing constraint analyzer , 1989, TAV3.

[20]  Leon J. Osterweil,et al.  Data Flow Analysis in Software Reliability , 1976, CSUR.

[21]  Murray Hill,et al.  Lint, a C Program Checker , 1978 .

[22]  Yang Meng Tan Formal specification techniques for promoting software modularity, enhancing documentation, and testing specifications , 1994 .

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