Existing techniques for detecting code smells (indicators of source code problems) do not consider the current context, which renders them unsuitable for developers who have a specific context, such as modules within their focus. Consequently, the developers must spend time identifying relevant smells. We propose a technique to prioritize code smells using the developers' context. Explicit data of the context are obtained using a list of issues extracted from an issue tracking system. We applied impact analysis to the list of issues and used the results to specify the context-relevant smells. Results show that our approach can provide developers with a list of prioritized code smells related to their current context. We conducted several empirical studies to investigate the characteristics of our technique and factors that might affect the ranking quality.Additionally, we conducted a controlled experiment with professional developers to evaluate our technique. The results demonstrate the effectiveness of our technique.
KEYWORDScode smell, impact analysis, issue tracking system, prefactoring
INTRODUCTIONCode smell, as defined by Fowler, 1-3 is an indicator of design flaws or problems in the source code. Code smells of many types are summarized as smell catalogs. [1][2][3] Code elements that are affected by code smells are recommended for improved quality because they are likely to cause difficulties in the future, as discussed in the literature, eg, making the source code more difficult to understand and maintain or increasing code components' fault-proneness. Moreover, Yamashita et al 4 found that code smells can affect important maintainability aspects. Hermans and Aivaloglou 5 conducted a controlled experiment, which revealed that code smells influence the block-based programming performance of novice programmers.Developers can improve the code by removing the code smells from the elements.Many researchers have examined factors that can introduce code smells into the system. Tufano et al 6 conducted a large-scale empirical study, which revealed that the main activities that tend to introduce code smells are implementing features and enhancing existing ones. Moreover, they found that developers with high workloads and pressure are more likely to introduce a smelly code to the system. Vale et al 7 investigated the factors that can influence code smells based on a software developer's perspective. That investigation revealed that factors such as time pressure, bad design decisions, lack of business knowledge, inexperienced developers, little time for refactoring, and low priority assigned to software quality influence the severity of smelly codes.For issue-driven software development projects, development teams tend to adopt an issue tracking system such as Jira or Bugzilla to manage their lists of issues, so-called backlogs. Such issues can be anything related to software change requests, eg, bug fixing or feature implementation.Developers apply refactoring techniques to source codes before implementing changes ...