Advertisement

To Improve Code Structure by Identifying Move Method Opportunities Using Frequent Usage Patterns in Source-Code

  • Randeep SinghEmail author
  • Ashok Kumar
Conference paper
Part of the Communications in Computer and Information Science book series (CCIS, volume 955)

Abstract

A smelly code is generally an indication of the poor quality of the software and it increases the understandability and maintenance efforts at the software programmer’s end. One technique to improve the quality is refactoring. Therefore, in this paper, we have identified the Feature Envy code smell and applied the corresponding Move Method refactoring. The code smell is tackled using the Frequent Usage Patterns (FUP’s) present in the source-code of the software. The FUP’s are identified at the method level and theyrepresent the set of member variables that are used by it either directly or indirectly. The identified FUP data is further used to cluster different methods using a newly proposed Clustering algorithm. Moreover, the proposed approach is successfully tested and evaluated on three standard open-source object-oriented software. The obtained results after evaluation confirm the ability of our proposed approach in enhancing the quality of the underlying software system.

Keywords

Code smell Feature Envy Move method refactoring Quality Cohesion Frequent usage patterns Hierarchical clustering 

References

  1. 1.
    Fuggetta, A.: Software process: a roadmap. In: Proceedings Conference on the Future of Software Engineering, Limerick, Ireland, pp. 25–34 (2000)Google Scholar
  2. 2.
    Fowler, M., Beck, K., Brant, J., Opdyke, W., Roberts, D.: Refactoring: Improving the Design of Existing Code. Addison Wesley, Boston (1999)Google Scholar
  3. 3.
    D’Ambros, M., Bacchelli, A., Lanza, M.: On the impact of design flaws on software defects. In: 10th International Conference on Quality Software (QSIC), pp. 23–31 (2010)Google Scholar
  4. 4.
    Sjoberg, D.I., Yamashita, A., Anda, B., Mockus, A., Dyba, T.: Quantifying the effect of code smells on maintenance effort. IEEE Trans. Softw. Eng. 39(8), 1144–1156 (2013)CrossRefGoogle Scholar
  5. 5.
    Counsell, S., Hamza, H., Hierons, R.M.: An Empirical investigation of code smell ‘deception’ and research contextualization through Paul’s criteria. J. Comput. Inf. Technol.-CIT 18 4, 333–340 (2010)CrossRefGoogle Scholar
  6. 6.
    Khomh, F., Penta, M.D., Guéhéneuc, Y.: An exploratory study of the impact of code smells on software change proneness. In: Proceedings of the 16th Working Conference on Reverse Engineering (WCRE), 13–16 October. IEEE Computer Society Press, Lille (2009)Google Scholar
  7. 7.
    Chatzigeorgiou, A., Manakos, A.: Investigating the evolution of bad smells in object-oriented code. In: 7th International Conference on Quality of Information and Communications Technology (QUATIC), pp. 106–115 (2010)Google Scholar
  8. 8.
    Bansiya, J., Davis, C.G.: A hierarchical model for object-oriented design quality assessment. IEEE Trans. Softw. Eng. 28(1), 4–17 (2002)CrossRefGoogle Scholar
  9. 9.
    Oliveto, R., Gethers, M., Bavota, G., Poshyvanyk, D., Lucia, A. De.: Identifying method friendships to remove the feature envy bad smell. In: 33rd International Conference on Software Engineering (ICSE), pp. 820–823 (2011)Google Scholar
  10. 10.
    Chang, J., Blei, D.: Hierarchical relational models for document networks. Ann. Appl. Stat. 4, 124–150 (2010)MathSciNetCrossRefGoogle Scholar
  11. 11.
    Tsantalis, N., Chaikalis, T., Chatzigeorgiou, A.: JDeodorant: identification and removal of typechecking bad smells. In: Proceedings of CSMR, pp. 329–331 (2008)Google Scholar
  12. 12.
    Marinescu, C., Marinescu, R., Mihancea, P., Ratiu, D., Wettel, R.: iPlasma: an integrated platform for quality assessment of object-oriented design. In: Proceedings of 21st International Conference on Software Maintenance (ICSM) (2005)Google Scholar
  13. 13.
  14. 14.
    Mitchell, B.S., Traverso, M., Mancoridis, S.: An architecture for distributing the computation of software clustering algorithms. In: Proceedings of the IEEE/IFIP Conference on Software Architecture (2001)Google Scholar
  15. 15.
    Rathee, A., Chhabra, J.K.: Improving cohesion of a software system by performing usage pattern-based clustering. In: International Conference on Smart Computing and Communication (ICSCC), vol. 125, pp. 740–746. Elsevier (2018). Proc. Comput. Sci.Google Scholar
  16. 16.
    Palomba, F., Bavota, G., Penta, M.D., Fasano, F., Oliveto, R., Lucia, A.D.: A large-scale empirical study on the lifecycle of code smell co-occurrences. Inf. Softw. Technol. 99, 1–10 (2018)CrossRefGoogle Scholar
  17. 17.
    Taibi, D., Janes, A., Lenarduzzi, V.: How developers perceive smells in source code: a replicated study. Inf. Softw. Technol. 92, 223–235 (2017)CrossRefGoogle Scholar
  18. 18.
    Singh, S., Kaur, S.: A systematic literature review: refactoring for disclosing code smells in object oriented software. Ain Shams Eng. J. (2017, in press)Google Scholar

Copyright information

© Springer Nature Singapore Pte Ltd. 2019

Authors and Affiliations

  1. 1.Department of Computer Science and EngineeringMaharishi Markandeshwar UniversityMullana-AmbalaIndia

Personalised recommendations