Arabian Journal for Science and Engineering

, Volume 44, Issue 11, pp 9413–9426 | Cite as

An Empirical Study on Using Class Stability as an Indicator of Class Similarity

  • Mohammad AlshayebEmail author
Research Article - Computer Engineering and Computer Science


Software maintenance is an important software quality attribute. Many factors affect software maintenance, one of them being code cloning. Code clones are segments of code that are very similar. Software stability tends to measure the unchanged code elements. The objective of this paper is to find whether stability metrics can be used as an indicator of code structural similarity. I perform an empirical study to find the relationship between code similarity and stability at the class level. I also conduct clustering to classify stability and similarity metrics into different related groups. Finally, I perform principal component analysis to determine which class stability metrics have the strongest relationship with class similarity. In addition, I built a prediction model to predict class similarity using class stability metrics. The results show that the four investigated stability metrics have a significant relationship with similarity; however, the class stability metric (CSM) has the strongest correlation with code similarity. The clustering results also reveal that classes with high stability tend to have high similarity. In addition, I found that the CSM and class instability metric (CII) can both reveal 74.023% of class similarity. I conclude that stability metrics can be used as a good indicator of class similarity.


Class stability Class similarity Software metrics Empirical study 



The author acknowledges the support of King Fahd University of Petroleum and Minerals in the development of this work.


  1. 1.
    Fenton, N.; Bieman, J.: Software Metrics: A Rigorous and Practical Approach, 3rd edn. CRC Press, London (2014)zbMATHCrossRefGoogle Scholar
  2. 2.
    Chidamber, S.R.; Kemerer, C.F.: A metrics suite for object oriented design. IEEE Trans. Softw. Eng. 20(6), 476–493 (1994)CrossRefGoogle Scholar
  3. 3.
    ISO/IEC 25010:2011: Systems and software engineering—systems and software quality requirements and evaluation 2011Google Scholar
  4. 4.
    Pressman, R.S.: Software Engineering A Practitioner’s Approach, 7th edn. McGraw-Hill, New York (2010)zbMATHGoogle Scholar
  5. 5.
    Galorath, D.D.: Software total ownership costs: development is only job one. Softw. Technol. News 11(3), 1–14 (2008).Google Scholar
  6. 6.
    Chen, J.-C.; Huang, S.-J.: An empirical analysis of the impact of software development problem factors on software maintainability. J. Syst. Softw. 82(6), 981–992 (2009)CrossRefGoogle Scholar
  7. 7.
    Li, Z.; Lu, S.; Myagmar, S.; Zhou, Y.: CP-miner: finding copy-paste and related bugs in large-scale software code. IEEE Trans. Softw. Eng. 32(3), 176–192 (2006)CrossRefGoogle Scholar
  8. 8.
    Rattan, D.; Bhatia, R.; Singh, M.: Software clone detection: a systematic review. Inf. Softw. Technol. 55(7), 1165–1199 (2013)CrossRefGoogle Scholar
  9. 9.
    Cai, D.; Kim, M.: An empirical study of long-lived code clones. Presented at the Proceedings of the 14th International Conference on Fundamental Approaches to Software Engineering: Part of the Joint European Conferences on Theory and Practice of Software, Saarbrücken, Germany (2011)Google Scholar
  10. 10.
    Roy, C.K.; Cordy, J.R.; Koschke, R.: Comparison and evaluation of code clone detection techniques and tools: a qualitative approach. Sci. Comput. Program. 74(7), 470–495 (2009)MathSciNetzbMATHCrossRefGoogle Scholar
  11. 11.
    Roy, C.K.; Cordy, J.R.: A Survey on Software Clone Detection Research, vol. 541. Queen’s University, Kingston (2007)Google Scholar
  12. 12.
    Jarzabek, S.; Xue, Y.: Are clones harmful for maintenance? Presented at the Proceedings of the 4th International Workshop on Software Clones, Cape Town, South Africa (2010)Google Scholar
  13. 13.
    Thummalapenta, S.; Cerulo, L.; Aversano, L.; Di Penta, M.: An empirical study on the maintenance of source code clones. Empir. Softw. Eng. J. Artic. 15(1), 1–34 (2010)CrossRefGoogle Scholar
  14. 14.
    Juergens, E.; Deissenboeck, F.; Hummel, B.; Wagner, S.: Do code clones matter? In: 2009 IEEE 31st International Conference on Software Engineering, pp. 485–495 (2009)Google Scholar
  15. 15.
    Alshayeb, M.: On the relationship of class stability and maintainability. IET Softw. 7(6), 339–347 (2013)CrossRefGoogle Scholar
  16. 16.
    Alshayeb, M.; Eisa, Y.; Ahmed, M.A.: Object-oriented class stability prediction: a comparison between artificial neural network and support vector machine. Arab. J. Sci. Eng. 39(11), 7865–7876 (2014)CrossRefGoogle Scholar
  17. 17.
    Azar, D.; Harmanani, H.; Korkmaz, R.: Predicting stability of classes in an object-oriented system. J. Comput. Methods Sci. Eng. 10(1–2S1), 39–49 (2010)Google Scholar
  18. 18.
    Grosser, D.; Sahraoui, H.; Valtchev, P.: Predicting software stability using case-based reasoning. In: Proceedings of the 17th IEEE International Conference on Automated Software Engineering, Edinburgh, UK, pp. 295–298 (2002)Google Scholar
  19. 19.
    Grosser, D.; Sahraoui, H.A.; Valtchev, P.: An analogy-based approach for predicting design stability of Java classes. In: Proceedings of the Ninth IEEE international Software Metrics Symposium, pp. 252–262 (2003)Google Scholar
  20. 20.
    Wang, H.; Khoshgoftaar, T.M.; Wald, R.; Napolitano, A.: A novel dataset-similarity-aware approach for evaluating stability of software metric selection techniques. In: 2012 IEEE 13th International Conference on Information Reuse and Integration (IRI), pp. 1–8 (2012)Google Scholar
  21. 21.
    Alshayeb, M.: The impact of refactoring on class and architecture stability. J. Res. Pract. Inf. Technol. 43, 269 (2011)Google Scholar
  22. 22.
    Fowler, M.: Refactoring: Improving the Design of Existing Code, 2nd edn. Addison-Wesley Signature Series (Fowler), Boston (2018)zbMATHGoogle Scholar
  23. 23.
    Binkley, A.B.; Scatch, S.R.: Validation of the coupling dependency metric as a predictor of run time failures and maintenance measure. In: The 20th International Conference in Software Engineering, pp. 452–455 (1998)Google Scholar
  24. 24.
    Chidamber, S.; Darcy, D.; Kemerer, C.: Managerial use of metrics for object-oriented software: an exploratory analysis. IEEE Trans. Softw. Eng. 24(8), 629–639 (1998)CrossRefGoogle Scholar
  25. 25.
    Darcy, D.; Kemerer, C.; Slaughter, S.; Tomayko, J.: The structural complexity of software: an experimental test. IEEE Trans. Softw. Eng. 31(11), 982–995 (2005)CrossRefGoogle Scholar
  26. 26.
    MacCormack, A.; Rusnak, J.; Baldwin, C.: Exploring the structure of complex software designs: an empirical study of open source and proprietary code. Manag. Sci. 52(7), 1015–1030 (2006)CrossRefGoogle Scholar
  27. 27.
    Harrison, R.; Counsell, S.; Nithi, R.: Experimental assessment of the effect of inheritance on the maintainability of object-oriented systems. J. Syst. Softw. 52(2–3), 173–179 (2000)CrossRefGoogle Scholar
  28. 28.
    Li, W.; Henry, S.: Object-oriented Metrics that predict maintainability. J. Syst. Softw. 23, 111–122 (1993)CrossRefGoogle Scholar
  29. 29.
    Harter, M.S.K.D.E.; Slaughter, S.A.: Effects of process maturity on quality, cycle time and effort in software product development. Manag. Sci. 46(4), 451–466 (2000)CrossRefGoogle Scholar
  30. 30.
    Koten, C.; Gray, A.: An application of Bayesian network for predicting object-oriented software maintainability. Inf. Softw. Technol. 48(1), 59–67 (2006)CrossRefGoogle Scholar
  31. 31.
    Bandi, R.; Vaishnavi, V.; Turk, D.: Predicting maintenance performance using object-oriented design complexity metrics. IEEE Trans. Softw. Eng. 29(1), 77–87 (2003)CrossRefGoogle Scholar
  32. 32.
    Misra, S.: Modeling design/coding factors that drive maintainability of software systems. Softw. Qual. J. 13(3), 297–320 (2005)CrossRefGoogle Scholar
  33. 33.
    Thwin, M.; Quah, T.: Application of neural networks for software quality prediction using object-oriented metrics. J. Syst. Softw. 76(2), 147–156 (2005)CrossRefGoogle Scholar
  34. 34.
    Alshayeb, M.; Li, W.: An empirical study of system design instability metric and design evolution in an agile software process. J. Syst. Softw. 74(3), 269–274 (2005)CrossRefGoogle Scholar
  35. 35.
    Olague, H.; Etzkorn, L.; Li, W.; Cox, G.: Assessing design instability in iterative (agile) object-oriented projects. J. Softw. Maint. Evolut. Res. Pract. 18(4), 237–266 (2006)CrossRefGoogle Scholar
  36. 36.
    Kelly, D.: A study of design characteristics in evolving software using stability as a criterion. IEEE Trans. Softw. Eng. 32(5), 315–329 (2006)CrossRefGoogle Scholar
  37. 37.
    Bansiya, J.: Evaluating framework architecture structural stability. ACM Comput. Surv. 32(1), 18 (2000)CrossRefGoogle Scholar
  38. 38.
    Jazayeri, M.: On architectural stability and evolution. In: Blieberger, J., Strohmeier, A. (eds.) Reliable Software Technologies: Ada-Europe 2002, (Lecture Notes in Computer Science, No. 2361), pp. 13–23. Springer, Berlin (2002)Google Scholar
  39. 39.
    Bahsoon, R.; Emmerich, W.: Evaluating software architectures: development, stability, and evolution. In: Proceedings of ACS/IEEE International Conference on Computer Systems and Applications, Tunis, Tunisia, pp. 47–56 (2003)Google Scholar
  40. 40.
    Tonu, S.; Ashkan, A.; Tahvildari, L.: Evaluating architectural stability using a metric-based approach. In: Proceedings of the Conference on Software Maintenance and Reengineering (CSMR’06), pp. 261–270 (2006)Google Scholar
  41. 41.
    Molesini, A.; Garcia, A.; Chavez, C.V.F.G.; Batista, T.V.: “Stability assessment of aspect-oriented software architectures: a quantitative study. J. Syst. Softw. 83(5), 711–722 (2010)CrossRefGoogle Scholar
  42. 42.
    Ebad, S.A.; Ahmed, M.A.: Measuring stability of object-oriented software architectures. IET Softw. 9(3), 76–82 (2015)CrossRefGoogle Scholar
  43. 43.
    Goyal, N.; Srivastava, R.: Stability evaluation model for object oriented software. Int. J. Adv. Res. Comput. Sci. 9(2), 371–375 (2018)CrossRefGoogle Scholar
  44. 44.
    Bahsoon, R.; Emmerich, W.: Evaluating software architectures for stability: a real options approach. In: The 25th International Conference on Software Engineering, Doctoral Symposium, pp. 765–769 (2003)Google Scholar
  45. 45.
    Alenezi, M.; Khellah, F.: Evolution impact on architecture stability in open-source projects. Int. J. Cloud Appl. Comput. 5(4), 24–35 (2015)Google Scholar
  46. 46.
    Alenezi, M.: Software architecture quality measurement stability and understandability. Int. J. Adv. Comput. Sci. Appl. 7(7), 550–559 (2016)Google Scholar
  47. 47.
    Li, W.; Etzkorn, L.; Davis, C.; Talburt, J.: An empirical study of object-oriented system evolution. Inf. Softw. Technol. 42(6), 373–381 (2000)CrossRefGoogle Scholar
  48. 48.
    Ratiu, D.; Ducasse, S.; Girba, T.; Marinescu, R.: Using history information to improve design flaws detection. In: Proceedings of the Eighth European Conference on Software Maintenance and Reengineering (CSMR’04), pp. 223–232 (2004)Google Scholar
  49. 49.
    Alshayeb, M.; Naji, M.; Elish, M.; Al-Ghamdi, J.: Towards measuring object-oriented class stability. IET Softw. 5(4), 415–424 (2011)CrossRefGoogle Scholar
  50. 50.
    Monden, A., Nakae, D., Kamiya, T., Sato, S.; Matsumoto, K.: Software quality analysis by code clones in industrial legacy software. In: Proceedings Eighth IEEE Symposium on Software Metrics, pp. 87–94 (2002)Google Scholar
  51. 51.
    Harder, J.; Tiarks, R.: A controlled experiment on software clones. In: 2012 20th IEEE International Conference on Program Comprehension (ICPC), pp. 219–228 (2012)Google Scholar
  52. 52.
    Kaur, J.; Tomar, P.: Validation of software component selection algorithms based on clustering. Indian J. Sci. Technol. 9(45), 1–4 (2016)Google Scholar
  53. 53.
    Liu, D.; Lung, C.H.; Ajila, S.A.: Adaptive Clustering techniques for software components and architecture. In: 2015 IEEE 39th Annual Computer Software and Applications Conference, vol. 3, pp. 460–465 (2015)Google Scholar
  54. 54.
    Ersoy, E.; Kaya, K.; Altınışık, M.; Sözer, H.: Using hypergraph clustering for software architecture reconstruction of data-tier software. In: Tekinerdogan, B., Zdun, U., Babar, A. (eds.) Software Architecture: 10th European Conference, ECSA 2016, Copenhagen, Denmark, November 28–December 2, 2016, Proceedings. Cham: Springer International Publishing, pp. 326-333 (2016)Google Scholar
  55. 55.
    Khan, Q.; Akram, U.; Butt, W.H.; Rehman, S.: Implementation and evaluation of optimized algorithm for software architectures analysis through unsupervised learning (clustering). In: 2016 17th International Conference on Sciences and Techniques of Automatic Control and Computer Engineering (STA), pp. 266–276 (2016)2016Google Scholar
  56. 56.
    Saeidi, A.M.; Hage, J.; Khadka, R.; Jansen, S.: A search-based approach to multi-view clustering of software systems. In: 2015 IEEE 22nd International Conference on Software Analysis, Evolution, and Reengineering (SANER), pp. 429–438 (2015)Google Scholar
  57. 57.
    Kumari, A.C.; Srinivas, K.; Gupta, M.P.: Software module clustering using a hyper-heuristic based multi-objective genetic algorithm. In: 2013 3rd IEEE International Advance Computing Conference (IACC), pp. 813–818 (2013)Google Scholar
  58. 58.
    Alkhalid, A.; Alshayeb, M.; Mahmoud, S.A.: Software refactoring at the class level using clustering techniques. J. Res. Pract. Inf. Technol. 43(4), 285–306 (2011)Google Scholar
  59. 59.
    Alkhalid, A.; Alshayeb, M.; Mahmoud, S.: Software refactoring at the function level using new adaptive K-nearest neighbor algorithm. Adv. Eng. Softw. 41(10–11), 1160–1178 (2010)CrossRefGoogle Scholar
  60. 60.
    Alkhalid, A.; Alshayeb, M.; Mahmoud, S.A.: Software refactoring at the package level using clustering techniques. IET Softw. 5(3), 276–284 (2011)CrossRefGoogle Scholar
  61. 61.
    Rui, X.; Wunsch II, D.: Survey of clustering algorithms. IEEE Trans. Neural Netw. 16(3), 645–678 (2005)CrossRefGoogle Scholar
  62. 62.
    Zhong, S.; Khoshgoftaar, T.M.; Seliya, N.: Analyzing software measurement data with clustering techniques. IEEE Intell. Syst. 19(2), 20–27 (2004)CrossRefGoogle Scholar
  63. 63.
    Bishnu, P.S.; Bhattacherjee, V.: Software fault prediction using quad tree-based k-means clustering algorithm. IEEE Trans. Knowl. Data Eng. 24(6), 1146–1150 (2012)CrossRefGoogle Scholar
  64. 64.
    Li, K.; Zhao, K.; Liu, W.: Neural network ensemble based on K-means clustering individual selection and application for software reliability prediction. In: 2013 Fourth World Congress on Software Engineering, pp. 131–135 (2013)Google Scholar
  65. 65.
    Malviya, A.K.; Yadav, V.K.: Maintenance activities in object oriented software systems using K-means clustering technique: a review. In: 2012 CSI Sixth International Conference on Software Engineering (CONSEG), pp. 1–5 (2012)Google Scholar
  66. 66.
    Burd, E.; Bailey, J.: Evaluating clone detection tools for use during preventative maintenance. Presented at the Proceedings of the Second IEEE International Workshop on Source Code Analysis and Manipulation, 2002Google Scholar
  67. 67.
    Prechelt, L.; Malpohl, G.; Phlippsen, M.: JPlag: finding plagiarisms among a set of programs. In: Technical Report 2000–1, Karlsruhe Institute of Technology 2000.
  68. 68.
    Aiken, A.: A System for Detecting Software Plagiarism. Accessed May 2018
  69. 69.
    Mayrand, J.; Leblanc, C.; Merlo, E.: Experiment on the Automatic Detection of Function Clones in a Software System Using Metrics. IEEE Computer Society, Washington, DC (1996)CrossRefGoogle Scholar
  70. 70.
    Kamiya, T.; Ohata, F.; Kondou, K.; Kusumoto, S.; Inoue, K.: Maintenance support tools for Java programs: CCFinder and JAAT. In: Proceedings of the 23rd International Conference on Software Engineering. ICSE 2001, pp. 837–838 (2001)Google Scholar
  71. 71.
    Baxter, I.D.; Yahin, A.; Moura, L.; Sant’Anna, M.; Bier, L.: Clone detection using abstract syntax trees. Presented at the Proceedings of the International Conference on Software Maintenance, 1998Google Scholar
  72. 72.
    Android: The android project. Accessed Dec 2018
  73. 73.
    Eclpise: Eclipse. Accessed Dec 2018
  74. 74.
    Oracle: NetBeans: Accessed No. 2018
  75. 75.
    Buddi: Accessed April 2018
  76. 76.
    Gamma, E.; Eggenschwiler, T.: JHotDraw. Accessed Nov 2018
  77. 77.
    UniTime: Accessed April 2018
  78. 78.
    Naji, M.: Measuring object-oriented class stability. Master’s Thesis Master Thesis, King Fahd University of Petroleum & Minerals, Dhahran, Saudi Arabia, 2008Google Scholar
  79. 79.
    AlGhamdi, J.; Rufai, R.; Khan, S.: OOMeter: a software quality assurance tool. In: Proceedings of the Ninth European Conference on Software Maintenance and Reengineering (CSMR 2005), pp. 190–191 (2005)Google Scholar
  80. 80.
    LOCC Software: Accessed Nov 2018
  81. 81.
    LocMetrics: Loc Metrics Tool. (2016). Accessed May 2018
  82. 82.
    Heiman, G.W.: Basic Statistics for the Behavioral Sciences. Wadsworth Publishing, Belmont (2010)Google Scholar
  83. 83.
    Jolliffe, I.: Principal Component Analysis, 2nd edn. Springer, Berlin (2002)zbMATHGoogle Scholar
  84. 84.
    Gorsuch, R.L.: Factor Analysis, 2nd edn. Lawrence Erlbaum Associates, Mahwah (1983)zbMATHGoogle Scholar
  85. 85.
    MacCallum, R.C.; Widaman, K.F.; Zhang, S.; Hong, S.: Sample size in factor analysis. Psychol. Methods 4, 84–99 (1999)CrossRefGoogle Scholar
  86. 86.
    Hutcheson, G.; Sofroniou, N.: The Multivariate Social Scientist: Introductory Statistics Using Generalized Linear Models. SAGE Publications Ltd, Thousand Oaks (1999)zbMATHCrossRefGoogle Scholar
  87. 87.
    Norusis, M.: SPSS 13.0 Statistical Procedures Companion. Prentice Hall, Englewood Cliffs (2005)Google Scholar
  88. 88.
    Hogarty, K.Y.; Hines, C.V.; Kromrey, J.D.; Ferron, J.M.; Mumford, K.R.: The quality of factor solutions in exploratory factor analysis: the influence of sample size, communality, and overdetermination. Educ. Psychol. Meas. 65, 202–223 (2005)MathSciNetCrossRefGoogle Scholar
  89. 89.
    Grimm, L.G.; Yarnold, P.R.: Reading & Understanding Multivariate Statistics, 1st edn. American Psychological Association, Washington (1995)Google Scholar
  90. 90.
    Veerasamy, R.; Rajak, H.; Jain, A.; Sivadasan, S.; Varghese, C.P.; Agrawal, R.K.: Validation of QSAR Models-strategies and importance. Int. J. Drug Des. Discov. 2(3), 511–519 (2011)Google Scholar
  91. 91.
    Burd, E.; Bailey, J.: Evaluating clone detection tools for use during preventative maintenance. In: Proceedings. Second IEEE International Workshop on Source Code Analysis and Manipulation, pp. 36–43 (2002)Google Scholar
  92. 92.
    Bellon, S.; Koschke, R.; Antoniol, G.; Krinke, J.; Merlo, E.: Comparison and evaluation of clone detection tools. IEEE Trans. Softw. Eng. 33(9), 577–591 (2007)CrossRefGoogle Scholar
  93. 93.
    Kamiya, T.; Kusumoto, S.; Inoue, K.: CCFinder: a multilinguistic token-based code clone detection system for large scale source code. IEEE Trans. Softw. Eng. 28(7), 654–670 (2002)CrossRefGoogle Scholar
  94. 94.
    Baker, B.S.: On finding duplication and near-duplication in large software systems. In: Proceedings of 2nd Working Conference on Reverse Engineering, pp. 86–95 (1995)Google Scholar
  95. 95.
    Koschke, R.; Falke, R.; Frenzel, P.: Clone detection using abstract syntax suffix trees. Presented at the Proceedings of the 13th Working Conference on Reverse Engineering, 2006Google Scholar
  96. 96.
    Juergens, E.; Deissenboeck, F.; Hummel, B.: Code similarities beyond copy & paste. In: 2010 14th European Conference on Software Maintenance and Reengineering, pp. 78–87 (2010)Google Scholar
  97. 97.
    Juergens, E.; Deissenboeck, F.; Hummel, B.: CloneDetective: a workbench for clone detection research. In: 2009 IEEE 31st International Conference on Software Engineering, pp. 603–606 (2009)Google Scholar
  98. 98.
    Jiang, L.; Misherghi, G.; Su, Z.; Glondu, S.: DECKARD: scalable and accurate tree-based detection of code clones. In: 29th International Conference on Software Engineering (ICSE’07), pp. 96–105 (2007)Google Scholar
  99. 99.
    Falke, R.; Frenzel, P.; Koschke, R.J.E.S.E.: Empirical evaluation of clone detection using syntax suffix trees. J. Artic. 13(6), 601–643 (2008)Google Scholar

Copyright information

© King Fahd University of Petroleum & Minerals 2019

Authors and Affiliations

  1. 1.Information and Computer Science DepartmentKing Fahd University of Petroleum and MineralsDhahranSaudi Arabia

Personalised recommendations