Nothing Special   »   [go: up one dir, main page]

skip to main content
10.5555/2486788.2486823acmconferencesArticle/Chapter ViewAbstractPublication PagesicseConference Proceedingsconference-collections
research-article

What good are strong specifications?

Published: 18 May 2013 Publication History

Abstract

Experience with lightweight formal methods suggests that programmers are willing to write specification if it brings tangible benefits to their usual development activities. This paper considers stronger specifications and studies whether they can be deployed as an incremental practice that brings additional benefits without being unacceptably expensive. We introduce a methodology that extends Design by Contract to write strong specifications of functional properties in the form of preconditions, postconditions, and invariants. The methodology aims at being palatable to developers who are not fluent in formal techniques but are comfortable with writing simple specifications. We evaluate the cost and the benefits of using strong specifications by applying the methodology to testing data structure implementations written in Eiffel and C#. In our extensive experiments, testing against strong specifications detects twice as many bugs as standard contracts, with a reasonable overhead in terms of annotation burden and run-time performance while testing. In the wide spectrum of formal techniques for software quality, testing against strong specifications lies in a "sweet spot" with a favorable benefit to effort ratio.

References

[1]
D. L. Parnas, “Precise documentation: The key to better software,” in The Future of Software Engineering. Springer, 2011, pp. 125–148.
[2]
B. Meyer, Object Oriented Software Construction. Prentice Hall, 1997.
[3]
P. Chalin, “Are practitioners writing contracts?” in The RODIN Book, ser. LNCS, vol. 4157, 2006, p. 100.
[4]
K. Beck, Test-Driven Development. Addison-Wesley, 2002.
[5]
N. Polikarpova, C. A. Furia, and B. Meyer, “Specifying reusable components,” in VSTTE, ser. LNCS, vol. 6217, 2010, pp. 127–141.
[6]
B. Meyer, A. Fiva, I. Ciupa, A. Leitner, Y. Wei, and E. Stapf, “Programs that test themselves,” IEEE Computer, vol. 42, no. 9, pp. 46–55, 2009.
[7]
http://dsa.codeplex.com/.
[8]
N. Tillmann and J. de Halleux, “Pex–white box test generation for .NET,” in TAP, 2008, pp. 134–153.
[9]
N. Polikarpova, I. Ciupa, and B. Meyer, “A comparative study of programmer-written and automatically inferred contracts,” in ISSTA, 2009, pp. 93–104.
[10]
M. Barnett, K. R. M. Leino, and W. Schulte, “The Spec# programming system: an overview,” in CASSIS. Berlin, Heidelberg: Springer-Verlag, 2005, pp. 49–69.
[11]
http://se.inf.ethz.ch/people/polikarpova/mbctesting.
[12]
A. Arcuri and L. Briand, “A practical guide for using statistical tests to assess randomized algorithms in software engineering,” in ICSE. ACM, 2011, pp. 1–10.
[13]
http://research.microsoft.com/en-us/projects/contracts/.
[14]
N. Polikarpova, C. A. Furia, Y. Wei, Y. Pei, and B. Meyer, “What good are strong specifications?” Extended version available at http://arxiv.org/abs/1208.3337.
[15]
N. Nagappan, E. M. Maximilien, T. Bhat, and L. Williams, “Realizing quality improvement through test driven development: results and experiences of four industrial teams,” ESE, vol. 13, pp. 289–302, 2008.
[16]
E. M. Maximilien and L. Williams, “Assessing test-driven development at IBM,” in ICSE, 2003, pp. 564–569.
[17]
V. Klebanov et al., “The 1st verified software competition,” in FM, ser. LNCS, vol. 6664, 2011, extended version at www.vscomp.org.
[18]
F. Dupressoir, A. D. Gordon, J. Jürjens, and D. A. Naumann, “Guiding a general-purpose C verifier to prove cryptographic protocols,” in IEEE Computer Security Foundations Symposium, 2011.
[19]
J.-C. Filliˆatre, “Verifying two lines of C with Why3: an exercise in program verification,” in VSTTE, ser. LNCS, 2012, pp. 83–97.
[20]
R. M. Hierons et al., “Using formal specifications to support testing,” ACM Comput. Surv., vol. 41, no. 2, 2009.
[21]
J. D. Gannon, P. R. McMullin, and R. G. Hamlet, “Data-abstraction implementation, specification, and testing,” ACM Trans. Program. Lang. Syst., vol. 3, no. 3, pp. 211–223, 1981.
[22]
J. Chang and D. J. Richardson, “Structural specification-based testing: Automated support and experimental evaluation,” in ESEC/FSE, 1999, pp. 285–302.
[23]
P. Stocks and D. A. Carrington, “Test templates: A specification-based testing framework,” in ICSE, 1993, pp. 405–414.
[24]
A. J. Offutt and A. Abdurazik, “Generating tests from UML specifications,” in UML, 1999, pp. 416–429.
[25]
D. Marinov and S. Khurshid, “TestEra: A novel framework for automated testing of Java programs,” in ASE, 2001, p. 22.
[26]
Y. Cheon and G. T. Leavens, “A simple and practical approach to unit testing: The JML and JUnit way,” in ECOOP, 2002, pp. 231–255.
[27]
C. Boyapati, S. Khurshid, and D. Marinov, “Korat: automated testing based on Java predicates,” in ISSTA, 2002, pp. 123–133.
[28]
M. Staats, M. W. Whalen, and M. P. E. Heimdahl, “Programs, tests, and oracles,” in ICSE, 2011, pp. 391–400.
[29]
M. M. Müller, R. Typke, and O. Hagner, “Two controlled experiments concerning the usefulness of assertions as a means for programming,” in ICSM, 2002, pp. 84–92.
[30]
L. du Bousquet, Y. Ledru, O. Maury, C. Oriat, and J.-L. Lanet, “Reusing a JML specification dedicated to verification for testing, and vice-versa: Case studies,” J. Autom. Reasoning, vol. 45, no. 4, pp. 415–435, 2010.
[31]
C. A. R. Hoare, “How did software get so reliable without proof?” in FME, 1996, pp. 1–17.
[32]
C. Pacheco and M. D. Ernst, “Eclat: Automatic generation and classification of test inputs,” in ECOOP, 2005, pp. 504–527.
[33]
T. Xie and D. Notkin, “Tool-assisted unit-test generation and selection based on operational abstractions,” Autom. Softw. Eng., vol. 13, no. 3, pp. 345–371, 2006.
[34]
A. Zeller, “Mining specifications: A roadmap,” in The Future of Software Engineering. Springer, 2010, pp. 173–182.
[35]
Y. Wei, H. Roth, C. A. Furia, Y. Pei, A. Horton, M. Steindorfer, M. Nordio, and B. Meyer, “Stateful testing: Finding more errors in code and contracts,” in ASE, 2011, pp. 440–443.
[36]
M. d’Amorim, C. Pacheco, T. Xie, D. Marinov, and M. D. Ernst, “An empirical comparison of automated generation and classification techniques for object-oriented unit testing,” in ASE, 2006, pp. 59–68.
[37]
Y. Wei, C. A. Furia, N. Kazmin, and B. Meyer, “Inferring better contracts,” in ICSE, 2011, pp. 191–200.
[38]
G. T. Leavens, Y. Cheon, C. Clifton, C. Ruby, and D. R. Cok, “How the design of JML accommodates both runtime assertion checking and formal verification,” Sci. Com. Prg., vol. 55, no. 1-3, pp. 185–208, 2005.

