(Automated) Software Modularization Using Community Detection

Conference paper
Part of the Lecture Notes in Computer Science book series (LNCS, volume 9278)


The modularity of a software system is known to have an effect on, among other, development effort, change impact, and technical debt. Modularizing a specific system and evaluating this modularization is, however, challenging. In this paper, we apply community detection methods to the graph of class dependencies in software systems to find optimal modularizations through communities. We evaluate this approach through a study of 111 Java systems contained in the Qualitas Corpus. We found that using the modularity function of Newman with an Erdős-Rényi null-model and using the community detection algorithm of Reichardt and Bornholdt improved community quality for all systems, that coupling decreased for 99 of the systems, and that coherence increased for 102 of the systems. Furthermore, the modularity function correlates with existing metrics for coupling and coherence.


Software architecture Module structure Software modularity 


Unable to display preview. Download preview PDF.

Unable to display preview. Download preview PDF.


  1. 1.
    Baldwin, C.Y., Clark, K.B.: Design Rules: The Power of Modularity, vol. 1. MIT Press, Cambridge (2000)Google Scholar
  2. 2.
    Wilkie, F., Kitchenham, B.: Coupling measures and change ripples in C++ application software. Journal of Systems and Software 52(23), 157–164 (2000)CrossRefGoogle Scholar
  3. 3.
    Li, Z., Liang, P., Avgeriou, P., Guelfi, N., Ampatzoglou, A.: An empirical investigation of modularity metrics for indicating architectural technical debt. In: Proceedings of the 10th International ACM Sigsoft Conference on Quality of Software Architectures, QoSA 2014, New York, NY, USA, pp. 119–128. ACM (2014)Google Scholar
  4. 4.
    Abdeen, H., Ducasse, S., Sahraoui, H.: Modularization metrics: Assessing package organization in legacy large object-oriented software. In: 2011 18th Working Conference on Reverse Engineering (WCRE), pp. 394–398, October 2011Google Scholar
  5. 5.
    Abdeen, H., Sahraoui, H., Shata, O., Anquetil, N., Ducasse, S.: Towards automatically improving package structure while respecting original design decisions. In: 2013 20th Working Conference on Reverse Engineering (WCRE), pp. 212–221. IEEE (2013)Google Scholar
  6. 6.
    Praditwong, K., Harman, M., Yao, X.: Software module clustering as a multi-objective search problem. IEEE Transactions on Software Engineering 37(2), 264–282 (2011)CrossRefGoogle Scholar
  7. 7.
    de Oliveira Barros, M., de Almeida Farzat, F., Travassos, G.H.: Learning from optimization: A case study with apache ant. Information and Software Technology 57, 684–704 (2015)CrossRefGoogle Scholar
  8. 8.
    Martin, R.C.: The tipping point: Stability and instability in OO design. Dr Dobb’s, March 2005Google Scholar
  9. 9.
    Sarkar, S., Kak, A.C., Rama, G.M.: Metrics for measuring the quality of modularization of large-scale object-oriented software. IEEE Transactions on Software Engineering 34(5), 700–720 (2008)CrossRefGoogle Scholar
  10. 10.
    Briand, L.C., Daly, J.W., Wüst, J.: A unified framework for cohesion measurement in object-oriented systems. Empirical Software Engineering 3(1), 65–117 (1998)CrossRefGoogle Scholar
  11. 11.
    Newman, M.E.J., Girvan, M.: Finding and evaluating community structure in networks. Phys. Rev. E 69(2), 026113 (2004)CrossRefGoogle Scholar
  12. 12.
    Mucha, P.J., Richardson, T., Macon, K., Porter, M.A., Onnela, J.P.: Community structure in time-dependent, multiscale, and multiplex networks. Science 328(5980), 876–878 (2010)MathSciNetCrossRefzbMATHGoogle Scholar
  13. 13.
    Gentea, A., Madsen, T.: Using community detection methods for automated software architecture recovery. Master’s thesis, Department of Computer Science, University of Copenhagen, September 2014Google Scholar
  14. 14.
    Blondel, V.D., Guillaume, J.L., Lambiotte, R., Lefebvre, E.: Fast unfolding of communities in large networks. Journal of Statistical Mechanics: Theory and Experiment 2008(10), P10008 (2008)CrossRefGoogle Scholar
  15. 15.
    Newman, M.E.: Finding community structure in networks using the eigenvectors of matrices. Physical Review E 74(3), 036104 (2006)MathSciNetCrossRefGoogle Scholar
  16. 16.
    Wohlin, C., Runeson, P., Höst, M., Ohlsson, M.C., Regnell, B., Wesslén, A.: Experimentation in software engineering. Springer (2012)Google Scholar
  17. 17.
    Tempero, E., Anslow, C., Dietrich, J., Han, T., Li, J., Lumpe, M., Melton, H., Noble, J.: Qualitas corpus: A curated collection of java code for empirical studies. In: 2010 Asia Pacific Software Engineering Conference (APSEC 2010), pp. 336–345, December 2010Google Scholar
  18. 18.
    Bruneton, E., Lenglet, R., Coupaye, T.: ASM: A code manipulation tool to implement adaptable systems. In: Adaptable and Extensible Component Systems, Grenoble, France, November 2002Google Scholar
  19. 19.
    Wong, K.: Rigi Users Manual. Department of Computer Science, University of Victoria, July 1996.
  20. 20.
    Reichardt, J., Bornholdt, S.: Statistical mechanics of community detection. Physical Review E 74(1), 016110 (2006)MathSciNetCrossRefGoogle Scholar

Copyright information

© Springer International Publishing Switzerland 2015

Authors and Affiliations

  1. 1.Department of Computer Science (DIKU)University of CopenhagenCopenhagenDenmark

Personalised recommendations