Skip to main content

Abstract

Design patterns has been used very effectively in object-oriented design for a long time. Refactoring is also widely used for producing better maintainable and reusable designs and programs. In this paper, we investigate how design patterns and refactoring rules are used in a formal method by formulating and showing them as refinement laws in the calculus of refinement of component and object-oriented systems, known as rCOS. We also combine refactoring and design patterns to provide some big-step rules of pattern-directed refactoring.

Supported by NNSF of China (No. 60718002), and Projects on HighQSofD and HTTS funded by Macao S&T Fund.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 129.00
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 169.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Refactoringtools, http://www.refactoring.com/tools.html

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

    Article  Google Scholar 

  3. Chen, Z., He, J., Liu, Z., Zhan, N.: A model of component-based programming. In: Arbab, F., Sirjani, M. (eds.) FSEN 2007. LNCS, vol. 4767, pp. 191–206. Springer, Heidelberg (2007)

    Chapter  Google Scholar 

  4. Chen, Z., Liu, Z., Stolz, V.: The rCOS tool. In: Cuellar, J., Maibaum, T.S.E. (eds.) FM 2008. LNCS, vol. 5014. Springer, Heidelberg (2008)

    Google Scholar 

  5. Chen, Z., Liu, Z., Ravn, A.P., Stolz, V., Zhan, N.: Refinement and verification in component-based model driven design. Technical Report 388, UNU/IIST, Macao SAR, China, Science of Computer Programming (submitted, 2008)

    Google Scholar 

  6. Cornélio, M.L., Cavalcanti, A.L.C., Sampaio, A.C.A.: Refactoring by Transformation. In: Pro. of REFINE 2002. ENTCS, vol. 70. Elsevier, Amsterdam (2002) (invited Paper)

    Google Scholar 

  7. Favre, L., Pereira, C.: Formalizing mda-based refactorings. In: 19th Australian Software Engineering Conference, pp. 377–386. IEEE, Los Alamitos (2008)

    Google Scholar 

  8. Fowler, M.: Refectoring, Improving the Design of Existing Code. Addison-Wesley, Reading (2000)

    Google Scholar 

  9. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns, Elements of Reusable Object-Oriented Software. Addison Wesley, Reading (1994)

    MATH  Google Scholar 

  10. He, J., Liu, Z., Li, X., Qin, S.: A relational model for object-oriented designs. In: Chin, W.-N. (ed.) APLAS 2004. LNCS, vol. 3302, pp. 415–436. Springer, Heidelberg (2004)

    Chapter  Google Scholar 

  11. Hoare, C.A.R., He, J.: Unifying Theories of Programming. Prentice-Hall, Englewood Cliffs (1998)

    MATH  Google Scholar 

  12. Jifeng, H., Li, X., Liu, Z.: rCOS: A refinement calculus for object systems. Theoretical Computer Science 365, 109–142 (2006)

    Article  MathSciNet  MATH  Google Scholar 

  13. Kerievsky, J.: Refactoring to Patterns. Addison-Wesley, Reading (2004)

    Book  Google Scholar 

  14. Larman, C.: Applying UML and Patterns. Prentice-Hall International, Englewood Cliffs (2001)

    Google Scholar 

  15. Long, Q., He, J., Liu, Z.: Refactoring and pattern-directed refactoring: A formal perspective. Technical Report 318, UNU/IIST, Macao SAR, China (2005)

    Google Scholar 

  16. Long, Q., Qiu, Z., Liu, Z., Shao, L., He, J.: POST: A case study for an incremental development in rCOS. In: Van Hung, D., Wirsing, M. (eds.) ICTAC 2005. LNCS, vol. 3722, pp. 498–513. Springer, Heidelberg (2005)

    Google Scholar 

  17. Markovic, S., Baar, T.: Refactoring OCL annotated UML class diagrams. Journal Software and Systems Modeling 7, 25–47 (2008)

    Article  Google Scholar 

  18. Roberts, D.B.: Practical Analysis for Refactoring. PhD thesis, University of Illinois at Urbana Champain (1999)

    Google Scholar 

  19. Silva, L., Sampaio, A., Liu, Z.: Laws of object-orientation with reference semantics (submitted for publication)

    Google Scholar 

  20. Tokuda, L.A.: Evolving Object-Oriented Designs with Refactoring. PhD thesis, University of Texas at Austin (1999)

    Google Scholar 

  21. Wake, W.C.: Refactoring Workbook. Pearson Education, London (2004)

    Google Scholar 

  22. Zhao, L., Liu, X., Liu, Z., Qiu, Z.: Graph transformations for object-oriented refinement. Formal Aspects of Computing (2008) doi:10.1007/s00165-007-0067-y

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2008 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Quan, L., Zongyan, Q., Liu, Z. (2008). Formal Use of Design Patterns and Refactoring. In: Margaria, T., Steffen, B. (eds) Leveraging Applications of Formal Methods, Verification and Validation. ISoLA 2008. Communications in Computer and Information Science, vol 17. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-88479-8_23

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-88479-8_23

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-88478-1

  • Online ISBN: 978-3-540-88479-8

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics