The application of formal specifications to software documentation and debugging
This paper illustrates the application of formal specifications to software documentation and debugging by presenting a real-life scenario involving the use of a garbage collection package. It illustrates the advantages of using formal specifications over informal documentation. The paper also illustrates the usefulness of run-time checking tools that compares program behavior with their formal specifications.
The scenario presented in this paper goes through a series of steps that include formal specification, run-time checking, and modification of the specification and program based on the results of run-time checking — the typical steps involved in a debugging process, except that this scenario makes use of formal specifications.
Although various research ideas presented in this paper have been published earlier, this paper assimilates all these ideas into a real-life scenario, and illustrates in an easy-to-understand way that these ideas are really useful to software documentation and debugging.
The example has been developed in Ada, and formally specified using the Anna specification language. The tool used in the example is the Anna Run-Time Consistency Checking System developed at Stanford University.
Keywordsalgorithmic debugging Anna formal specification formal documentation run-time consistency checking software testing
Unable to display preview. Download preview PDF.
- R. W. Floyd. Assigning meanings to programs. In Proceedings of a Symposium in Applied Mathematics of the American Mathematical Society, volume 19, pages 19–32. American Mathematical Society, 1967.Google Scholar
- J. B. Goodenough and S. L. Gerhart. Towards a theory of test data selection. In Proceedings of the International Conference on Reliable Software, pages 493–510, April 1975.Google Scholar
- C. Green, D. Luckham, R. Balzer, T. Cheatham, and C. Rich. Report on a knowledge based software assistant. Technical report, Kestrel Institute, 1983.Google Scholar
- J. V. Guttag, J. J. Horning, and J. M. Wing. The Larch family of specification languages. IEEE Software, 2(5):24–36, September 1985.Google Scholar
- D. P. Helmbold and D. C. Luckham. Runtime detection and description of deadness errors in Ada tasking. Technical Report 83-249, Computer Systems Laboratory, Stanford University, November 1983. (Program Analysis and Verification Group Report 22).Google Scholar
- W. E. Howden. Algebraic program testing. Acta Informatica, 10:53–66, 1978.Google Scholar
- B. Krieg-Brückner. Transformation of interface specifications, 1985. PROSPECTRA Study Note M.1.1.S1-SN-2.0.Google Scholar
- R. L. London. A view of program verification. In Proceedings of the International Conference on Reliable Software, pages 534–545, April 1975.Google Scholar
- D. C. Luckham, S. Sankar, and S. Takahashi. Two dimensional pinpointing: An application of formal specification to debugging packages. IEEE Software, 8(1):74–84, January 1991. (Also Stanford University Technical Report No. CSL-TR-89-379.).Google Scholar
- D. C. Luckham and F. W. von Henke. An overview of Anna, a specification language for Ada. IEEE Software, 2(2):9–23, March 1985.Google Scholar
- David C. Luckham. Programming with Specifications: An Introduction to ANNA, A Language for Specifying Ada Programs. Texts and Monographs in Computer Science. Springer-Verlag, October, 1990.Google Scholar
- David C. Luckham, Friedrich W. von Henke, Bernd Krieg-Brückner, and Olaf Owe. ANNA, A Language for Annotating Ada Programs, volume 260 of Lecture Notes in Computer Science. Springer-Verlag, 1987.Google Scholar
- N. Madhav and W. R. Mann. A methodology for formal specification and implementation of Ada packages using Anna. In Proceedings of the Computer Software and Applications Conference, 1990, pages 491–496. IEEE Computer Society Press, 1990. (Also Stanford University Computer Systems Laboratory Technical Report No. 90-438).Google Scholar
- N. Madhav and S. Sankar. Application of formal specification to software maintenance. In Proceedings of the Conference on Software Maintenance, pages 230–241. IEEE Computer Society Press, November 1990.Google Scholar
- Walter Mann. The Anna package specification analyzer user's guide. Technical Note CSL-TN-93-390, Computer Systems Lab, Stanford University, January 1993.Google Scholar
- B. Meyer. Object-Oriented Software Construction. Prentice-Hall, 1988.Google Scholar
- S. Sankar. Automatic Runtime Consistency Checking and Debugging of Formally Specified Programs. PhD thesis, Stanford University, August 1989. Also Stanford University Department of Computer Science Technical Report No. STAN-CS-89-1282, and Computer Systems Laboratory Technical Report No. CSL-TR-89-391.Google Scholar
- S. Sankar. A note on the detection of an Ada compiler bug while debugging an Anna program. ACM SIGPLAN Notices, 24(6):23–31, 1989.Google Scholar
- S. Sankar and D. S. Rosenblum. The complete transformation methodology for sequential runtime checking of an Anna subset. Technical Report 86-301, Computer Systems Laboratory, Stanford University, June 1986. (Program Analysis and Verification Group Report 30).Google Scholar
- Sriram Sankar. Run-time consistency checking of algebraic specifications. In Proceedings of the Symposium on Testing, Analysis, and Verification (TAV4), pages 123–129, Victoria, Canada, October 1991. ACM Press.Google Scholar
- Sriram Sankar, Anoop Goyal, and Prakash Sikchi. Software testing using algebraic specification based test oracles. Forthcoming Stanford University Technical Report, April 1993.Google Scholar
- J. M. Spivey. Understanding Z, A Specification Language and its Formal Semantics. Cambridge Unversity Press, 1988. Tracts in Theorectical Computer Science, Volume 3.Google Scholar
- L. G. Stucki and G. L. Foshee. New assertion concepts for self-metric software validation. In Proceedings of the International Conference on Reliable Software, pages 59–65, April 1975.Google Scholar