Skip to main content
Log in

Rank-based refactoring decision support: two studies

  • Original Paper
  • Published:
Innovations in Systems and Software Engineering Aims and scope Submit manuscript

Abstract

Refactoring can result in code with improved maintainability and is considered a preventive maintenance activity. Managers of large projects need ways to decide where to apply scarce resources when performing refactoring. There is a lack of tools for supporting such decisions. We introduce a rank-based software measure-driven refactoring decision support approach to assist managers. The approach uses various static measures to develop a weighted rank, ranking classes or packages that need refactoring. We undertook two case studies to examine the effectiveness of the approach. Specifically, we wanted to see if the decision support tool yielded results similar to those of human analysts/managers and in less time so that it can be used to augment human decision making. In the first study, we found that our approach identified classes as needing refactoring that were also identified by humans. In the second study, a hierarchical approach was used to identify packages that had actually been refactored in 15 releases of the open source project Tomcat. We examined the overlap between the tool’s findings and the actual refactoring activities. The tool reached 100/86.7% recall on the package/class level. Though these studies were limited in size and scope, it appears that this approach is worthy of further examination.

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

Access this article

Price excludes VAT (USA)
Tax calculation will be finalised during checkout.

Instant access to the full article PDF.

Institutional subscriptions

Similar content being viewed by others

