Improving software modularization via automated analysis of latent topics and dependencies

Gabriele Bavota, Malcom Gethers, Rocco Oliveto, Denys Poshyvanyk, Andrea De Lucia

ACM Transactions on Software Engineering and Methodology · 2014 · 118 citations · 64 references

Concepts

TL;DR

Software maintenance often erodes modularization quality because classes are poorly placed in packages. The authors propose an automated method to assist developers in improving software modularization. Their tool, R 3, uses Relational Topic Models to analyze latent code topics and structural dependencies, then recommends and explains class‑move refactorings. Experiments on nine systems reduced module coupling by 10–30 %, and a study with 62 developers found over 70 % of the recommendations were deemed functionally meaningful.

Abstract

Oftentimes, during software maintenance the original program modularization decays, thus reducing its quality. One of the main reasons for such architectural erosion is suboptimal placement of source-code classes in software packages. To alleviate this issue, we propose an automated approach to help developers improve the quality of software modularization. Our approach analyzes underlying latent topics in source code as well as structural dependencies to recommend (and explain) refactoring operations aiming at moving a class to a more suitable package. The topics are acquired via Relational Topic Models (RTM), a probabilistic topic modeling technique. The resulting tool, coined as R 3 (Rational Refactoring via RTM), has been evaluated in two empirical studies. The results of the first study conducted on nine software systems indicate that R 3 provides a coupling reduction from 10% to 30% among the software modules. The second study with 62 developers confirms that R 3 is able to provide meaningful recommendations (and explanations) for move class refactoring. Specifically, more than 70% of the recommendations were considered meaningful from a functional point of view.

References

64