Skip to main content

An Approach to Analyzing Execution Preservation in Java Program Refactoring

  • Conference paper
  • First Online:
  • 359 Accesses

Abstract

Code refactoring is a technique that improves the existing code in order to make software easier to understand and more extensible without changing the external behavior. Software design patterns, programming language independent reusable solutions to comment problems, are well-known in Java communities. On one hand, the refactoring using design patterns brings many benefits such as cost saving, flexibilities, and maintainability. On the other hand, it potentially causes bugs or changes execution behavior of Java programs. This paper proposes a new approach to checking behavior preservation properties of Java programs after applying design patterns. We present new definitions to compute pre/post conditions of program behavior. In the next step, the paper makes use of Java Modeling Language (JML) to represent and check if the refactored program neglects to preserve the external behavior. A motivating example of Adaptive Road Traffic Control (ARTC) is given to illustrate the approach in detail.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   39.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   54.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

Learn about institutional subscriptions

Notes

  1. 1.

    Due to space considerations, we do not display completed constraints here.

References

  1. Alexander, C., Ishikawa, S., Silverstein, M.: Pattern Languages. Center for Environmental Structure, vol. 2 (1977)

    Google Scholar 

  2. Bottoni, P., Parisi-Presicce, F., Taentzer, G.: Coordinated distributed diagram transformation for software evolution. Electron. Notes Theoret. Comput. Sci. 72(4), 59–70 (2003)

    Article  Google Scholar 

  3. Burdy, L., Cheon, Y., Cok, D.R., Ernst, M.D., Kiniry, J.R., Leavens, G.T., Rustan, K., Leino, M., Poll, E.: An overview of JML tools and applications. Int. J. Softw. Tools Technol. Transfer 7(3), 212–232 (2005)

    Article  Google Scholar 

  4. Cok, D.R.: OpenJML: software verification for Java 7 using JML, OpenJDK, and Eclipse. arXiv preprint arXiv:1404.6608 (2014)

  5. Dong, J., Sheng, Y., Zhang, K.: A model transformation approach for design pattern evolutions. In: 2006 13th Annual IEEE International Symposium and Workshop on Engineering of Computer Based Systems, ECBS 2006, pp. 10–92 (2006)

    Google Scholar 

  6. Gamma, E., Helm, R., Johnson, R., Vlissides, J.: Design Patterns: Elements of Reusable Object-Oriented Software. Addison-Wesley Longman Publishing Co., Inc., Boston (1995)

    MATH  Google Scholar 

  7. Leavens, G.T., Baker, A.L., Ruby, C.: Preliminary design of JML: a behavioral interface specification language for Java. ACM SIGSOFT Softw. Eng. Notes 31(3), 1–38 (2006)

    Article  Google Scholar 

  8. Leavens, G.T., Poll, E., Clifton, C., Cheon, Y., Ruby, C., Cok, D., Müller, P., Kiniry, J., Chalin, P., Zimmerman, D.M., et al.: JML reference manual (2008)

    Google Scholar 

  9. Mens, T., Tourwe, T.: A survey of software refactoring. IEEE Trans. Software Eng. 30(2), 126–139 (2004)

    Article  Google Scholar 

  10. Opdyke, W.F.: Refactoring: a program restructuring aid in designing object-oriented application frameworks. Ph.D. thesis, University of Illinois at Urbana-Champaign (1992)

    Google Scholar 

  11. Roberts, D.B., Johnson, R.: Practical analysis for refactoring. University of Illinois at Urbana-Champaign (1999)

    Google Scholar 

  12. Zhao, C., Kong, J., Zhang, K.: Design pattern evolution and verification using graph transformation. In: 2007 40th Annual Hawaii International Conference on System Sciences, HICSS 2007, p. 290a, January 2007

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Hong Anh Le .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2017 ICST Institute for Computer Sciences, Social Informatics and Telecommunications Engineering

About this paper

Cite this paper

Dao, TH., Le, H.A., Truong, N.T. (2017). An Approach to Analyzing Execution Preservation in Java Program Refactoring. In: Cong Vinh, P., Tuan Anh, L., Loan, N., Vongdoiwang Siricharoen, W. (eds) Context-Aware Systems and Applications. ICCASA 2016. Lecture Notes of the Institute for Computer Sciences, Social Informatics and Telecommunications Engineering, vol 193. Springer, Cham. https://doi.org/10.1007/978-3-319-56357-2_11

Download citation

  • DOI: https://doi.org/10.1007/978-3-319-56357-2_11

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-319-56356-5

  • Online ISBN: 978-3-319-56357-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics