Reducing the Class Coupling of Legacy Code by a Metrics-Based Relocation of Class Members
With the rapid growth of the complexity of software systems, the problem of integrating and maintaining legacy software is more relevant than ever. To overcome this problem, many methods for refactoring legacy code have already been proposed such as renaming classes or extracting interfaces. To perform a real modularization, methods have to be moved between classes. However, moving a single method is often not possible due to code dependencies.
In this article we present an approach to modularize legacy software by moving multiple related class members. It is shown how to identify groups of class members with similar concerns. We present two different code patterns that the related members and their dependent classes must match to allow a relocation of the related members. We also demonstrate how our pattern-based approach for automated modularization of legacy software can be applied to two open source projects.
Keywordslegacy software class decoupling pattern-based code refactoring code metrics
- 5.Seng, O., Stammel, J., Burkhart, D.: Search-Based Determination of Refactorings for Improving the Class Structure of Object-Oriented Systems. In: Proc. of the 8th Annual Conf. on Genetic and Evolutionary Computation (GECCO), pp. 1909–1916. ACM, New York (2006)Google Scholar
- 6.Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Addison-Wesley Professional, Massachusetts (1999)Google Scholar
- 7.Hunold, S., Korch, M., Krellner, B., Rauber, T., Reichel, T., Rünger, G.: Transformation of Legacy Software into Client/Server Applications through Pattern-Based Rearchitecturing. In: Proc. of the 32nd IEEE International Computer Software and Applications Conf (COMPSAC), pp. 303–310 (2008)Google Scholar
- 8.Hunold, S., Krellner, B., Rauber, T., Reichel, T., Rünger, G.: Pattern-based Refactoring of Legacy Software Systems. In: Proc. of the 11th International Conference on Enterprise Information Systems (ICEIS), pp. 78–89 (2009)Google Scholar
- 10.Brito e Abreu, F., Carapuça, R.: Object-Oriented Software Engineering: Measuring and Controlling the Development Process. In: Proc. of the 4th International Conference on Software Quality (ASQC), McLean, VA, USA (1994)Google Scholar
- 14.Brown, W.J., Malveau, R.C., McCormick III, H.W., Mowbray, T.J.: Anti-Patterns: Refactoring Software, Architectures, and Projects in Crisis, 1st edn. John Wiley & Sons, Inc. (1998)Google Scholar
- 15.Rayside, D.: Points-To Analysis. Technical report, MIT Computer Science and Artificial Intelligence Laboratory, Cambridge, MA, USA (2005)Google Scholar