Cited By

View all
  • (2021)EvoSpexProceedings of the 43rd International Conference on Software Engineering10.1109/ICSE43902.2021.00112(1223-1235)Online publication date: 22-May-2021
  • (2021)Do this! Do that!, And nothing will happenProceedings of the 43rd International Conference on Software Engineering10.1109/ICSE43902.2021.00053(486-498)Online publication date: 22-May-2021
  • (2019)Learning stateful preconditions modulo a test generatorProceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3314221.3314641(775-787)Online publication date: 8-Jun-2019
  • Show More Cited By

Recommendations

Comments

Please enable JavaScript to view thecomments powered by Disqus.

Information & Contributors

Information

Published In

cover image ACM Conferences
ICSE '13: Proceedings of the 2013 International Conference on Software Engineering
May 2013
1561 pages
ISBN:9781467330763

Sponsors

Publisher

IEEE Press

Publication History

Published: 18 May 2013

Check for updates

Qualifiers

  • Research-article

Conference

ICSE '13
Sponsor:

Acceptance Rates

Overall Acceptance Rate 276 of 1,856 submissions, 15%

Upcoming Conference

ICSE 2025

Contributors

Other Metrics

Bibliometrics & Citations

Bibliometrics

Article Metrics

  • Downloads (Last 12 months)1
  • Downloads (Last 6 weeks)0
Reflects downloads up to 27 Nov 2024

Other Metrics

Citations

Cited By

View all
  • (2021)EvoSpexProceedings of the 43rd International Conference on Software Engineering10.1109/ICSE43902.2021.00112(1223-1235)Online publication date: 22-May-2021
  • (2021)Do this! Do that!, And nothing will happenProceedings of the 43rd International Conference on Software Engineering10.1109/ICSE43902.2021.00053(486-498)Online publication date: 22-May-2021
  • (2019)Learning stateful preconditions modulo a test generatorProceedings of the 40th ACM SIGPLAN Conference on Programming Language Design and Implementation10.1145/3314221.3314641(775-787)Online publication date: 8-Jun-2019
  • (2018)Automated workarounds from Java program specifications based on SAT solvingInternational Journal on Software Tools for Technology Transfer (STTT)10.5555/3288063.328808320:6(665-688)Online publication date: 1-Nov-2018
  • (2017)Nonconformance between programs and contractsProceedings of the Symposium on Applied Computing10.1145/3019612.3019779(1219-1224)Online publication date: 3-Apr-2017
  • (2015)Some usability hypotheses for verificationProceedings of the 6th Workshop on Evaluation and Usability of Programming Languages and Tools10.1145/2846680.2846691(57-60)Online publication date: 26-Oct-2015
  • (2015)Alias calculus, change calculus and frame inferenceScience of Computer Programming10.1016/j.scico.2013.11.00697:P1(163-172)Online publication date: 1-Jan-2015
  • (2014)Case studies and tools for contract specificationsProceedings of the 36th International Conference on Software Engineering10.1145/2568225.2568285(596-607)Online publication date: 31-May-2014
  • (2014)Contracts in PracticeProceedings of the 19th International Symposium on FM 2014: Formal Methods - Volume 844210.1007/978-3-319-06410-9_17(230-246)Online publication date: 12-May-2014
  • (2013)Program Checking with Less HassleRevised Selected Papers of the 5th International Conference on Verified Software: Theories, Tools, Experiments - Volume 816410.1007/978-3-642-54108-7_8(149-169)Online publication date: 17-May-2013

View Options

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