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

Embedded contract languages

Published: 22 March 2010 Publication 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.
[2]
Mike Barnett, K. Rustan M. Leino, and Wolfram Schulte. The Spec# programming system: An overview. In CASSIS, volume 3362 of LNCS. Springer, 2004.
[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.
[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.
[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.
[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.
[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.
[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.
[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.
[10]
James C. King. Symbolic execution and program testing. Communications of the ACM, 19(7):385--394, 1976.
[11]
Bogdan Korel. Automated software test data generation. IEEE Transactions on Software Engineering, 16(8):870--879, 1990.
[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.
[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.
[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.
[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.
[16]
B. Meyer. Eiffel: The Language. Prentice Hall, 1992.
[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.
[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.
[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.
[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.

Cited By

View all
  • (2024)Formal Runtime Error Detection During Development in the Automotive IndustryVerification, Model Checking, and Abstract Interpretation10.1007/978-3-031-50524-9_1(3-26)Online publication date: 15-Jan-2024
  • (2023)Improving the Accuracy of Library Function Modeling in the Static Analyzer2023 Ivannikov Ispras Open Conference (ISPRAS)10.1109/ISPRAS60948.2023.10508178(26-32)Online publication date: 4-Dec-2023
  • (2023)Create and Develop a Management System for Cardiovascular ClinicsProceedings of Data Analytics and Management10.1007/978-981-19-7615-5_17(183-195)Online publication date: 25-Mar-2023
  • Show More Cited By

Recommendations

Comments

Information & Contributors

Information

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
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]

Sponsors

Publisher

Association for Computing Machinery

New York, NY, United States

Publication History

Published: 22 March 2010

Permissions

Request permissions for this article.

Check for updates

Author Tags

  1. .NET
  2. C#
  3. CodeContracts

Qualifiers

  • Research-article

Conference

SAC'10
Sponsor:
SAC'10: The 2010 ACM Symposium on Applied Computing
March 22 - 26, 2010
Sierre, Switzerland

Acceptance Rates

SAC '10 Paper Acceptance Rate 364 of 1,353 submissions, 27%;
Overall Acceptance Rate 1,650 of 6,669 submissions, 25%

Upcoming Conference

SAC '25
The 40th ACM/SIGAPP Symposium on Applied Computing
March 31 - April 4, 2025
Catania , Italy

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)9
  • Downloads (Last 6 weeks)2
Reflects downloads up to 10 Feb 2025

Other Metrics

Citations

Cited By

View all
  • (2024)Formal Runtime Error Detection During Development in the Automotive IndustryVerification, Model Checking, and Abstract Interpretation10.1007/978-3-031-50524-9_1(3-26)Online publication date: 15-Jan-2024
  • (2023)Improving the Accuracy of Library Function Modeling in the Static Analyzer2023 Ivannikov Ispras Open Conference (ISPRAS)10.1109/ISPRAS60948.2023.10508178(26-32)Online publication date: 4-Dec-2023
  • (2023)Create and Develop a Management System for Cardiovascular ClinicsProceedings of Data Analytics and Management10.1007/978-981-19-7615-5_17(183-195)Online publication date: 25-Mar-2023
  • (2022)Python-by-contract datasetProceedings of the 30th ACM Joint European Software Engineering Conference and Symposium on the Foundations of Software Engineering10.1145/3540250.3558917(1652-1656)Online publication date: 7-Nov-2022
  • (2022)Verifying verified codeInnovations in Systems and Software Engineering10.1007/s11334-022-00443-918:3(335-346)Online publication date: 30-Mar-2022
  • (2021)The e-ACSL perspective on runtime assertion checkingProceedings of the 5th ACM International Workshop on Verification and mOnitoring at Runtime EXecution10.1145/3464974.3468451(8-12)Online publication date: 12-Jul-2021
  • (2021)Demystifying the Challenges of Formally Specifying API Properties for Runtime Verification2021 14th IEEE Conference on Software Testing, Verification and Validation (ICST)10.1109/ICST49551.2021.00020(82-93)Online publication date: Apr-2021
  • (2020)Proposal of an Approach to Generate VDM++ Specifications from Natural Language Specification by Machine Learning2020 IEEE 9th Global Conference on Consumer Electronics (GCCE)10.1109/GCCE50665.2020.9292047(292-296)Online publication date: 13-Oct-2020
  • (2019)RESTlerProceedings of the 41st International Conference on Software Engineering10.1109/ICSE.2019.00083(748-758)Online publication date: 25-May-2019
  • (2019)Inference of properties from requirements and automation of their formal verificationProceedings of the 34th IEEE/ACM International Conference on Automated Software Engineering10.1109/ASE.2019.00145(1222-1225)Online publication date: 10-Nov-2019
  • Show More Cited By

View Options

Login options

View options

PDF

View or Download as a PDF file.

PDF

eReader

View online with eReader.

eReader

Figures

Tables

Media

Share

Share

Share this Publication link

Share on social media