skip to main content
10.1145/1774088.1774531acmconferencesArticle/Chapter ViewAbstractPublication PagessacConference Proceedingsconference-collections
research-article

Embedded contract languages

Published:22 March 2010Publication History

ABSTRACT

Specifying application interfaces (APIs) with information that goes beyond method argument and return types is a long-standing quest of programming language researchers and practitioners. The number of type system extensions or specification languages is a testament to that. Unfortunately, the number of such systems is also roughly equal to the number of tools that consume them. In other words, every tool comes with its own specification language.

In this paper we argue that for modern object-oriented languages, using an embedding of contracts as code is a better approach. We exemplify our embedding of Code Contracts on the Microsoft managed execution platform (.NET) using the C# programming language. The embedding works as well in Visual Basic. We discuss the numerous advantages of our approach and the technical challenges, as well as the status of tools that consume the embedded contracts.

References

  1. Thomas Ball, Byron Cook, Vladimir Levin, and Sriram K. Rajamani. SLAM and static driver verifier: Technology transfer of formal methods inside Microsoft. In Integrated Formal Methods, pages 1--20. Springer, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  2. Mike Barnett, K. Rustan M. Leino, and Wolfram Schulte. The Spec# programming system: An overview. In CASSIS, volume 3362 of LNCS. Springer, 2004. Google ScholarGoogle ScholarDigital LibraryDigital Library
  3. Bernard Carré and Jonathan Garnsworthy. SPARK---an annotated Ada subset for safety-critical programming. In TRI-Ada '90: Proceedings of the conference on TRI-ADA '90, pages 392--402. ACM, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  4. Markus Dahlweid, Michal Moskal, Thomas Santen, Stephan Tobies, and Wolfram Schulte. VCC: Contract-based modular verification of concurrent C. In 31st International Conference on Software Engineering, ICSE 2009, May 16--24, 2009, Vancouver, Canada, Companion Volume, pages 429--430. IEEE, 2009.Google ScholarGoogle ScholarCross RefCross Ref
  5. Manuvir Das. Formal specifications on industrial-strength code-from myth to reality. In Computer Aided Verification, 18th International Conference, CAV 2006, page 1, 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  6. Robert Deline and Manuel Fahndrich. Typestates for objects. In Proceedings of the 18th European Conference on Object-Oriented Programming, pages 465--490. Springer, 2004.Google ScholarGoogle ScholarCross RefCross Ref
  7. Manuel Fähndrich and K. Rustan M. Leino. Declaring and checking non-null types in an object-oriented language. In OOPSLA '03: Proceedings of the 18th annual ACM SIGPLAN conference on Object-oriented programing, systems, languages, and applications, pages 302--312. ACM, 2003. Google ScholarGoogle ScholarDigital LibraryDigital Library
  8. Patrice Godefroid. Compositional dynamic test generation. In Proceedings of the 34th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 47--54, 2007. Google ScholarGoogle ScholarDigital LibraryDigital Library
  9. Neelam Gupta, Aditya P. Mathur, and Mary Lou Soffa. Generating test data for branch coverage. In ASE: IEEE International Conference on Automated Software Engineering, pages 219--228, 2000. Google ScholarGoogle ScholarDigital LibraryDigital Library
  10. James C. King. Symbolic execution and program testing. Communications of the ACM, 19(7):385--394, 1976. Google ScholarGoogle ScholarDigital LibraryDigital Library
  11. Bogdan Korel. Automated software test data generation. IEEE Transactions on Software Engineering, 16(8):870--879, 1990. Google ScholarGoogle ScholarDigital LibraryDigital Library
  12. Gary T. Leavens, Albert L. Baker, and Clyde Ruby. Preliminary design of JML: A behavioral interface specification language for Java. SIGSOFT, 31(3):1--38, March 2006. Google ScholarGoogle ScholarDigital LibraryDigital Library
  13. K. Rustan M. Leino. Data groups: specifying the modification of extended state. In OOPSLA '98: Proceedings of the 13th ACM SIGPLAN conference on Object-oriented programming, systems, languages, and applications, pages 144--153, 1998. Google ScholarGoogle ScholarDigital LibraryDigital Library
  14. F. Logozzo and M. A. Fähndrich. On the relative completeness of bytecode analysis versus source code analysis. In CC'08, LNCS. Springer-Verlag, March 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  15. F. Logozzo and M. A. Fähndrich. Pentagons: A weakly relational abstract domain for the efficient validation of array accesses. In ACM SAC'08 - OOPS. ACM Press, March 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  16. B. Meyer. Eiffel: The Language. Prentice Hall, 1992. Google ScholarGoogle ScholarDigital LibraryDigital Library
  17. Matthew M. Papi, Mahmood Ali, Telmo Luis Correa, Jr., Jeff H. Perkins, and Michael D. Ernst. Practical pluggable types for Java. In ISSTA '08: Proceedings of the 2008 international symposium on Software testing and analysis, pages 201--212. ACM, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  18. Nikolai Tillmann and Jonathan de Halleux. Pex-white box test generation for .NET. In TAP: Tests and Proofs Second International Conference, pages 134--153, 2008. Google ScholarGoogle ScholarDigital LibraryDigital Library
  19. Hongwei Xi and Frank Pfenning. Dependent types in practical programming. In POPL '99: Proceedings of the 26th ACM SIGPLAN-SIGACT symposium on Principles of programming languages, pages 214--227. ACM, 1999. Google ScholarGoogle ScholarDigital LibraryDigital Library
  20. Dana N. Xu, Simon L. Peyton Jones, and Koen Claessen. Static contract checking for Haskell. In Proceedings of the 36th ACM SIGPLAN-SIGACT Symposium on Principles of Programming Languages, pages 41--52. ACM, 2009. Google ScholarGoogle ScholarDigital LibraryDigital Library

Index Terms

  1. Embedded contract languages

                    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
                    • Published in

                      cover image ACM Conferences
                      SAC '10: Proceedings of the 2010 ACM Symposium on Applied Computing
                      March 2010
                      2712 pages
                      ISBN:9781605586397
                      DOI:10.1145/1774088

                      Copyright © 2010 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: 22 March 2010

                      Permissions

                      Request permissions about this article.

                      Request Permissions

                      Check for updates

                      Qualifiers

                      • research-article

                      Acceptance Rates

                      SAC '10 Paper Acceptance Rate364of1,353submissions,27%Overall Acceptance Rate1,650of6,669submissions,25%

                    PDF Format

                    View or Download as a PDF file.

                    PDF

                    eReader

                    View online with eReader.

                    eReader