Skip to main content

Improving the Identification of Code Smells by Combining Structural and Semantic Information

  • Conference paper
  • First Online:

Part of the book series: Communications in Computer and Information Science ((CCIS,volume 1142))

Abstract

In software engineering, a code smell is an indication of a deeper problem in the source code, hindering the maintainability and evolvability of the system. In the literature, there is a significant emphasis on the detection of code smells because of its importance as a maintenance task. Most of previous studies focus in their analyses on one source of information, i.e. structural, historical or semantic information. However, some instances of bad smells could be identified by a type of information but missed by another one. In this paper, we propose an improved detection approach that combines structural and semantic information in order to fully exploit their complementarity in the identification of code smells. Both information are extracted separately using conventional and deep learning methods. For the evaluation, we have selected five open source projects which are JHotDraw, Apache Karaf, Freemind, Apache Nutch and JEdit. In order to optimize our performance results, we have set up four different experiments and compare between them. The obtained accuracy results confirm the effectiveness of combining structural and semantic information in improving the detection of code smells.

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

Buying options

Chapter
USD   29.95
Price excludes VAT (USA)
  • Available as PDF
  • Read on any device
  • Instant download
  • Own it forever
eBook
USD   84.99
Price excludes VAT (USA)
  • Available as EPUB and PDF
  • Read on any device
  • Instant download
  • Own it forever
Softcover Book
USD   109.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

Learn about institutional subscriptions

Notes

  1. 1.

    https://github.com.

  2. 2.

    https://sourceforge.net.

References

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

    Article  Google Scholar 

  2. Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Pearson Education India (1999)

    Google Scholar 

  3. Fu, S., Shen, B.: Code bad smell detection through evolutionary data mining. In: Symposium on Empirical Engineering and Measurement, pp. 1–9 (2015)

    Google Scholar 

  4. Hadj-Kacem, M., Bouassida, N.: A hybrid approach to detect code smells using deep learning. In: International Conference on Evaluation of Novel Approaches to Software Engineering, pp. 137–146 (2018)

    Google Scholar 

  5. Hadj-Kacem, M., Bouassida, N.: Towards a taxonomy of bad smells detection approaches. In: International Conference on Software Technologies, pp. 164–175. SciTePress (2018)

    Google Scholar 

  6. Hadj-Kacem, M., Bouassida, N.: Deep representation learning for code smells detection using variational auto-encoder. In: International Joint Conference on Neural Networks. IEEE (2019)

    Google Scholar 

  7. Kingma, D.P., Welling, M.: Auto-encoding variational bayes. arXiv (2013)

    Google Scholar 

  8. Kwak, N., Choi, C.-H.: Input feature selection for classification problems. IEEE Trans. Neural Netw. 13, 143–159 (2002)

    Article  Google Scholar 

  9. Liu, H., Xu, Z., Zou, Y.: Deep learning based feature envy detection. In: International Conference on Automated Software Engineering, pp. 385–396. ACM (2018)

    Google Scholar 

  10. Palomba, F., Bavota, G., Penta, M.D., Oliveto, R., Poshyvanyk, D., Lucia, A.D.: Mining version histories for detecting code smells. IEEE Trans. Softw. Eng. 41, 462–489 (2015)

    Article  Google Scholar 

  11. Palomba, F., Panichella, A., Lucia, A.D., Oliveto, R., Zaidman, A.: A textual-based technique for smell detection. In: International Conference on Program Comprehension, pp. 1–10. IEEE (2016)

    Google Scholar 

  12. Palomba, F.: Alternative sources of information for code smell detection: postcards from far away. In: International Conference on Software Maintenance and Evolution, pp. 636–640 (2016)

    Google Scholar 

  13. Palomba, F., Bavota, G., et al.: On the diffuseness and the impact on maintainability of code smells: a large scale empirical investigation. Empir. Softw. Eng. 23, 1188–1221 (2018)

    Article  Google Scholar 

  14. Palomba, F., Nucci, D.D., et al.: Landfill: an open dataset of code smells with public evaluation. In: Working Conference on Mining Software Repositories, pp. 482–485. IEEE (2015)

    Google Scholar 

  15. Palomba, F., Panichella, A., et al.: The scent of a smell: an extensive comparison between textual and structural smells. IEEE Trans. Softw. Eng. 44, 977–1000 (2018)

    Article  Google Scholar 

  16. Peng, H., Mou, L., Li, G., Liu, Y., Zhang, L., Jin, Z.: Building program vector representations for deep learning. In: Zhang, S., Wirsing, M., Zhang, Z. (eds.) KSEM 2015. LNCS (LNAI), vol. 9403, pp. 547–553. Springer, Cham (2015). https://doi.org/10.1007/978-3-319-25159-2_49

    Chapter  Google Scholar 

  17. Sauer, F., Boissier, G.: Eclipse metrics plugin 1.3.8. http://metrics2.sourceforge.net/

  18. Sharma, T., Spinellis, D.: A survey on software smells. J. Syst. Softw. 138, 158–173 (2018)

    Article  Google Scholar 

  19. Soh, Z., et al.: Do code smells impact the effort of different maintenance programming activities? In: International Conference on Software Analysis, Evolution, and Reengineering, pp. 393–402 (2016)

    Google Scholar 

  20. Tsantalis, N., Chatzigeorgiou, A.: Identification of move method refactoring opportunities. IEEE Trans. Softw. Eng. 35, 347–367 (2009)

    Article  Google Scholar 

  21. Tufano, M., Palomba, F., et al.: When and why your code starts to smell bad. In: International Conference on Software Engineering, pp. 403–414. IEEE (2015)

    Google Scholar 

  22. Wang, S., Liu, T., Tan, L.: Automatically learning semantic features for defect prediction. In: International Conference on Software Engineering, pp. 297–308 (2016)

    Google Scholar 

Download references

Author information

Authors and Affiliations

Authors

Corresponding author

Correspondence to Mouna Hadj-Kacem .

Editor information

Editors and Affiliations

Rights and permissions

Reprints and permissions

Copyright information

© 2019 Springer Nature Switzerland AG

About this paper

Check for updates. Verify currency and authenticity via CrossMark

Cite this paper

Hadj-Kacem, M., Bouassida, N. (2019). Improving the Identification of Code Smells by Combining Structural and Semantic Information. In: Gedeon, T., Wong, K., Lee, M. (eds) Neural Information Processing. ICONIP 2019. Communications in Computer and Information Science, vol 1142. Springer, Cham. https://doi.org/10.1007/978-3-030-36808-1_32

Download citation

  • DOI: https://doi.org/10.1007/978-3-030-36808-1_32

  • Published:

  • Publisher Name: Springer, Cham

  • Print ISBN: 978-3-030-36807-4

  • Online ISBN: 978-3-030-36808-1

  • eBook Packages: Computer ScienceComputer Science (R0)

Publish with us

Policies and ethics