# Automated Code-Smell Detection in Microservices Through Static Analysis: A Case Study
## 2 Related Work  
Although first defined by [PERSON] [4] as problems in code caused by poor design decisions, code smells have evolved in the world of modern software engineering to encompass much more. Code smells can be defined as \"_characteristics of the software that may indicate a code or design problem that can make software hard to evolve and maintain_\" [11]. Code smells are not necessarily a problem but rather an indicator of a problem. They can be seen as code structures that indicate a violation of fundamental design principles and negatively impact design quality [12]. Urgent maintenance activities prioritizing feature delivery over code quality often lead to code smells [13]. Thus, code smells are codebase anomalies and do not necessarily impact the performance or correct functionality; they are poor programming practice patterns. Code smells can affect a wide range of areas in a program, including reusability, testability, and maintainability. [PERSON] et al. [14] underlined that it is essential to identify and control code smells during the design and development stages to achieve higher code maintainability and quality. However, even if developers are not invested in fixing them, code smells do matter to the overall software maintainability [15; 16; 17]. Furthermore, if left unchecked, code smells can begin to impact the overall system's architecture [18]. Code smells can be deceptive and hide the true extent of their'smelliness' and even carry into further refactorings of the code [18; 19]. Frequently code smells are also related to anti-patterns [20] in an application. Code-smell correction is a necessary process for developers [21], but it is often pushed aside. A study by [PERSON] et al. [21] found that the most prevalent factor towards developers addressing code smells is the importance of the issue and the relevance of the issue to the task they were working on. Another study by [PERSON] et al. [22] found that, while developers are frequently aware of the code smells in their application, they do not care about actively fixing them. Most of the time, the code smells are fixed accidentally through unrelated code refactoring [4]. Much has been done in research to address the problem of code smells, and many studies have been performed, exploring how code smells are created [19], managed [23], and fixed in industry [24]. [PERSON] et al. [25] studied how developers discussed code smells in stack exchange sites and found that these sites work as an informal crowd-based code smell detector. Peers discuss the identification of smells and how to get rid of them in a specific given context. Thus, the question is how to detect and eliminate them in a given context. They found that the most popular smells discussed between developers are also shown to be most frequently covered by available code analysis tools. It is also noted that, while Java support is the broadest, other platforms, including C#, JavaScript, C++, Python, Ruby, and PHP, are lacking in support. Concerns were also raised that there is a missing classification for how harmful smells are on a given application. Some researchers would argue that developers do not have the time to fix all smells. For instance, [PERSON] et al. [14] identified 18 common code smells and the driving power of these code smells to improve the overall code maintainability. The effect is that developers could refactor one of the smellswith higher driving power, rather than address all smells in an application, and still significantly improve code maintainability. One of the first attempts at automatic code-smell detection came from [PERSON] and [PERSON] [26], who defined an automated code-smell detection tool for Java. Since then, the field of code-smell detection has continued to grow. Code smell tools have been developed for _high level design_[27; 28; 29], _architectural smells_[30; 31; 32], and _language-specific code smells_[33; 34; 35], measuring not just code smells but also the quality [14; 36] of the application.