IEEE Access (Jan 2023)

On the Assessment of Interactive Detection of Code Smells in Practice: A Controlled Experiment

  • Danyllo Albuquerque,
  • Everton Guimaraes,
  • Mirko Perkusich,
  • Thiago Rique,
  • Felipe Cunha,
  • Hyggo Almeida,
  • Angelo Perkusich

DOI
https://doi.org/10.1109/ACCESS.2023.3302260
Journal volume & issue
Vol. 11
pp. 84589 – 84606

Abstract

Read online

Code smells are structures in a program that often indicate the presence of deeper maintainability problems. Code smells should be detected as soon as they are introduced, enabling refactoring actions with less effort and time. Non-Interactive Detection (NID) techniques traditionally support code smells detection, enabling developers to reveal smells in later software program versions. NID techniques do not support developers’ progressive interaction with smelly code, revealing smells in the entire source code upon an explicit developer request, which might lead to the accumulation of code smells and, consequently, the degradation of software quality. Interactive Detection (ID) has emerged as a solution to overcome NID’s limitations. By revealing code smell as soon as they are introduced, developers can detect smell instances earlier, resulting in more effective refactoring actions and improved code quality. However, despite its promising potential, there is a lack of evidence regarding the ID impact on code smell detection and refactoring actions during coding analysis. Our research focused on evaluating the effectiveness of an ID technique in code smell detection. Besides, we analyzed the aid of an ID technique in performing effective refactoring actions during coding analysis. To this end, we conducted a controlled experiment with 16 subjects that underwent tasks related to detecting code smells and judging refactoring actions. The experimental tasks revealed that using the ID technique led to an increase of 60% in recall and up to 13% in precision when detecting code smells. Additionally, developers have effectively identified about 55% more code smells instances using the ID technique. Our study results revealed that using ID can improve the effectiveness of code smells detection, as developers can identify opportunities for refactoring actions earlier when compared to NID.

Keywords