skip to main content
article

Constructing contracts: Making discrete mathematics relevant to beginning programmers

Published:01 June 2005Publication History
Skip Abstract Section

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.

References

  1. ACM JAVA Task Force. 2005. Java Task Force Report: First Public Draft. Internet. Feb.1, 2005: http://cs.stanford.edu/~eroberts//jtf/.]]Google ScholarGoogle Scholar
  2. ACM/IEEE Joint Task Force On Computing Curricula. 2001. Computing Curricula 2001: Computer Science. Internet. Dec. 15, 2001. http://www.sigcse.org/cc2001/.]]Google ScholarGoogle Scholar
  3. Backhouse, R.W. 1986. Program Construction and Verification. Prentice Hall, Englewood Cliffs, N.J.]] Google ScholarGoogle Scholar
  4. Backhouse, R.W 2003. Program Construction: Calculating Implementations from Specifications. John Wiley, New York.]] Google ScholarGoogle Scholar
  5. 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 ScholarGoogle ScholarCross RefCross Ref
  6. Beugnard, A., Jezequel, J.M., Plouzeau, N., and Watkins, D. 1999. Making components contract aware. IEEE Computer 32, 7, 38--45.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  7. Bruce, K.B., Drysdale, S.R.L, Keleman, C., and Tucker, A. 2003. Why math? Commun. ACM 49, 9, 40--44.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Devlin, K. 2003. Why universities require computer science students to take math. Commun. ACM 49,9, 37--39.]]Google ScholarGoogle Scholar
  9. Dijksktra, E.W. 1976. A Discipline of Programming. Prentice Hall, Upper Saddle River, N.J.]] Google ScholarGoogle Scholar
  10. 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 ScholarGoogle Scholar
  11. 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 ScholarGoogle Scholar
  12. 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 ScholarGoogle Scholar
  13. 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 ScholarGoogle ScholarCross RefCross Ref
  14. Gries, D. 1981. The Science of Programming. Springer-Verlag, New York.]] Google ScholarGoogle Scholar
  15. Henderson, P.B. 2003. Mathematical reasoning in software engineering education. Commun. ACM 49, 9, 45--50.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. Hoare, C.A.R. 1969. An axiomatic basis for computer programming. Commun. ACM 12, 10, 576--580.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. 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 ScholarGoogle Scholar
  18. Meyer, B. 1992a. Applying “design by contract.” IEEE Computer 25, 10, 40--51.]] Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Meyer, B. 1992b. Eiffel: The Language. Prentice Hall, Englewood Cliffs, N.J.]] Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Constructing contracts: Making discrete mathematics relevant to beginning programmers

                                Recommendations

                                Comments

                                Login options

                                Check if you have access through your login credentials or your institution to get full access on this article.

                                Sign in

                                Full Access

                                • Published in

                                  cover image Journal on Educational Resources in Computing
                                  Journal on Educational Resources in Computing  Volume 5, Issue 2
                                  June 2005
                                  84 pages
                                  ISSN:1531-4278
                                  EISSN:1531-4278
                                  DOI:10.1145/1141904
                                  Issue’s Table of Contents

                                  Copyright © 2005 ACM

                                  Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from [email protected]

                                  Publisher

                                  Association for Computing Machinery

                                  New York, NY, United States

                                  Publication History

                                  • Published: 1 June 2005
                                  Published in jeric Volume 5, Issue 2

                                  Permissions

                                  Request permissions about this article.

                                  Request Permissions

                                  Check for updates

                                  Qualifiers

                                  • article

                                PDF Format

                                View or Download as a PDF file.

                                PDF

                                eReader

                                View online with eReader.

                                eReader