Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
skip to main content
article

Studying program correctness by constructing contracts

Published: 30 June 2003 Publication History

Abstract

Because 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 hand, is generally taught as an integral part of the programming process. As such, most introductory 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) for Java [7]. Pro VIDE supports a modified version of the "design by contract" methodology [13] that assists its student programmers in contract construction. Rather than asking for both a precondition and postcondition for each of his/her methods, ProVIDE asks the student to simply supply a postcondition. ProVIDE then helps the student construct the appropriate precondition by leading him/her through an axiomatic proof of the correctness of the method. Thus, the proof of correctness of the method is a side-effect of the student's need to construct an appropriate precondition.

References

[1]
Brown, J.S., Collins, A., and Duguid, P. Situated Cognition and the Culture of Learning. Educational Researcher, 18(1): 32-42, 1989.
[2]
Cognition and Technology Group at Vanderbilt. Anchored Instruction and its Relationship to Situated Cognition. Educational Researcher, 19(6): 2-10, 1990.
[3]
Collins, A., Brown, J.S., and Newman, S.E. Cognitive Apprenticeship: Teaching the Craft of Reading, Writing, and Mathematics. In L.B. Resnick, editor, Knowing, Learning, and Instruction: Essays in Honor of Robert Glaser, pages 453-494, Hillsdale, NJ: Lawrence Erlbaum, 1989.
[4]
Dijkstra, E.W. A Discipline of Programming. Upper Saddle River, NJ: Prentice Hall, 1976.
[5]
Floyd, R.W. Assigning Meaning to Programs. In J.T. Schwartz, editor, Proceedings of the Symposium on Applied Mathematics (Mathematical Aspects of Computer Science), American Mathematical Society, Providence, Rhode Island, 1967.
[6]
Gegg-Harrison, T.S. Ancient Egyptian Numbers: A CS-Complete Example. In J. Gersting and R. McCauley, editors, Proceedings of the 32nd Technical Symposium on Computer Science Education, pages 268-272, Charlotte, North Carolina, February 2001 (ACM SIGCSE Bulletin, 33(1): 268-272, 2001).
[7]
Gegg-Harrison, T.S., Bunce, G.R., Ganetzky, R.D., Olson, CM., and Wilson, J.D. Studying Program Correctness in ProVIDE. Software demonstration at the 8th Annual Conference on Innovation and Technology in Computer Science Education, Thessaloniki, Greece, June-July 2003.
[8]
Gries, D. The Science of Programming. New York, NY: Springer-Verlag, 1981.
[9]
Hoare, C.A.R. An Axiomatic Basis for Computer Programming. Communications of the ACM, 12(10): 576-580, 1969.
[10]
Joint Task Force on Computing Curricula. Computing Curricula 2001: Computer Science, Final Report, December 2001.
[11]
Kramer, R. iContract - The Java Design by Contract Tool. In M. Singh, B. Meyer, J. Gil, and R. Mitchell, editors, Proceedings of the 26th Conference on Technology of Object-Oriented Languages and Systems, pages 295-307, Santa Barbara, California, August 1998.
[12]
Meyer, B. Eiffel: The Language. Englewood Cliffs, NJ: Prentice Hall, 1992.
[13]
Meyer, B. Applying "Design by Contract". Computer, 25(10): 40-51,1992. IEEE Computer, 25(10): 40-51,1992.

Cited By

View all
  • (2019)Theoretical and Practical Approaches for Teaching Parallel Code Correctness2019 26th International Conference on High Performance Computing, Data and Analytics Workshop (HiPCW)10.1109/HiPCW.2019.00021(48-55)Online publication date: Dec-2019
  • (2019)Theoretical and Practical Approaches for Teaching Parallel Code Correctness2019 26th International Conference on High Performance Computing, Data and Analytics Workshop (HiPCW)10.1109/HiPCW.2019.00021(48-55)Online publication date: Dec-2019
  • (2018)An Activity-Based Undergraduate Software Engineering Course to Engage Students and Encourage LearningProceedings of the 3rd European Conference of Software Engineering Education10.1145/3209087.3209100(18-25)Online publication date: 14-Jun-2018
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

Published In

cover image ACM SIGCSE Bulletin
ACM SIGCSE Bulletin  Volume 35, Issue 3
Proceedings of the 8th annual conference on Innovation and technology in computer science education
September 2003
277 pages
ISSN:0097-8418
DOI:10.1145/961290
Issue’s Table of Contents
  • cover image ACM Conferences
    ITiCSE '03: Proceedings of the 8th annual conference on Innovation and technology in computer science education
    June 2003
    291 pages
    ISBN:1581136722
    DOI:10.1145/961511
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: 30 June 2003
Published in SIGCSE Volume 35, Issue 3

Check for updates

Author Tags

  1. Java
  2. axiomatic semantics
  3. design by contract

Qualifiers

  • Article

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)4
  • Downloads (Last 6 weeks)1
Reflects downloads up to 15 Oct 2024

Other Metrics

Citations

Cited By

View all
  • (2019)Theoretical and Practical Approaches for Teaching Parallel Code Correctness2019 26th International Conference on High Performance Computing, Data and Analytics Workshop (HiPCW)10.1109/HiPCW.2019.00021(48-55)Online publication date: Dec-2019
  • (2019)Theoretical and Practical Approaches for Teaching Parallel Code Correctness2019 26th International Conference on High Performance Computing, Data and Analytics Workshop (HiPCW)10.1109/HiPCW.2019.00021(48-55)Online publication date: Dec-2019
  • (2018)An Activity-Based Undergraduate Software Engineering Course to Engage Students and Encourage LearningProceedings of the 3rd European Conference of Software Engineering Education10.1145/3209087.3209100(18-25)Online publication date: 14-Jun-2018
  • (2017)Revisiting Assert Use in GitHub ProjectsProceedings of the 21st International Conference on Evaluation and Assessment in Software Engineering10.1145/3084226.3084259(298-307)Online publication date: 15-Jun-2017
  • (2017)Integrating Components, Contracts, and Reasoning in CS Curricula with RESOLVE: Experiences at Multiple Institutions2017 IEEE 30th Conference on Software Engineering Education and Training (CSEE&T)10.1109/CSEET.2017.40(202-211)Online publication date: Nov-2017
  • (2006)Introducing Proofs of a Program's Termination in an Undergraduate Software Engineering Course2006 IEEE International Conference on Systems, Man and Cybernetics10.1109/ICSMC.2006.384745(3927-3931)Online publication date: Oct-2006
  • (2003)Studying program correctness in ProVIDEProceedings of the 8th annual conference on Innovation and technology in computer science education10.1145/961511.961624(262-262)Online publication date: 30-Jun-2003
  • (2003)Studying program correctness in ProVIDEACM SIGCSE Bulletin10.1145/961290.96162435:3(262-262)Online publication date: 30-Jun-2003

View Options

Get Access

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Media

Figures

Other

Tables

Share

Share

Share this Publication link

Share on social media