Abstract
Although computer scientists understand the importance of discrete mathematics to the foundations of their field, computer science (CS) students do not always see the relevance. Thus, it is important to find a way to show students its relevance. The concept of program correctness is generally taught as an activity independent of the programming process, hence many CS students perceive it as unnecessary, and even irrelevant. The concept of contracts, on the other hand, is generally taught as an integral part of the programming process. Most CS students have little difficulty understanding the need to establish contracts via preconditions and postconditions. In order to improve teaching program correctness concepts, we implemented ProVIDE, an enhanced integrated development environment (IDE). ProVIDE assists student programmers in contract construction. Rather than asking for both a precondition and postcondition for each of the student's methods, ProVIDE asks the student to simply supply a postcondition. ProVIDE then helps the student construct the appropriate precondition by leading him or her through an axiomatic proof of the method's correctness. Thus, the proof of of the method's correctness is a side-effect of the student's need to construct an appropriate precondition.
- ACM JAVA Task Force. 2005. Java Task Force Report: First Public Draft. Internet. Feb.1, 2005: http://cs.stanford.edu/~eroberts//jtf/.]]Google Scholar
- ACM/IEEE Joint Task Force On Computing Curricula. 2001. Computing Curricula 2001: Computer Science. Internet. Dec. 15, 2001. http://www.sigcse.org/cc2001/.]]Google Scholar
- Backhouse, R.W. 1986. Program Construction and Verification. Prentice Hall, Englewood Cliffs, N.J.]] Google Scholar
- Backhouse, R.W 2003. Program Construction: Calculating Implementations from Specifications. John Wiley, New York.]] Google Scholar
- Barnett, M., Deline, R. Fahndrich, M., Leino, K.R.M., and Schulte, W. 2004. Verification of object-oriented program with invariants. J. Object Technol. 3, 6, 27--56.]]Google ScholarCross Ref
- Beugnard, A., Jezequel, J.M., Plouzeau, N., and Watkins, D. 1999. Making components contract aware. IEEE Computer 32, 7, 38--45.]] Google ScholarDigital Library
- Bruce, K.B., Drysdale, S.R.L, Keleman, C., and Tucker, A. 2003. Why math? Commun. ACM 49, 9, 40--44.]] Google ScholarDigital Library
- Devlin, K. 2003. Why universities require computer science students to take math. Commun. ACM 49,9, 37--39.]]Google Scholar
- Dijksktra, E.W. 1976. A Discipline of Programming. Prentice Hall, Upper Saddle River, N.J.]] Google Scholar
- Floyd, R.W. 1967. Assigning meaning to programs. In Proceedings of the 19th Symposium on Applied Mathematics (Mathematical Aspects of Computer Science), American Mathematical Society, Providence, RI.]]Google Scholar
- Gegg-Harrison, T.S. 2001. Egyptian numbers: A CS-complete example. In Proceedings of the 32nd SIGCSE Technical Symposium on Computer Science Education (SIGCSE 2001), ACM, New York, 268--272.]] Google Scholar
- Gegg-Harrison, T.S., Bunce, G.R., Ganetzky, R.D., Olson, C.M., and Wilson, J.D. 2003. Studying program correctness by constructing contracts. In Proceedings of the 8th Annual Conference on Innovation and Technology in Computer Science Education (ITiCSE 2003), ACM, New York, 129--133.]] Google Scholar
- Huizing, K. and Kuiper, R. 2000. Verification of object-oriented programs using class invariants. In Proceedings of the 3rd International Conference on Fundamental Approaches of Software Engineering (FASE 2000), Springer-Verlag, New York, 208--221.]] Google ScholarCross Ref
- Gries, D. 1981. The Science of Programming. Springer-Verlag, New York.]] Google Scholar
- Henderson, P.B. 2003. Mathematical reasoning in software engineering education. Commun. ACM 49, 9, 45--50.]] Google ScholarDigital Library
- Hoare, C.A.R. 1969. An axiomatic basis for computer programming. Commun. ACM 12, 10, 576--580.]] Google ScholarDigital Library
- Jacobs, B., Kiniry, J., and Warnier, M. 2003. Java program verification challenges. In Proceedings of the 1st International Symposium on Formal Methods for Components and Objects (FMCO 2002), Springer-Verlag, New York, 202--219.]]Google Scholar
- Meyer, B. 1992a. Applying “design by contract.” IEEE Computer 25, 10, 40--51.]] Google ScholarDigital Library
- Meyer, B. 1992b. Eiffel: The Language. Prentice Hall, Englewood Cliffs, N.J.]] Google ScholarDigital Library
Index Terms
- Constructing contracts: Making discrete mathematics relevant to beginning programmers
Recommendations
Studying program correctness by constructing contracts
Proceedings of the 8th annual conference on Innovation and technology in computer science educationBecause the concept of program correctness is generally taught as an activity independent of the programming process, most introductory computer science (CS) students perceive it as unnecessary and even irrelevant. The concept of contracts, on the other ...
Studying program correctness by constructing contracts
ITiCSE '03: Proceedings of the 8th annual conference on Innovation and technology in computer science educationBecause the concept of program correctness is generally taught as an activity independent of the programming process, most introductory computer science (CS) students perceive it as unnecessary and even irrelevant. The concept of contracts, on the other ...
A synthesizer of inductive assertions
Most current methods for mechanical program verification require a complete inductive assertion on each loop. As this is tedious and error prone, producing a program with complete, correct assertions is moderately difficult. This paper describes a ...
Comments