International Journal of Information Technology and Computer Science(IJITCS)

ISSN: 2074-9007 (Print), ISSN: 2074-9015 (Online)

Published By: MECS Press

IJITCS Vol.9, No.6, Jun. 2017

Recommendation of Move Method Refactoring to Optimize Modularization Using Conceptual Similarity

Full Text (PDF, 834KB), PP.34-42

Views:80   Downloads:5


Md. Masudur Rahman, Md. Rayhanur Rahman, B M Mainul Hossain

Index Terms

Code Smell;Refactoring;Feature Envy;Move Method;Coupling;Cohesion;Conceptual Similarity


Placement of methods within classes is one of the most important design activities for any object oriented application to optimize software modularization. To enhance interactions among modularized components, recommendation of move method refactorings plays a significant role through grouping similar behaviors of methods. It is also used as a refactoring technique of feature envy code smell by placing methods into correct classes from incorrect ones. Due to this code smell and inefficient modularization, an application will be tightly coupled and loosely cohesive which reflect poor design. Hence development and maintenance effort, time and cost will be increased. Existing techniques deals with only non-static methods for refactoring the code smell and so are not generalized for all types of methods (static and non-static). This paper proposes an approach which recommends 'move method' refactoring to remove the code smell as well as enrich modularization. The approach is based on conceptual similarity (which can be referred as similar behavior of methods) between a source method and methods of target classes of an application. The conceptual similarity relies on both static and non-static entities (method calls and used attributes) which differ the paper from others. In addition, it compares the similarity of used entities by the source method with used entities by methods in probable target classes. The results of a preliminary empirical evaluation indicate that the proposed approach provides better results with average precision of 65% and recall of 63% after running it on five well-known open projects than JDeodorant tool (a popular eclipse plugin for refactorings).

Cite This Paper

Md. Masudur Rahman, Md. Rayhanur Rahman, B M Mainul Hossain,"Recommendation of Move Method Refactoring to Optimize Modularization Using Conceptual Similarity", International Journal of Information Technology and Computer Science(IJITCS), Vol.9, No.6, pp.34-42, 2017. DOI: 10.5815/ijitcs.2017.06.05


[1]F. Martin, B. Kent, and B. John, “Refactoring: improving the design of existing code,” Refactoring: Improving the Design of Existing Code, 1999. 

[2]S. Demeyer, S. Ducasse, and O. Nierstrasz, Object-oriented reengi- neering patterns.  Elsevier, 2002.  

[3]D.  Sjoberg, A.  Yamashita, B.  C.  D.  Anda, A.  Mockus, and T.  Dyba, “Quantifying the effect of code smells on maintenance effort,” Software Engineering, IEEE Transactions on, vol. 39, no. 8, pp. 1144– 1156, 2013.

[4]N. Fenton and J. Bieman, Software metrics: a rigorous and practical approach.  CRC Press, 2014.

[5]S. Sharma and S. Srinivasan, “A review of coupling and cohesion metrics in object oriented environment,” International Journal of Computer Science & Engineering Technology (IJCSET), vol. 4, no. 8, 2013.

[6]M. Fokaefs, N. Tsantalis, and A. Chatzigeorgiou, “Jdeodorant: Identi- fication and removal of feature envy bad smells,” in ICSM, pp. 519– 520, 2007.

[7]N. Tsantalis, T. Chaikalis, and A. Chatzigeorgiou, “Jdeodorant: Iden- tification and removal of type-checking bad smells,” in Software Maintenance and Reengineering, 2008. CSMR 2008. 12th European Conference on, pp. 329–331, IEEE, 2008.

[8]V. Sales, R. Terra, L. F. Miranda, and M. T. Valente, “Recommending move method refactorings using dependency sets.,” in WCRE, vol. 20, p. 13, 2013.

[9]R. Oliveto, M. Gethers, G. Bavota, D. Poshyvanyk, and A. De Lucia, “Identifying method friendships to remove the feature envy bad smell (nier track),” in Proceedings of the 33rd International Conference on Software Engineering, pp. 820–823, ACM,  2011.

[10]F. Palomba, G. Bavota, M. Di Penta, R. Oliveto, A. De Lucia, and D. Poshyvanyk, “Detecting bad smells in source code using change history information,” in Automated software engineering (ASE), 2013 IEEE/ACM 28th international conference on, pp. 268–278, IEEE, 2013.

[11]F. Palomba, G. Bavota, M. Di Penta, R. Oliveto, D. Poshyvanyk,   and A. De Lucia, “Mining version histories for detecting code smells,” IEEE Transactions on Software Engineering, vol. 41, no. 5, pp. 462– 489, 2015.

[12]R. Marinescu, G. Ganea, and I. Verebi, “incode: Continuous quality assessment and improvement,” in Software Maintenance and Reengi- neering (CSMR), 2010 14th European Conference on, pp. 274–275, IEEE, 2010.

[13]A. Hamid, M. Ilyas, M. Hummayun, and A. Nawaz, “A compara- tive study on code smell detection tools,” International Journal of Advanced Science and Technology, vol. 60, pp. 25–32,   2013.

[14]N. Tsantalis and A. Chatzigeorgiou, “Identification of move method refactoring opportunities,” IEEE Transactions on Software Engineer- ing, vol. 35, no. 3, pp. 347–367,   2009.

[15]S. Kimura, Y. Higo, H. Igaki, and S. Kusumoto, “Move code refactor- ing with dynamic analysis,” in Software Maintenance (ICSM), 2012 28th IEEE International Conference on, pp. 575–578, IEEE,    2012.

[16]C. Napoli, G. Pappalardo, and E. Tramontana, “Using modularity metrics to assist move method refactoring of large systems,” in Complex, Intelligent, and Software Intensive Systems (CISIS), 2013 Seventh International Conference on, pp. 529–534, IEEE, 2013.

[17] [Last Accessed: 15 March, 2016]

[18] [Last Accessed: 10 February, 2016]

[19] [Last Accessed: 10 November, 2015] 

[20]F. A. Fontana, M. V. Mika, M. Zanoni, and A. Marino. "Comparing and experimenting machine learning techniques for code smell detection." Empirical Software Engineering 21, no. 3 (2016): 1143-1191.

[21]A. Satter, A. S. Ami, and K. Sakib. "A Static Code Search Technique to Identify Dead Fields by Analyzing Usage of Setup Fields and Field Dependency in Test Code." CDUD 2016–The 3rd International Workshop on Concept Discovery in Unstructured Data. 2016.

[22]B. Isong, and O. Ekabua,"A Framework for Effective Object-Oriented Software Change Impact Analysis," International Journal of Information Technology and Computer Science (IJITCS), vol.7, no.4, pp.28-41, 2015.