Skip to main content
Log in

Pre-post notation is questionable in effectively specifying operations of object-oriented systems

  • Research Article
  • Published:
Frontiers of Computer Science in China Aims and scope Submit manuscript

Abstract

There is a growing tendency for people in the community of object-oriented methods to use pre- and post-conditions to write formal specifications for operations (methods) of classes. The motivation for trying to take advantage of well established formalism in precisely defining the functionality of operations is laudable, but unfortunately this exercise may be flawed because the use of pre- and post-conditions containing method calls (or similar) with side effects are likely to cause confusion in the interpretation of specifications. This paper analyzes, with comprehensible examples, why using pre-post notation is not effective to specify operations in objectoriented systems in general, discusses existing approaches to using pre-post notation for object-oriented systems, and offers some solutions to the problem.

This is a preview of subscription content, log in via an institution to check access.

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Similar content being viewed by others

References

  1. Jones C B. Systematic Software Development Using VDM. 2nd ed. Upper Saddle River: Prentice Hall, 1990

    MATH  Google Scholar 

  2. Woodcock J, Davies J. Using Z: Specification, Refinement, and Proof. Upper Saddle River: Prentice Hall, 1996

    MATH  Google Scholar 

  3. Abrial J R. The B-Book: Assigning Programs to Meanings. New York: Cambridge University Press, 1996

    Book  MATH  Google Scholar 

  4. Liu S. Formal Engineering for Industrial Software Development Using the SOFL Method. Heidelberg: Springer, 2004.

    MATH  Google Scholar 

  5. Liu S, Offutt A J, Ho-Stuart C, Sun Y, Ohba M. SOFL: a formal engineering methodology for industrial applications. IEEE Transactions on Software Engineering, 1998, 24(1): 24–45

    Article  Google Scholar 

  6. Hoare C A R, Wirth N. An axiomatic definition of the programming language PASCAL. Acta Informatica, 1973, 2(4): 335–355

    Article  Google Scholar 

  7. Smith G. The Object-Z Specification Language. Norwell: Kluwer Academic Publishers, 2000

    MATH  Google Scholar 

  8. Meyer B. Object-Oriented Software Construction. Upper Saddle River: Prentice Hall, 1997

    MATH  Google Scholar 

  9. Warmer J, Kleppe A. The Object Constraint Language: Getting Your Models Ready for MDA. Boston: Addison-Wesley, 2003

    Google Scholar 

  10. Filipe J K, Lau K K, Ornaghi M, Taguchi K, Yatsu H, Wills A. Formal specification of catalysis frameworks. In: Proceedings of 7th Asia-Pacific Software Engineering Conference. 2000, 180–187

  11. Fitzgerald J S, Larsen P G, Mukherjee P, Plat N, Verhoef M. Validated Designs for Object-oriented Systems. Santa Clara: Springer-Verlag, 2005

    MATH  Google Scholar 

  12. Bekbay S, Liu S. A study of Japanese software process practices and a potential for improvement using SOFL. In: Proceedings of 3rd International Conference on Quality Software. 2003, 100–1007

  13. Utting M. An object-oriented refinement calculus with modular reasoning. Dissertation for the Doctoral Degree. Sydney: University of New South Wales, 1992

    Google Scholar 

  14. Utting M, Robinson K. Modular reasoning in an object-oriented refinement calculus. In: Proceedings of 2nd International Conference on Mathematics of Program Construction. 1992, 344–367

  15. Back R J, Mikhajlova A, von Wright J. Class refinement as semantics of correct object substitutability. Journal of Formal Aspects of Computing, 2000, 12(1): 18–40

    Article  MATH  Google Scholar 

  16. Cavalcanti A, Naumann D A. Forward simulation for data refinement of classes. In: Proceedings of 2002 International Symposium of Formal Methods. 2002, 471–490

  17. Grithiths A. An extended semantic foundation for Object-Z. In: Proceedings of 3rd Asia-Pacific Software Engineering Conference. 1996, 194–207

  18. Morgan C. Programming From Specifications. Upper Saddle River: Prentice Hall, 1990

    MATH  Google Scholar 

  19. Cavalcanti A, Naumann D. A weakest precondition semantics for refinement of object-oriented programs. IEEE Transactions on Software Engineering, 2000, 26(8): 713–728

    Article  Google Scholar 

  20. Meyer B. Eiffel: The Language. Upper Saddle River: Prentice Hall, 1991

    Google Scholar 

  21. Barnett M, DeLine R, Fähndrich M, Leino K R M, Schulte W. Verification of object-oriented programs with invariants. Journal of Object Technology, 2004, 3(6): 27–56

    Article  Google Scholar 

  22. Leavens G T, Cheon Y. Design by contract with JML. ftp://ftp.cs.iastate.edu/pub/leavens/JML/jmldbc.pdf.

  23. Duan Z, Tian C. A unified model checking approach with projection temporal logic. In: Proceedings of 2008 International Conference on Formal Engineering Methods. 2008, 167–186

  24. Duan Z, Tian C, Zhang L. A decision procedure for propositional projection temporal logic with infinite models. Acta Informatica, 2008, 45(1): 43–78

    Article  MathSciNet  MATH  Google Scholar 

  25. Liu S, Nakajima S. A decompositional approach to automatic test case generation based on formal specifications. In: Proceedings of 4th IEEE International Conference on Secure Software Integration and Reliability Improvement. 2010, 147–155

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Shaoying Liu.

Additional information

Shaoying Liu is Professor of Software Engineering at Hosei University, Japan. He received his Ph.D. in Computer Science from the University of Manchester, U.K. in 1992. His research interests include Formal Engineering Methods for Software Development, Specification Verification and Validation, Specification-based Program Inspection, Specification-based Program Testing, and Intelligent Software Engineering Environments. He has published a book titled “Formal Engineering for Industrial Software Development Using the SOFL Method” with Springer-Verlag, four edited conference proceedings, and over 110 academic papers in refereed journals and international conferences. He proposed to use the terminology of “Formal Engineering Methods” in 1997, has established Formal Engineering Methods as a research area based on his extensive research on the SOFL (Structured Object-oriented Formal Language) method since 1989, and the development of ICFEM conference series since 1997. In recent years, he has served as Program Co-Chair of International Conference on Formal Engineering Methods (ICFEM 2008), the Chair of the Steering Committee for ICFEM 2010, and PC member for many international conferences. He is on the editorial board for the Journal of Software Testing, Verification and Reliability (STVR). He is a Fellow of British Computer Society, a Senior Member of IEEE Computer Society, and a member of Japan Society for Software Science and Technology.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Liu, S. Pre-post notation is questionable in effectively specifying operations of object-oriented systems. Front. Comput. Sci. China 5, 341–352 (2011). https://doi.org/10.1007/s11704-011-0130-y

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11704-011-0130-y

Keywords

Navigation