Open Access   Article Go Back

Generating Code-Smell Prediction Rules Using Decision Tree Algorithm and Software Metrics

Mohammad Y. Mhawish1 , Manjari Gupta2

Section:Research Paper, Product Type: Journal Paper
Volume-7 , Issue-5 , Page no. 41-48, May-2019

CrossRef-DOI:   https://doi.org/10.26438/ijcse/v7i5.4148

Online published on May 31, 2019

Copyright © Mohammad Y. Mhawish, Manjari Gupta . This is an open access article distributed under the Creative Commons Attribution License, which permits unrestricted use, distribution, and reproduction in any medium, provided the original work is properly cited.

View this paper at   Google Scholar | DPI Digital Library

How to Cite this Paper

  • IEEE Citation
  • MLA Citation
  • APA Citation
  • BibTex Citation
  • RIS Citation

IEEE Style Citation: Mohammad Y. Mhawish, Manjari Gupta, “Generating Code-Smell Prediction Rules Using Decision Tree Algorithm and Software Metrics,” International Journal of Computer Sciences and Engineering, Vol.7, Issue.5, pp.41-48, 2019.

MLA Style Citation: Mohammad Y. Mhawish, Manjari Gupta "Generating Code-Smell Prediction Rules Using Decision Tree Algorithm and Software Metrics." International Journal of Computer Sciences and Engineering 7.5 (2019): 41-48.

APA Style Citation: Mohammad Y. Mhawish, Manjari Gupta, (2019). Generating Code-Smell Prediction Rules Using Decision Tree Algorithm and Software Metrics. International Journal of Computer Sciences and Engineering, 7(5), 41-48.

