Skip to main content

An Empirical Study on Predictability of Software Code Smell Using Deep Learning Models

  • Conference paper
  • First Online:
Advanced Information Networking and Applications (AINA 2021)

Abstract

Code Smell, similar to a bad smell, is a surface indication of something tainted but in terms of software writing practices. This metric is an indication of a deeper problem lies within the code and is associated with an issue which is prominent to experienced software developers with acceptable coding practices. Recent studies have often observed that codes having code smells are often prone to a higher probability of change in the software development cycle. In this paper, we developed code smell prediction models with the help of features extracted from source code to predict eight types of code smell. Our work also presents the application of data sampling techniques to handle class imbalance problem and feature selection techniques to find relevant feature sets. Previous studies had made use of techniques such as Naive Bayes and Random forest but had not explored deep learning methods to predict code smell. A total of 576 distinct Deep Learning models were trained using the features and datasets mentioned above. The study concluded that the deep learning models which used data from Synthetic Minority Oversampling Technique gave better results in terms of accuracy, AUC with the accuracy of some models improving from 88.47 to 96.84.

H. Gupta and T. G. Kulkarni—The work was done when authors were students in BITS Pilani, Hyderabad Campus.

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

Access this chapter

Chapter
USD 29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD 169.00
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD 219.99
Price excludes VAT (USA)
  • Compact, lightweight edition
  • Dispatched in 3 to 5 business days
  • Free shipping worldwide - see info

Tax calculation will be finalised at checkout

Purchases are for personal use only

Institutional subscriptions

References

  1. Azeem, M.I., Palomba, F., Shi, L., Wang, Q.: Machine learning techniques for code smell detection: a systematic literature review and meta-analysis. Inf. Softw. Technol. 108, 115–138 (2019)

    Article  Google Scholar 

  2. Yamashita, A., Moonen, L.: Do code smells reflect important maintainability aspects? In: 2012 28th IEEE International Conference on Software Maintenance (ICSM), pp. 306–315. IEEE (2012)

    Google Scholar 

  3. Khomh, F., Di Penta, M., Gueheneuc, Y.-G.: An exploratory study of the impact of code smells on software change-proneness. In: 2009 16th Working Conference on Reverse Engineering, pp. 75–84. IEEE (2009)

    Google Scholar 

  4. Hecht, G., Moha, N., Rouvoy, R.: An empirical study of the performance impacts of android code smells. In: Proceedings of the International Conference on Mobile Software Engineering and Systems, pp. 59–69 (2016)

    Google Scholar 

  5. Wilcoxon, F., Katti, S.K., Wilcox, R.A.: Critical values and probability levels for the Wilcoxon rank sum test and the Wilcoxon signed rank test. Sel. Tables Math. Stat. 1, 171–259 (1970)

    MATH  Google Scholar 

  6. Podobnik, B., Stanley, H.E.: Detrended cross-correlation analysis: a new method for analyzing two nonstationary time series. Phys. Rev. Lett. 100(8), 084102 (2008)

    Article  Google Scholar 

  7. He, H., Bai, Y., Garcia, E.A., Li, S.: ADASYN: adaptive synthetic sampling approach for imbalanced learning. In: 2008 IEEE International Joint Conference on Neural Networks (IEEE World Congress on Computational Intelligence), pp. 1322–1328. IEEE (2008)

    Google Scholar 

  8. Bowyer, K.W., Kegelmeyer, W.P., Chawla, N.V., Hall, L.O.: SMOTE : synthetic minority over-sampling technique. Technical report (2011)

    Google Scholar 

  9. Coleman, D., Ash, D., Lowther, B., Oman, P.: Using metrics to evaluate software system maintainability. Computer 27(8), 44–49 (1994)

    Article  Google Scholar 

  10. Wang, T., Li, W.: Naive bayes software defect prediction model. In: 2010 International Conference on Computational Intelligence and Software Engineering, pp. 1–4. IEEE (2010)

    Google Scholar 

  11. Turhan, B., Bener, A.B.: Software defect prediction: heuristics for weighted naïve bayes. In: ICSOFT (SE), pp. 244–249 (2007)

    Google Scholar 

  12. Fontana, F.A., Mäntylä, M.V., Zanoni, M., Marino, A.: Comparing and experimenting machine learning techniques for code smell detection. Empir. Softw. Eng. 21(3), 1143–1191 (2016)

    Article  Google Scholar 

  13. Abdi, L., Hashemi, S.: To combat multi-class imbalanced problems by means of over-sampling techniques. IEEE Trans. Knowl. Data Eng. 28(1), 238–251 (2015)

    Article  Google Scholar 

  14. Abd-El-Hafiz, S.K.: A metrics-based data mining approach for software clone detection. In: 2012 IEEE 36th Annual Computer Software and Applications Conference, pp. 35–41. IEEE (2012)

    Google Scholar 

  15. Harrison, R., Counsell, S.J., Nithi, R.V.: An evaluation of the mood set of object-oriented software metrics. IEEE Trans. Softw. Eng. 24(6), 491–496 (1998)

    Article  Google Scholar 

  16. Agarap, A.F.: Deep learning using rectified linear units (ReLU). arXiv preprint arXiv: 1803.08375 (2018)

  17. Wang, M., Lu, S., Zhu, D., Lin, J., Wang, Z.: A high-speed and low-complexity architecture for softmax function in deep learning. In: 2018 IEEE Asia Pacific Conference on Circuits and Systems (APCCAS), pp. 223–226. IEEE (2018)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Himanshu Gupta .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2021 The Author(s), under exclusive license to Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Gupta, H., Kulkarni, T.G., Kumar, L., Neti, L.B.M., Krishna, A. (2021). An Empirical Study on Predictability of Software Code Smell Using Deep Learning Models. In: Barolli, L., Woungang, I., Enokido, T. (eds) Advanced Information Networking and Applications. AINA 2021. Lecture Notes in Networks and Systems, vol 226. Springer, Cham. https://doi.org/10.1007/978-3-030-75075-6_10

Download citation

Publish with us

Policies and ethics