An empirical study of cycles among classes in Java


Advocates of the design principle avoid cyclic dependencies among modules have argued that cycles are detrimental to software quality attributes such as understandability, testability, reusability, buildability and maintainability, yet folklore suggests such cycles are common in real object-oriented systems. In this paper we present the first significant empirical study of cycles among the classes of 78 open- and closed-source Java applications. We find that, of the applications comprising enough classes to support such a cycle, about 45% have a cycle involving at least 100 classes and around 10% have a cycle involving at least 1,000 classes. We present further empirical evidence to support the contention these cycles are not due to intrinsic interdependencies between particular classes in a domain. Finally, we attempt to gauge the strength of connection among the classes in a cycle using the concept of a minimum edge feedback set.

This is a preview of subscription content, log in to check access.


  1. Binder RV (1999) Testing object-oriented systems: models, patterns, and tools. Addison-Wesley, Reading, Boston, MA

    Google Scholar 

  2. Booch G (1991) Object oriented design with applications. Benjamin-Cummings, Redwood City, CA

    Google Scholar 

  3. Booch G (1995) Object solutions: managing the object-oriented project. Addison-Wesley Longman, Redwood City, CA

    Google Scholar 

  4. Briand LC, Daly JW, Wüust JK (1999) A unified framework for coupling measurement in object-oriented systems. IEEE Trans Softw Eng 25(1):91–121

    Article  Google Scholar 

  5. Briand LC, Labiche Y, Wang Y (2003) An investigation of graph-based class integration test order strategies. IEEE Trans Softw Eng 29(7):594–607

    Article  Google Scholar 

  6. Chidamber SR, Kemerer CF (1991) Towards a metrics suite for object oriented design. In: OOPSLA ’91 Conference proceedings on Object-oriented programming systems, languages, and applications. ACM Press, New York, pp 197–211

    Google Scholar 

  7. Dijkstra EW (1968) The structure of the THE-multiprogramming system. Commun ACM 11(5):341–346

    MATH  Article  Google Scholar 

  8. Eades P, Lin X, Smyth WF (1993) A fast and effective heuristic for the feedback arc set problem. Inf Process Lett 47(6):319–323

    MATH  Article  MathSciNet  Google Scholar 

  9. Foote B, Yoder JW (2000) Big ball of mud. In: Harrison N, Foote B, Rohnert H (eds) Pattern languages of program design, vol. 4. Addison-Wesley, pp 654–692

  10. Fowler M (2001) Reducing coupling. IEEE Softw 18(4):102–104

    Article  MathSciNet  Google Scholar 

  11. Gil JY, Maman I (2005) Micro patterns in Java code. In: Proceedings of the 20th Annual conference on object-oriented programming, systems, languages and applications (OOPSLA’05), SIGPLAN, San Diego, California, pp 97–116

  12. Gosling J, Joy B, Steele G, Bracha G (2000) Java language specification, second edition: the Java series. Addison-Wesley Longman, Boston, MA

    Google Scholar 

  13. Gross JL, Yellen J (2004) Handbook of graph theory. CRC Press

  14. Grothoff C, Palsberg J, Vitek J (2001) Encapsulating objects with confined types. In: OOPSLA ’01 Proceedings of the 16th ACM SIGPLAN conference on Object oriented programming, systems, languages, and applications, ACM Press, New York, pp 241–255

    Google Scholar 

  15. Hashim NL, Schmidt HW, Ramakrishnan S (2005) Test order for class-based integration testing of java applications. In: QSIC, pp 11–18

  16. Hautus E (2002) Improving Java software through package structure analysis. In: The 6th IASTED International Conference Software Engineering and Applications

  17. Jungmayr S (2002) Identifying test-critical dependencies. In: ICSM, pp 404–413

  18. Kung D, Gao J, Hsia P, Lin J, Toyoshima Y (1993) Design recovery for software testing of object-oriented programs. In: Proceedings of the Working Conference on Reverse Engineering, pp 202–211

  19. Kung D, Gao J, Hsia P, Lin J, Toyoshima Y (1995) Class firewall, test order, and regression testing of object-oriented programs. J Object-oriented Program 8(2):51–65

    Google Scholar 

  20. Kung D, Gao J, Hsia P, Toyoshima Y, Chen C, Kim YS, Song YK (1995) Developing an object-oriented software testing and maintenance environment. Commun ACM 38(10):75–87

    Article  Google Scholar 

  21. Lakos J (1996) Large-scale C++ software design. Addison-Wesley Longman, Redwood City, CA

    Google Scholar 

  22. Lehman MM, Ramil JF, Wernick PD, Perry DE, Turski WM (1997) Metrics and laws of software evolution—the nineties view. In: METRICS ’97 Proceedings of the 4th International Symposium on Software Metrics. IEEE Computer Society, Washington, DC, p 20

    Google Scholar 

  23. Lindholm T, Yellin F (1999) Java Virtual Machine Specification. Addison-Wesley Longman, Boston, MA

    Google Scholar 

  24. Martin RC (1996) Granularity, C++ Rep 8(10):57–62

    Google Scholar 

  25. Melton H (2006) On the usage and usefulness of OO design principles. In: OOPSLA ’06 Companion to the 21st ACM SIGPLAN conference on object-oriented programming languages, systems, and applications. ACM Press, New York, pp 770–771

    Google Scholar 

  26. Melton H, Tempero E (2006) Identifying refactoring opportunities by identifying dependency cycles. In: Proceedings of the 29th Australasian Computer Science Conference

  27. Meyer B (1995) Object success: a manager’s guide to object orientation, its impact on the corporation, and its use for reengineering the software process. Prentice-Hall, Upper Saddle River, NJ

    Google Scholar 

  28. Parnas DL (1972) On the criteria to be used in decomposing systems into modules. Commun ACM 15(12):1053–1058

    Article  Google Scholar 

  29. Parnas DL (1978) Designing software for ease of extension and contraction. In: ICSE ’78 Proceedings of the 3rd international conference on Software engineering. IEEE Press, Piscataway, NJ, pp 264–277

    Google Scholar 

  30. Parnas DL (1996) Why software jewels are rare. Computer 29(2):57–60

    Article  Google Scholar 

  31. Riel AJ (1996) Object-Oriented Design Heuristics. Addison-Wesley Longman, Boston, MA

    Google Scholar 

  32. Skiena SS (1998) The algorithm design manual. Springer, Berlin Heidelberg New York

    Google Scholar 

  33. Stevens WP, Myers GJ, Constantine LL (1974) Structured design. IBM Syst J 13(2):115–139

    Article  Google Scholar 

  34. Szyperski C (2002) Component Software: Beyond object-oriented programming, 2nd edn. Addison-Wesley Longman, Boston, MA

    Google Scholar 

  35. Winter M (1998) Managing object-oriented integration and regression testing. In: Presented at 6th EuroSTAR Conference

  36. Wirth N (1995) A plea for lean software. Computer 28(2):64–68

    Article  Google Scholar 

Download references

Author information



Corresponding author

Correspondence to Hayden Melton.

Rights and permissions

Reprints and Permissions

About this article

Cite this article

Melton, H., Tempero, E. An empirical study of cycles among classes in Java. Empir Software Eng 12, 389–415 (2007).

Download citation


  • Dependency cycles
  • Java
  • Software corpus
  • Program analysis
  • Object-oriented design