BibTex Style Citation:
@article{Mhawish_2019,
author = {Mohammad Y. Mhawish, Manjari Gupta},
title = {Generating Code-Smell Prediction Rules Using Decision Tree Algorithm and Software Metrics},
journal = {International Journal of Computer Sciences and Engineering},
issue_date = {5 2019},
volume = {7},
Issue = {5},
month = {5},
year = {2019},
issn = {2347-2693},
pages = {41-48},
url = {https://www.ijcseonline.org/full_paper_view.php?paper_id=4195},
doi = {https://doi.org/10.26438/ijcse/v7i5.4148}
publisher = {IJCSE, Indore, INDIA},
}

RIS Style Citation:
TY - JOUR
DO = {https://doi.org/10.26438/ijcse/v7i5.4148}
UR - https://www.ijcseonline.org/full_paper_view.php?paper_id=4195
TI - Generating Code-Smell Prediction Rules Using Decision Tree Algorithm and Software Metrics
T2 - International Journal of Computer Sciences and Engineering
AU - Mohammad Y. Mhawish, Manjari Gupta
PY - 2019
DA - 2019/05/31
PB - IJCSE, Indore, INDIA
SP - 41-48
IS - 5
VL - 7
SN - 2347-2693
ER -

VIEWS PDF XML
993 707 downloads 241 downloads
  
  
           

Abstract

Code smells identified by Fowler [1] is as symptoms of possible code or design problems. Code smells have adverse affecting the quality of the software system by making software challenging to understand and consequently increasing the efforts to maintenance and evolution. The detection of code smells is the way to improve software quality by recovering code smells and perform the refactoring processes. In this paper, we propose a code- smells detection approach based on a decision tree algorithm and software metrics. The datasets we used to train the models are built by reforming the datasets used by Arcelli Fontana et al. work [2]. We use two feature selection methods based on a genetic algorithm to select the most essential features in each dataset. Moreover, we use the grid search algorithm to tuning the decision tree hyperparameters. We extract a set of detection conditions using decision tree models, that are considered as prediction rules to detect each code smell in our binary-class datasets.

Key-Words / Index Term

code smells, code smells detection, Feature selection, decision tree, prediction rules

References

[1] M. Fowler, K. Beck, J. Brant, W. Opdyke, and D. Roberts, Refactoring: improving the design of existing code. Addison-Wesley Professional, 1999.
[2] F. Arcelli Fontana, M. V. Mäntylä, M. Zanoni, and A. Marino, “Comparing and experimenting machine learning techniques for code smell detection,” Empir. Softw. Eng., vol. 21, no. 3, pp. 1143–1191, 2016.
[3] I. C. S. S. E. S. Committee and I.-S. S. Board, “IEEE recommended practice for software requirements specifications,” 1998.
[4] L. Chung and J. C. S. do Prado Leite, “On non-functional requirements in software engineering,” in Conceptual modeling: Foundations and applications, Springer, 2009, pp. 363–379.
[5] P. Rai, A. Pradhan, M. Pradhan, A. Chettri, and B. Limboo, “Comparative Study on Various Techniques Used in Examination System : A Survey,” vol. 7, no. 2, pp. 24–28, 2019.
[6] E. J. Chikofsky and J. H. Cross, “Reverse engineering and design recovery: A taxonomy,” IEEE Softw., vol. 7, no. 1, pp. 13–17, 1990.
[7] A. Yamashita and L. Moonen, “Exploring the impact of inter-smell relations on software maintainability: An empirical study,” Proc. - Int. Conf. Softw. Eng., pp. 682–691, 2013.
[8] A. Yamashita and S. Counsell, “Code smells as system-level indicators of maintainability: An empirical study,” J. Syst. Softw., vol. 86, no. 10, pp. 2639–2653, 2013.
[9] A. Yamashita and L. Moonen, “Do code smells reflect important maintainability aspects?,” IEEE Int. Conf. Softw. Maintenance, ICSM, pp. 306–315, 2012.
[10] D. I. K. Sjoberg, A. Yamashita, B. C. D. Anda, A. Mockus, and T. Dyba, “Quantifying the effect of code smells on maintenance effort,” IEEE Trans. Softw. Eng., vol. 39, no. 8, pp. 1144–1156, 2013.
[11] D. SAHIN, M. KESSENTINI, S. BECHIKH, and K. DEB, “Code-Smells Detection as a Bi-Level Problem,” ACM Trans. Softw. Eng. Methodol., vol. 24, no. 1, 2014.
[12] E. Van Emden and L. Moonen, “Java quality assurance by detecting code smells,” Proc. - Work. Conf. Reverse Eng. WCRE, vol. 2002-Janua, no. November, pp. 97–106, 2002.
[13] M. Influential, P. Award, and E. Van Emden, “Assuring Software Quality by Code Smell Detection.”
[14] S. M. Olbrich, D. S. Cruzes, and D. I. K. Sjoøberg, “Are all code smells harmful? A study of God Classes and Brain Classes in the evolution of three open source systems,” IEEE Int. Conf. Softw. Maintenance, ICSM, 2010.
[15] M. Tufano et al., “When and why your code starts to smell bad,” Int. Conf. Softw. Eng. ICSE, vol. 1, pp. 403–414, 2015.
[16] O. Ciupke, “Automatic detection of design problems in object-oriented reengineering,” in Technology of Object-Oriented Languages and Systems, 1999. TOOLS 30 Proceedings, 1999, pp. 18–32.
[17] G. Travassos, F. Shull, M. Fredericks, and V. R. Basili, “Detecting defects in object-oriented designs: using reading techniques to increase software quality,” in ACM Sigplan Notices, 1999, vol. 34, no. 10, pp. 47–56.
[18] E. M. Dashofy, A. van der Hoek, and R. N. Taylor, “A comprehensive approach for the development of modular software architecture description languages,” ACM Trans. Softw. Eng. Methodol., vol. 14, no. 2, pp. 199–245, 2005.
[19] S. Vidal, H. Vazquez, J. A. Diaz-Pace, C. Marcos, A. Garcia, and W. Oizumi, “JSpIRIT: A flexible tool for the analysis of code smells,” Proc. - Int. Conf. Chil. Comput. Sci. Soc. SCCC, vol. 2016-Febru, 2016.
[20] R. Marinescu, “Measurement and quality in object-oriented design,” IEEE Int. Conf. Softw. Maintenance, ICSM, vol. 2005, pp. 701–704, 2005.
[21] N. Moha and Y. Guéhéneuc, “DECOR: A method for the specification and detection of code and design smells,” IEEE Trans. Softw. Eng., vol. 36, no. 1, pp. 20–36, 2010.
[22] F. A. Fontana, M. Zanoni, A. Marino, and M. V. Mäntylä, “Code smell detection: Towards a machine learning-based approach,” IEEE Int. Conf. Softw. Maintenance, ICSM, pp. 396–399, 2013.
[23] U. Azadi, F. A. Fontana, and M. Zanoni, “Machine learning based code smell detection through WekaNose,” Proc. 40th Int. Conf. Softw. Eng. Companion Proceeedings - ICSE ’18, no. June, pp. 288–289, 2018.
[24] F. Arcelli Fontana and M. Zanoni, “Code smell severity classification using machine learning techniques,” Knowledge-Based Syst., vol. 128, pp. 43–58, 2017.
[25] R. Marinescu, “Detection strategies: Metrics-based rules for detecting design flaws,” in Software Maintenance, 2004. Proceedings. 20th IEEE International Conference on, 2004, pp. 350–359.
[26] R. Ab’ilio, J. Padilha, E. Figueiredo, and H. Costa, “Detecting Code Smells in Software Product Lines--An Exploratory Study,” in Information Technology-New Generations (ITNG), 2015 12th International Conference on, 2015, pp. 433–438.
[27] G. Suryanarayana, G. Samarthyam, and T. Sharma, Refactoring for software design smells: managing technical debt. Morgan Kaufmann, 2014.
[28] B. Baudry, Y. Le Traon, G. Sunyé, and J.-M. Jézéquel, “Measuring and improving design patterns testability,” in Proceedings of Metrics Symposium 2003, 2003.
[29] G. Langelier, H. Sahraoui, and P. Poulin, “Visualization-based analysis of quality for large-scale software systems,” in Proceedings of the 20th IEEE/ACM international Conference on Automated software engineering, 2005, pp. 214–223.
[30] E. Murphy-Hill and A. P. Black, “An interactive ambient visualization for code smells,” in Proceedings of the 5th international symposium on Software visualization, 2010, pp. 5–14.
[31] G. de F. Carneiro et al., “Identifying code smells with multiple concern views,” in Software Engineering (SBES), 2010 Brazilian Symposium on, 2010, pp. 128–137.
[32] J. Kreimer, “Adaptive detection of design flaws,” Electron. Notes Theor. Comput. Sci., vol. 141, no. 4, pp. 117–136, 2005.
[33] L. Amorim, E. Costa, N. Antunes, B. Fonseca, and M. Ribeiro, “Experience report: Evaluating the effectiveness of decision trees for detecting code smells,” in Software Reliability Engineering (ISSRE), 2015 IEEE 26th International Symposium on, 2015, pp. 261–269.
[34] F. Khomh, S. Vaucher, Y.-G. Guéhéneuc, and H. Sahraoui, “A bayesian approach for the detection of code and design smells,” in Quality Software, 2009. QSIC’09. 9th International Conference on, 2009, pp. 305–314.
[35] F. Khomh, S. Vaucher, Y.-G. Guéhéneuc, and H. Sahraoui, “BDTEX: A GQM-based Bayesian approach for the detection of antipatterns,” J. Syst. Softw., vol. 84, no. 4, pp. 559–572, 2011.
[36] E. Tempero et al., “The Qualitas Corpus: A curated collection of Java code for empirical studies,” in Software Engineering Conference (APSEC), 2010 17th Asia Pacific, 2010, pp. 336–345.
[37] A. J. Riel, Object-oriented design heuristics. Addison-Wesley Longman Publishing Co., Inc., 1996.
[38] M. A. Hall, “Correlation-based feature subset selection for machine learning,” Thesis Submitt. Partial fulfillment Requir. degree Dr. Philos. Univ. Waikato, 1998.
[39] D. W. Aha, D. Kibler, and M. K. Albert, “Instance-based learning algorithms,” Mach. Learn., vol. 6, no. 1, pp. 37–66, 1991.
[40] L. Rokach and O. Z. Maimon, Data mining with decision trees: theory and applications, vol. 69. World scientific, 2008.
[41] V. K. Gujare and P. Malviya, “Big Data Clustering Using Data Mining Technique,” vol. 5, no. 2, pp. 9–13, 2017.
[42] C. J. L. Chih Wei Hsu, Chih Chung Chang, “A Practical Guide to Support Vector Classification,” BJU Int., vol. 101, no. 1, pp. 1396–400, 2008.