Abstract
Type constraints express subtype relationships between the types of program expressions, for example, those relationships that are required for type correctness. Type constraints were originally proposed as a convenient framework for solving type checking and type inference problems. This paper shows 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 work.
- Balaban, I., Tip, F., and Fuhrer, R. 2005. Refactoring support for class library migration. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Application (OOPSLA). 265--279. Google Scholar
Digital Library
- Beck, K. 2000. Extreme Programming Explained: Embrace Change. Addison-Wesley. Google Scholar
Digital Library
- Bracha, G., Cohen, N., Kemper, C., Odersky, M., Stoutamire, D., Thorup, K., and Wadler, P. 2004. Adding generics to the Java programming language, final release. Tech. rep., Java Community Process JSR-000014.Google Scholar
- Choi, J.-D., Gupta, M., Serrano, M., Sreedhar, V. C., and Midkiff, S. 1999. Escape analysis for Java. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Application (OOPSLA). ACM Press, 1--19. Google Scholar
Digital Library
- De Sutter, B., Tip, F., and Dolby, J. 2004. Customization of Java library classes using type constraints and profile information. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP). 585--610.Google Scholar
- Donovan, A. and Ernst, M. 2003. Inference of generic types in Java. Tech. rep. MIT/LCS/TR-889, MIT.Google Scholar
- Donovan, A., Kieżun, A., Tschantz, M., and Ernst, M. 2004. Converting Java programs to use generic libraries. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Application (OOPSLA). 15--34. Google Scholar
Digital Library
- Duggan, D. 1999. Modular type-based reverse engineering of parameterized types in Java code. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Application (OOPSLA). 97--113. Google Scholar
Digital Library
- Fowler, M. 1999. Refactoring. Improving the Design of Existing Code. Addison-Wesley. Google Scholar
Digital Library
- Fuhrer, R., Tip, F., Kieżun, A., Dolby, J., and Keller, M. 2005. Efficiently refactoring Java applications to use generic libraries. In Proceedings of the European Conference on Object-Oriented Programming (ECOOP). 71--96. Google Scholar
Digital Library
- Gosling, J., Joy, B., Steele, G., and Bracha, G. 2005. The Java Language Specification 3rd Ed. Addison Wesley, Boston, MA. Google Scholar
Digital Library
- Griswold, W. G. 1991. Program restructuring as an aid to software maintenance. Ph.D. thesis, University of Washington. Tech. rep. 91-08-04. Google Scholar
Digital Library
- Griswold, W. G. and Notkin, D. 1993. Automated assistance for program restructuring. ACM Trans. Softw. Engin. Methodol. 2, 3, 228--269. Google Scholar
Digital Library
- Halloran, T. J. and Scherlis, W. L. 2002. 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.Google Scholar
- Hind, M. and Pioli, A. 2001. Evaluating the effectiveness of pointer alias analyses. Sci. of Comput. Program. 39, 1, 31--55. Google Scholar
Digital Library
- Kerievsky, J. 2004. Refactoring to Patterns. Addison-Wesley. Google Scholar
Digital Library
- Kieżun, A., Ernst, M., Tip, F., and Fuhrer, R. 2007. Refactoring for parameterizing Java classes. In Proceedings of the International Conference on Software Engineering (ICSE). 437--446. Google Scholar
Digital Library
- Kieżun, A., Ernst, M. D., Tip, F., and Fuhrer, R. M. 2006. Refactoring for parameterizing Java classes. Tech. rep., MIT.Google Scholar
- Mens, T. and Tourwé, T. 2004. A survey of software refactoring. IEEE Trans. Softw. 30, 2, 126--139. Google Scholar
Digital Library
- Opdyke, W. F. 1992. Refactoring object-oriented frameworks. Ph.D. thesis, University Of Illinois at Urbana-Champaign. Google Scholar
Digital Library
- Opdyke, W. F. and Johnson, R. E. 1993. Creating abstract superclasses by refactoring. In Proceedings of the ACM Computer Science Conference (CSC'93). 66--73. Google Scholar
Digital Library
- Palsberg, J. and Schwartzbach, M. 1993. Object-Oriented Type Systems. John Wiley & Sons. Google Scholar
Digital Library
- Ryder, B. G. 2003. Dimensions of precision in reference analysis of object-oriented programming languages. In Proceedings of the International Conference on Compiler Construction (CC). 126--137. Google Scholar
Digital Library
- Snelting, G. and Tip, F. 2000. Understanding class hierarchies using concept analysis. ACM Trans. Program. Lang. Syst. 22, 3, 540--582. Google Scholar
Digital Library
- Steimann, F. and Mayer, P. 2007. Type access analysis: Towards informed interface design. In Proceedings of the TOOLS Europe.Google Scholar
- Steimann, F., Mayer, P., and Meissner, A. 2006. Decoupling classes with inferred interfaces. In Proceedings of the ACM Symposium on Applied Computing (SAC). 1404--1408. Google Scholar
Digital Library
- Steimann, F. and Thies, A. 2009. From public to private to absent: Refactoring Java programs under constrained accessibility. In Proceedings of the 23rd European Conference on Object-Oriented Programming (ECOOP). 419--443. Google Scholar
Digital Library
- Streckenbach, M. and Snelting, G. 2004. Refactoring class hierarchies with KABA. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Application (OOPSLA). 315--330. Google Scholar
Digital Library
- Tip, F. 2007. Refactoring using type constraints. In Proceedings of the 14th International Static Analysis Symposium (SAS). 1--17. Google Scholar
Digital Library
- Tip, F., Kieżun, A., and Bäumer, D. 2003. Refactoring for generalization using type constraints. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Application (OOPSLA). 13--26. Google Scholar
Digital Library
- Tokuda, L. and Batory, D. 2001. Evolving object-oriented designs with refactorings. Kluwer J. Automat. Softw. Eng. 8, 1, 89--120. Google Scholar
Digital Library
- Torgersen, M., Plesner Hansen, C., Ernst, E., von der Ahé, P., Bracha, G., and Gafter, N. 2004. Adding wildcards to the Java programming language. In Proceedings of the ACM Symposium on Applied Computing. 1289--1296. Google Scholar
Digital Library
- von Dincklage, D. and Diwan, A. 2004. Converting Java classes to use generics. In Proceedings of the Conference on Object-Oriented Programming Systems, Languages, and Application (OOPSLA). 1--14. Google Scholar
Digital Library
Index Terms
Refactoring using type constraints
Recommendations
Refactoring for generalization using type constraints
Special Issue: Proceedings of the OOPSLA '03 conferenceRefactoring is the process of applying behavior-preserving transformations (called "refactorings") in order to improve a program's design. Associated with a refactoring is a set of preconditions that must be satisfied to guarantee that program behavior ...
System F with coercion constraints
CSL-LICS '14: Proceedings of the Joint Meeting of the Twenty-Third EACSL Annual Conference on Computer Science Logic (CSL) and the Twenty-Ninth Annual ACM/IEEE Symposium on Logic in Computer Science (LICS)We present a second-order λ-calculus with coercion constraints that generalizes a previous extension of System F with parametric coercion abstractions by allowing multiple but simultaneous type and coercion abstractions, as well as recursive coercions ...
MLF for everyone (users, implementers, and designers)
ML '07: Proceedings of the 2007 workshop on Workshop on MLMLF is an alternative to ML that permits second-order polymorphism as in System F but retains (partial) type inference a la ML. Type annotations are requested only on parameters of functions that are used polymorphically. Type abstractions and type ...






Comments