On the Automation of Dependency-Breaking Refactorings in Java

Syed Muhammad Ali Shah, Jens B. Dietrich, Catherine McCartin · 2013

The architecture and design of object-oriented systems is often described in terms of dependencies between program artefacts like classes, packages and libraries. In particular, there are many heuristics that mandate that certain dependencies should be avoided, and there are increasingly popular frameworks that focus on actively managed dependencies between artefacts, such as the Spring framework and the OSGi dynamic module system. However, empirical studies have shown that many real-world Java programs are riddled with dependency related problems. The question arises whether it is possible to automatically refurbish Java programs by removing unwanted dependencies without affecting the functionality of the program. We present an algorithm and a proof-of-concept implementation that does this. Our approach uses several refactorings: move class, type generalisation, service locator, and in lining and is validated on the Qualitas Corpus set of Java programs.

Read the paper · More papers on PaperTik