Skip to main content

Refactoring Using Type Constraints

  • Conference paper
Static Analysis (SAS 2007)

Part of the book series: Lecture Notes in Computer Science ((LNPSE,volume 4634))

Included in the following conference series:

Abstract

Type constraints express subtype-relationships between the types of program expressions that are required for type-correctness, and were originally proposed as a convenient framework for solving type checking and type inference problems. In this paper, we show how type constraints can be used as the basis for practical refactoring tools. In our approach, a set of type constraints is derived from a type-correct program P. The main insight behind our work is the fact that P constitutes just one solution to this constraint system, and that alternative solutions may exist that correspond to refactored versions of P. We show how a number of refactorings for manipulating types and class hierarchies can be expressed naturally using type constraints. Several refactorings in the standard distribution of Eclipse are based on our results.

This work has been supported in part by the Defense Advanced Research Projects Agency (DARPA) under contract No. NBCH30390004.

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 39.99
Price excludes VAT (USA)
  • Available as 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

Institutional subscriptions

Preview

Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.

References

  1. Balaban, I., Tip, F., Fuhrer, R.: Refactoring support for class library migration. In: Proc. OOPSLA, pp. 265–279 (2005)

    Google Scholar 

  2. Beck, K.: Extreme Programming Explained: Embrace Change. Addison-Wesley, London, UK (2000)

    Google Scholar 

  3. De Sutter, B., Tip, F., Dolby, J.: Customization of Java library classes using type constraints and profile information. In: Odersky, M. (ed.) ECOOP 2004. LNCS, vol. 3086, pp. 585–610. Springer, Heidelberg (2004)

    Google Scholar 

  4. Donovan, A., Ernst, M.: Inference of generic types in Java. Tech. Rep. MIT/LCS/TR-889, MIT (March 2003)

    Google Scholar 

  5. Donovan, A., Kieżun, A., Tschantz, M., Ernst, M.: Converting Java programs to use generic libraries. In: Proc. OOPSLA, pp. 15–34 (2004)

    Google Scholar 

  6. Duggan, D.: Modular type-based reverse engineering of parameterized types in Java code. In: Proc. OOPSLA, pp. 97–113 (1999)

    Google Scholar 

  7. Fowler, M.: Refactoring. In: Improving the Design of Existing Code, Addison-Wesley, London, UK (1999)

    Google Scholar 

  8. Fuhrer, R., Tip, F., Kieżun, A., Dolby, J., Keller, M.: Efficiently refactoring Java applications to use generic libraries. In: Black, A.P. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 71–96. Springer, Heidelberg (2005)

    Google Scholar 

  9. Griswold, W.G.: Program Restructuring as an Aid to Software Maintenance. PhD thesis, University of Washington, Technical Report 91-08-04 (1991)

    Google Scholar 

  10. Griswold, W.G., Notkin, D.: Automated assistance for program restructuring. ACM Trans. Softw. Eng. Methodol. 2(3), 228–269 (1993)

    Article  Google Scholar 

  11. Halloran, T.J., Scherlis, W.L.: Models of Thumb: Assuring best practice source code in large Java software systems. Tech. Rep. Fluid Project, School of Computer Science/ISRI, Carnegie Mellon University (September 2002)

    Google Scholar 

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

    Google Scholar 

  13. Kieżun, A., Ernst, M., Tip, F., Fuhrer, R.: Refactoring for parameterizing Java classes. In: Proc. ICSE, pp. 437–446 (2007)

    Google Scholar 

  14. Mens, T., Tourwé, T.: A survey of software refactoring. IEEE Trans. on Softw. Eng. 30(2), 126–139 (2004)

    Article  Google Scholar 

  15. Opdyke, W.F.: Refactoring Object-Oriented Frameworks. PhD thesis, University Of Illinois at Urbana-Champaign (1992)

    Google Scholar 

  16. Opdyke, W.F., Johnson, R.E.: Creating abstract superclasses by refactoring. In: CSC 1993. The ACM 1993 Computer Science Conf., February 1993, pp. 66–73 (1993)

    Google Scholar 

  17. Palsberg, J., Schwartzbach, M.: Object-Oriented Type Systems. John Wiley & Sons, West Sussex, England (1993)

    Google Scholar 

  18. Snelting, G., Tip, F.: Understanding class hierarchies using concept analysis. In: ACM Trans. on Programming Languages and Systems, May 2000, pp. 540–582 (2000)

    Google Scholar 

  19. Steimann, F., Mayer, P.: Type access analysis: Towards informed interface design. In: Proc. TOOLS Europe (to appear, 2007)

    Google Scholar 

  20. Steimann, F., Mayer, P., Meißner, A.: Decoupling classes with inferred interfaces. In: Preneel, B., Tavares, S. (eds.) SAC 2005. LNCS, vol. 3897, pp. 1404–1408. Springer, Heidelberg (2006)

    Google Scholar 

  21. Streckenbach, M., Snelting, G.: Refactoring class hierarchies with KABA. In: Proc. OOPSLA, pp. 315–330 (2004)

    Google Scholar 

  22. Tip, F., Kieżun, A., Bäumer, D.: Refactoring for generalization using type constraints. In: Proc. OOPSLA, pp. 13–26 (2003)

    Google Scholar 

  23. Tokuda, L., Batory, D.: Evolving object-oriented designs with refactorings. Kluwer Journal of Automated Software Engineering, 89–120 (August 2001)

    Google Scholar 

  24. Torgersen, M., Plesner Hansen, C., Ernst, E., von der Ahé, P., Bracha, G., Gafter, N.: Adding wildcards to the Java programming language. In: Proc. of the 2004 ACM symposium on Applied computing, pp. 1289–1296 (2004)

    Google Scholar 

  25. von Dincklage, D., Diwan, A.: Converting Java classes to use generics. In: Proc. OOPSLA, pp. 1–14 (2004)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Editor information

Hanne Riis Nielson Gilberto Filé

Rights and permissions

Reprints and permissions

Copyright information

© 2007 Springer-Verlag Berlin Heidelberg

About this paper

Cite this paper

Tip, F. (2007). Refactoring Using Type Constraints. In: Nielson, H.R., Filé, G. (eds) Static Analysis. SAS 2007. Lecture Notes in Computer Science, vol 4634. Springer, Berlin, Heidelberg. https://doi.org/10.1007/978-3-540-74061-2_1

Download citation

  • DOI: https://doi.org/10.1007/978-3-540-74061-2_1

  • Publisher Name: Springer, Berlin, Heidelberg

  • Print ISBN: 978-3-540-74060-5

  • Online ISBN: 978-3-540-74061-2

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics