Constraint-Based Refactoring with Foresight

  • Friedrich Steimann
  • Jens von Pilgrim
Part of the Lecture Notes in Computer Science book series (LNCS, volume 7313)


Constraint-based refactoring tools as currently implemented generate their required constraint sets from the programs to be refactored, before any changes are performed. Constraint generation is thus unable to see — and regard — the changed structure of the refactored program, although this new structure may give rise to new constraints that need to be satisfied for the program to maintain its original behaviour. To address this problem, we present a framework allowing the constraint-generation process to foresee all changes a refactoring might perform, generating — at the outset of the refactoring — all constraints necessary to constrain these changes. As we are able to demonstrate, the computational overhead imposed by our framework, although threatening viability in theory, can be reduced to tractable sizes.


Constraint Generation Program Element Early Evaluation Disjunctive Normal Form Rule Application 
These keywords were added by machine and not by the authors. This process is experimental and the keywords may be updated as the learning algorithm improves.


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Balaban, I., Tip, F., Fuhrer, R.: Refactoring support for class library migration. In: Proc. of OOPSLA, pp. 265–279 (2005)Google Scholar
  2. 2.
    CHOCO Team choco: an Open Source Java Constraint Programming Library, Research Report 10-02-INFO, Ecole des Mines de Nantes (2010)Google Scholar
  3. 3.
    Donovan, A., Kiezun, A., Tschantz, M.S., Ernst, M.D.: Converting Java programs to use generic libraries. In: Proc. of OOPSLA, pp. 15–34 (2004)Google Scholar
  4. 4.
    Fowler, M.: Refactoring: Improving the Design of Existing Code. Addison-Wesley (1999)Google Scholar
  5. 5.
    Fuhrer, R., Tip, F., Kieżun, A., Dolby, J., Keller, M.: Efficiently Refactoring Java Applications to Use Generic Libraries. In: Gao, X.-X. (ed.) ECOOP 2005. LNCS, vol. 3586, pp. 71–96. Springer, Heidelberg (2005)CrossRefGoogle Scholar
  6. 6.
    Gosling, J., Joy, B., Steele, G., Bracha, G.: The Java Language Specification,
  7. 7.
    Gottlob, G., Greco, G., Mancini, T.: Conditional constraint satisfaction: logical foundations and complexity. In: Proc. of IJCAI, pp. 88–93 (2007)Google Scholar
  8. 8.
    Griswold, W.G.: Program Restructuring as an Aid to Software Maintenance. PhD Dissertation, University of Washington (1992)Google Scholar
  9. 9.
    Kegel, H., Steimann, F.: Systematically refactoring inheritance to delegation in Java. In: Proc. of ICSE, pp. 431–440 (2008)Google Scholar
  10. 10.
    Kiezun, A., Ernst, M.D., Tip, F., Fuhrer, R.M.: Refactoring for parameterizing Java classes. In: Proc. of ICSE, pp. 437–446 (2007)Google Scholar
  11. 11.
    Mittal, S., Falkenhainer, B.: Dynamic constraint satisfaction problems. In: Proc. of AAAI, pp. 25–32 (1990)Google Scholar
  12. 12.
    Palsberg, J., Schwartzbach, M.I.: Object-Oriented Type Systems. Wiley (1994)Google Scholar
  13. 13.
    Schäfer, M., Ekman, T., de Moor, O.: Sound and extensible renaming for Java. In: Proc. of OOPSLA, pp. 277–294 (2008)Google Scholar
  14. 14.
    Schäfer, M., Dolby, J., Sridharan, M., Torlak, E., Tip, F.: Correct Refactoring of Concurrent Java Code. In: D’Hondt, T. (ed.) ECOOP 2010. LNCS, vol. 6183, pp. 225–249. Springer, Heidelberg (2010)CrossRefGoogle Scholar
  15. 15.
    Schäfer, M., de Moor, O.: Specifying and implementing refactorings. In: Proc. of OOPSLA, pp. 286–301 (2010)Google Scholar
  16. 16.
    Schäfer, M., Thies, A., Steimann, F., Tip, F.: A comprehensive approach to naming and accessibility in refactoring Java programs. IEEE Trans. Soft. Eng. (2012)Google Scholar
  17. 17.
    Steimann, F., Thies, A.: From Public to Private to Absent: Refactoring Java Programs under Constrained Accessibility. In: Drossopoulou, S. (ed.) ECOOP 2009. LNCS, vol. 5653, pp. 419–443. Springer, Heidelberg (2009)CrossRefGoogle Scholar
  18. 18.
    Steimann, F., Kollee, C., von Pilgrim, J.: A Refactoring Constraint Language and Its Application to Eiffel. In: Mezini, M. (ed.) ECOOP 2011. LNCS, vol. 6813, pp. 255–280. Springer, Heidelberg (2011)CrossRefGoogle Scholar
  19. 19.
    Tip, F., Kiezun, A., Bäumer, D.: Refactoring for generalization using type constraints. In: Proc. of OOPSLA, pp. 13–26 (2003)Google Scholar
  20. 20.
    Tip, F., Fuhrer, R.M., Kiezun, A., Ernst, M.D., Balaban, I., De Sutter, B.: Refactoring using type constraints. ACM Trans. Program. Lang. Syst. 33(3), 9 (2011)CrossRefGoogle Scholar

Copyright information

© Springer-Verlag Berlin Heidelberg 2012

Authors and Affiliations

  • Friedrich Steimann
    • 1
  • Jens von Pilgrim
    • 1
  1. 1.Lehrgebiet ProgrammiersystemeFernuniversität in HagenHagenGermany

Personalised recommendations