Detecting and Managing Code Smells: Research and Practice

Code smells indicate the presence of quality problems that make the software hard to maintain and evolve. A software development team can keep their software maintainable by identifying smells and refactor them. In the first part of the session, we present a comprehensive overview of the literature concerning smells covering various dimensions of the metaphor including defining characteristics, classification, types, as well as causes and impacts of smells. In the second part, we delve into the details of smell detection methods prevailed currently both in research prototypes and industrial tools. The final part present actionable and pragmatic strategies for practitioners to avoid, detect, and eradicate smells from their codebase.


DESCRIPTION
Code smells [3,21,23] in a software system indicate the presence of quality problems that make the software hard to maintain and evolve. Smells not only impact maintainability [1,11,14,24], but also negatively affect other quality attributes such as reliability [2,5,6] and testability [15]. Given the importance of smells and their potential impact on software quality, software engineering researchers have explored smells and various dimensions associated with them in the great width and depth in the last two decades. Permission to make digital or hard copies of all or part of this work for personal or classroom use is granted without fee provided that copies are not made or distributed for profit or commercial advantage and that copies bear this notice and the full citation on the first page. Copyrights for components of this work owned by others than ACM must be honored. Abstracting with credit is permitted. To copy otherwise, or republish, to post on servers or to redistribute to lists, requires prior specific permission and/or a fee. Request permissions from permissions@acm.org. Identifying code smells automatically and refactoring them help software engineering practitioners to keep the software maintainable [3]. Therefore, the dimension of automatically identifying smells has enjoyed active interest by the research community and appreciated by the practitioners.
We divide our session into three parts. In the first part of the session, we present a comprehensive overview of the literature by covering various dimensions of the metaphor. We present defining characteristics of smells synthesized from a comprehensive set of definitions [20] discussed in the literature. These defining characteristics are indicator, poor solution, violates best practices, impacts quality, and recurrence. The smell metaphor has been extended to other similar domains such as configuration management [18], spreadsheets [4], and presentations [16]. We present a summary of the types of smells described in the literature in the form of a taxonomy 1 . Smell could cause from a wide variety of factors including lack of skill or awareness and frequently changing requirements; we discuss the curated set of ten such factors that cause smells. Further, we summarize the impact of smells on people, artifact, or on process.
In the second part, we delve into the details of smell detection methods prevailed currently both in research prototypes and industrial tools. Traditionally, smells are detected by metrics-based [9] and rule-based approaches [10]. History-based [13] and optimizationbased [12] approaches are alternatives that also have been employed by the community. In the recent times, machine-learning-based approaches [7] have been attempted to detect smells. We aim to present a synthesized overview of the current approaches. We touch upon the deficiencies in the current smell detection tools and techniques. These deficiencies include false-positives and lack of context, limited detection support for known smells, and inconsistent smell definitions and detection methods [21].
Additionally, we present the intricacies of developing a smell detection tool that we learned from developing Designite 2 [19], Puppeteer 3 [18], and DbDeo 4 [17]. Designite is software design quality assessment tool that detects smells at implementation, design, and architecture granularity. The tool also computes various object-oriented design metrics, detects code clones, prepares dsm (Dependency Structure Matrix), shows distribution of smells in the form of treemap, and performs trend analysis to help a software developer identify issues contributing to technical debt [8] and improve maintainability of the software. The tool offers free fullyfunctional academic licenses for all academic purposes. Currently, Keeping the software maintainable is a non-trivial challenge for software development teams given the real-life challenges (such as time pressure) [22]. The final part of the session deals with such challenges and present actionable and pragmatic strategies and practices for practitioners to avoid, detect, and eradicate smells from their codebase. These strategies focus on three major pillars of software development -people, process, and tools.
The session offers contributions to both research and practice. For researchers, it provides a comprehensive overview of the domain of code smells. Also, it reveals the intricacies of developing a smell detection tool. At the same time, practitioners can learn the potential quality issues that may arise in their codebase to avoid them. Furthermore, practitioners can apply pragmatic strategies planned in this session to identify, interpret, and refactor smells.

SPEAKER BIOGRAPHY
Tushar Sharma is a researcher at Athens University of Economics and Business, Athens, Greece. He has more than ten years of industrial work experience including seven years at Siemens Research and Technology Center, Bangalore, India. He earned an MS degree in Computer Science from the Indian Institute of Technology-Madras, Chennai, India, on the topic of design patterns and refactoring. He co-authored the book "Refactoring for Software Design Smells: Managing Technical Debt" published by Morgan Kaufmann in 2014. He has also co-authored two Oracle Java certification books. He has developed Designite which is a software design quality assessment tool; the tool is being used by many practitioners and researchers worldwide. He has delivered talks in many academic as well as developer conferences; he co-presented a tutorial titled "Software design quality in practice: Refactoring for software design smells" in ICSE 2014. He is an IEEE Senior Member.