References

  1. Apache Tomcat. http://tomcat.apache.org

  2. Albrecht, A.: Measuring application development productivity. In: Proceedings of the SHARE/GUIDE IBM applications development symposium, Monterey, CA, 14–17 October 1979

  3. Ahn Y, Suh J, Kim S, Kim H (2003) The software maintenance project effort estimation model based on function points. J Softw Maint Res Pract 15(2): 71–85

    Article  Google Scholar 

  4. Antoniol G, Canfora G, Lucia A (1999) Estimating the Size of Changes for Evolving Object Oriented Systems: a case study. In: IEEE metrics, pp 250–258

  5. Ball T, Kim J, Porter AA, Siy HP (1991) If your version control system could talk. In: ICSE workshop on process modeling and empirical studies of software engineering

  6. Basili V, Briand L, Condon S, Kim Y-M, Melo WL, Valett JD (1996) Understanding and predicting the process of software maintenance releases. In: Proceedings of the 18th international conference on software engineering, Berlin, Germany, pp 464–474

  7. Basili V, Lindvall M, Costa P (2001) Implementing the experience factory concepts as a set of experience bases. In: Proceedings of the SEKE 2001 conference, Buenos Aires, Argentina

  8. Binkley D, Harman M (2006) Tool-supported refactoring of existing object-oriented code into aspects. IEEE Trans Softw Eng 32: 9

    Article  Google Scholar 

  9. Boehm B, Clark B, Horowitz E, Westland C, Madachy R, Selby R (1995) Cost Models for Future Software Life Cycle Processes: COCOMO 2.0. Ann Softw Eng 1:57–94 (special volume)

    Google Scholar 

  10. Boehm B, Horowitz E, Madachy R Reifer D, Clark BK, Steece B, Brown AW, Chulani S, Abts C (2000) Software cost estimation with Cocomo II. Prentice-Hall, Englewood Cliffs

  11. Briand L, Daly J, Wuest J (1999) A Unified framework for coupling measurement in object-oriented systems. IEEE Trans Softw Eng

  12. Briand L, Emam Ei K, Bomarius F (1998) A hybrid method for software cost estimation and risk assessment. In: IEEE international conference on software engineering (ICSE), Osaka, Japan

  13. Chidamber S, Kemerer C (1994) A metrics suite for object oriented design. IEEE Trans Softw Eng 20(6): 476–493

    Article  Google Scholar 

  14. Clarkware.com. http://www.clarkware.com/software/JDepend.html

  15. Coupling, abstractness, stability—measuring and applying code metrics (2007) Retrieved 20 April 2010. http://codebetter.com/blogs/raymond.lewallen/archive/2005/07/15/129265.aspx

  16. Dagpinar M, Jahnke JH (2003) Predicting maintainability with object-oriented metrics—an empirical comparison. In: Proceedings of the 10th working conference on reverse engineering, November, pp 155–163

  17. DeFee JM (1994) Integrating analysis complexity tool output with formal re-engineering estimation processes. In: Proceedings of the second annual McCabe users group conference. Baltimore, MD

  18. Demeyer S, Ducasse S, Nierstrasz O (2000) Finding refactorings via change metrics. In: Proceedings of OOPSLA ’2000 (international conference on Object-Oriented Programming Systems, languages and applications)

  19. Draheim D, Pekacki L (2003) Process-centric analytical processing of version control data. In: IWPSE ’03 proceedings of the 6th international workshop on principles of software evolution

  20. Du Bois B, Demeyer S, Verelst J (2004) Refactoring—improving coupling and cohesion of existing code. In: Proceedings 11th working conference on reverse engineering, 8–12 November 2004, pp 144–151

  21. Edison Design Group. JFE, a Front End for the Java Language. http://www.edg.com/jfe.html

  22. Fischer M, Pinzger M, Gall H (2003) Populating a release history database from version control and bug tracking systems. In: IEEE international conference on software maintenance

  23. Fowler M, Beck K, Brant J, Opdyke W, Roberts D (2001) Refactoring: improving the design of existing code. Addison-Wesley, Reading

    Google Scholar 

  24. Fioravanti F, Nesi P (2001) Estimation and prediction metrics for adaptive maintenance effort of object-oriented systems. IEEE Trans Softw Eng 27(12): 1062–1084

    Article  Google Scholar 

  25. Garrido A, Johnson R (2003) Refactoring C with conditional compilation. In: 18th IEEE international conference on automated software engineering

  26. Glover A In pursuit of code quality: code quality for software architects. http://www.ibm.com/developerworks/java/library/j-cq04256/

  27. Graves TL, Mockus A (1998) Inferring change effort from configuration management data. In: Metrics 98: fifth international symposium on software metrics, Nov 1998, Bethesda, MD, pp 267–273

  28. Halstead MH (1977) Elements of software science, operating, and programming systems series, vol 7. Elsevier, New York

    Google Scholar 

  29. Hassan A, Goseva-Popstojanova K, Ammar H (2005) UML based severity analysis methodology. In: 2005 annual reliability and maintainability symposium, Alexandria, VA

  30. Hayes JH, Burgess C (1988) Partially automated in-line documentation (PAID): Design and implementation of a software maintenance tool. In: Proceedings of the 1988 IEEE conference on software maintenance, Phoenix, Az, pp 60–65

  31. Hayes JH (2002) Energizing software engineering education through real-world projects as experimental studies. In: Proceedings of the 15th conference on software engineering education and training (CSEET), Covington, KY

  32. Hayes JH, Mohamed N, Gao T (2002) The observe-mine-adopt model: an agile way to enhance software maintainability. J Softw Maint Evol

  33. Hayes JH, Patel S, Zhao L (2004) A metrics-based software maintenance effort model. In: Proceedings of the 8th european conference on software maintenance and reengineering, Tampere, Finland, pp 254–258

  34. Hayes JH, Zhao L (2005) Maintainability prediction: a regression analysis of measures of evolving systems. In: Proceedings of the 21th international conference on software maintenance, Budapest, Hungary, pp 601–604

  35. Hayes J, Huffman, Dekhtyar A, Osborne J (2003) Improving requirements tracing via information retrieval. In: Proceedings of the RE 2003, pp 138–147

  36. Høst M, Regnell B, Wohlin C (2000) Using students as subjects—a comparative study of students and professionals in lead-time impact assessment. Empir Softw Eng 5(2): 210–214

    Google Scholar 

  37. IEEE, ANSI/IEEE Std. 729-1983 (1990) IEEE standard glossary of software engineering terminology

  38. Jorgensen M (2004) A review of studies on expert estimation of software development effort. J Syst Softw 70(1–2): 37–60

    Article  Google Scholar 

  39. Kemerer CF, Slaughter R (1999) An empirical approach to studying software evolution. IEEE Trans Softw Eng 25(4)

  40. Khoshgoftaar T, Allen E, Jones W, Hudepohl J (2001) Cost–benefit analysis of software quality models. Softw Qual J 9(1)

  41. Kitchenham B, Pickard L, Pfleeger S (1995) Case studies for method and tool evaluation. IEEE Softw 7: 52–62

    Article  Google Scholar 

  42. Knoernschild K (2006) Using metrics to help drive Agile software. Agile J. http://www.agilejournal.com/articles/the-agile-developer/using-metrics-to-help-drive-agile-software.html. Accessed 07 June 2006

  43. Kataoka Y, Imai T, Andou H, Fukaya T (2002) A quantitative evaluation of maintainability enhancement by refactoring. In: ICSM 2002, pp 576–585

  44. Stroggylos K, Spinellis D (2007) Refactoring—does it improve software quality? In: ICSE Workshops 2007. Proceedings of the fifth international workshop on software quality, 20–26 May 2007

  45. Li W, Henry S (1993) Object-oriented metrics that predict maintainability. J Syst Softw 23(2): 111–122

    Article  Google Scholar 

  46. McCabe TJ, Watson AH (1994) Software complexity. Crosstalk. J Def Softw Eng 7(12): 5–9

    Google Scholar 

  47. Mens T, Tourwé T, Muñoz F (2003) Beyond the refactoring browser: advanced tool support for software refactoring. In: Proceedings of the international workshop on principles of software evolution, Helsinki, Finland, 2003

  48. Mens T, Taentzer G, Runge O (2007) Analysing refactoring dependencies using graph transformation. Softw Syst Model 6: 269– 285

    Article  Google Scholar 

  49. Menzies T, Chen Z, Hihn J, Lum K (2006) Selecting best practices for effort estimation. IEEE Trans Softw Eng

  50. Moser R, Pedrycz W, Sillitti A, Succi G (2008) A model to identify refactoring effort during maintenance by mining source code repositories. In: PROFES 2008. LNCS, vol 5089, pp 360–370

  51. Mukhopadhyay T, Kekre S (1992) Software effort models for early estimation of process control applications. IEEE Trans Softw Eng 18(10): 915–924

    Article  Google Scholar 

  52. Boudjlida N (1999) An experiment in refactoring an object oriented CASE tool. An experiment in refactoring an object oriented CASE tool. http://www.loria.fr/~nacer/PUBLI/Mcseai98.ps.gz

  53. Niessink F, Van Vliet H (1997) Predicting maintenance effort with function Points. In: Proceedings of the international conference on software maintenance (ICSM ’97), 01–03 Oct 1997, Bari, Italy

  54. Nikora AP, Munson JC (2003) Developing fault predictors for evolving software systems. In: Proceedings of the ninth international on software metrics symposium, 3–5 Sept 2003, pp 338–350

  55. Offutt J, Abdurazik P, Schach RS (2008) Quantitatively measuring object-oriented couplings. Softw Qual J 16(4): 489–512

    Article  Google Scholar 

  56. Opdyke WF (1992) Refactoring object-oriented frameworks, Ph.D. dissertation, Univerisity of Illinois at Urbana-Champaign

  57. Patel V (2004) Building a static analysis tool for java programs, master’s project report, University Of Kentucky, April 2004

  58. Pressman RS (2001) Software engineering: a practitioner’s approach, 5th edn. McGraw-Hill, NY

    Google Scholar 

  59. Ramil JF, Lehman MM (2000) Metrics of software evolution as effort predictors—a case study. In: Proceedings of the 16th IEEE international conference on software maintenance, San Jose, CA, USA, 2000, pp 163–172

  60. Martin RC (2002) Agile software development principles, patterns, and practices. Prentice-Hall/Pearson Education Inc, Englewood Cliffs

  61. Sneed HM, GmbH A, Austria V (2004) A cost model for software maintenance & evolution. In: Proceedings of the 20th IEEE international conference on software maintenance, pp 264–273, 11–14 Sept 2004

  62. Simon F, Steinbrückner F, Lewerentz C (2001) Metrics-based refactoring. In: Fifth European conference on software maintenance and reengineering, 2001

  63. (2008) Sourceforge.net. Metrics 1.3.6-Getting started. http://metrics.sourceforge.net/

  64. Spiegel MR, Schiller JJ, Srinivasan AV (2002) Probability and statistics

  65. Spinellis D ckjm—Chidamber and Kemerer java metrics. http://www.spinellis.gr/sw/ckjm/

  66. McCabe TJ, Watson AH Software compleixty. http://www.stsc.hill.af.mil/crosstalk/1994/12/xt94d12b.asp

  67. Walston CE, Felix CP (1977) A method of programming measurement and estimation IBM Syst J 16(1)

  68. Welker KD (2001) Software maintainability metrics model an improvement in the coleman. In: SCST Crosstalk, Aug 2001

  69. Welker KD, Oman PW (1995) Software maintainability metrics models in practice. Crosstalk. J Def Softw Eng 8(11):19–23

    Google Scholar 

  70. Williamson ES (1993) Determination of redundancy using McCabe complexity metrics. In: Proceedings of the first annual McCabe users group conference, Baltimore, MD, 1993

  71. Yu L (2004) Indirectly predicting the maintenance effort of open-source software. J Softw Maint Evol Res Pract 18(5): 311–332

    Article  Google Scholar 

  72. Zimmermann T, Weißgerber P (2004) Preprocessing CVS data for fine-grained analysis. In: Proceedings of the first international workshop on mining software repositories (MSR 2004), Edinburgh

  73. Zhao L, Hayes J (2006) Predicting classes in need of refactoring: an application of static metrics. In: Proceedings of 2nd international PROMISE workshop, Philadelphia, 2006

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Jane Huffman Hayes.

Rights and permissions

Reprints and permissions

About this article

Cite this article

Zhao, L., Hayes, J.H. Rank-based refactoring decision support: two studies. Innovations Syst Softw Eng 7, 171–189 (2011). https://doi.org/10.1007/s11334-011-0154-3

Download citation

  • Received:

  • Accepted:

  • Published:

  • Issue Date:

  • DOI: https://doi.org/10.1007/s11334-011-0154-3

Keywords

Navigation