1 Preprint: D. Taibi, V. Lenarduzzi. “On the Definition of Microservice Bad Smells” IEEE Software. Vol 35, Issue 3, May/June 2018 On the Definition of Microservice Bad Smells Davide Taibi and Valentina Lenarduzzi, Tampere University of Technology Abstract: Code smells and architectural smells (also called bad smells) are symptoms of poor design that can hinder code understandability and decrease maintainability. Several bad smells have been defined in the literature for both generic architectures and specific architectures. However, cloud-native applications based on microservices can be affected by other types of issues. In order to identify a set of microservice-specific bad smells, researchers collected evidence of bad practices by interviewing 72 developers with experience in developing systems based on microservices. Then, they classified the bad practices into a catalog of 11 microservice-specific bad smells frequently considered harmful by practitioners. The results can be used by practitioners and researchers as a guideline to avoid experiencing the same difficult situations in the systems they develop. Keywords: microservice, antipattern, anti-pattern, code smell, architectural smell, bad smell, cloud computing, software development, software engineering Microservices are currently enjoying increasing popularity and diffusion in industrial environments, being adopted by several big players such as Amazon, LinkedIn, Netflix, and SoundCloud. Microservices are relatively small and autonomous services that work together, are modeled around a business capability, and have a single and clearly defined purpose. 1,2 Microservices enable independent deployment, allowing small teams to work on separated and focused services by using the most suitable technologies for their job that can be deployed and scaled independently. 1,2 Microservices are a newly developed architectural style. Several patterns and platforms such as nginx (www.nginx.org) and Kubernetes (kubernetes.io) exist on the market. During the migration process, practitioners often face common problems, which are due mainly to their lack of knowledge regarding bad practices and patterns. 3,4 In this article, we provide a catalog of bad smells that are specific to systems developed using a microservice architectural style, together with possible solutions to overcome these smells. To produce this catalog, we surveyed and interviewed 72 experienced developers over the course of two years, focusing on bad practices they found during the development of microservice-based systems and on how they overcame them. We identified a catalog of 11 microservice-specific bad smells by applying an open and selective coding 5 procedure to derive the smell catalog from the practitioners’ answers. The goal of this work is to help practitioners avoid these bad practices altogether or deal with them more efficiently when developing or migrating monoliths to microservice-based systems. As with code and architectural smells, which are patterns commonly considered symptoms of bad design, 1,6 we define microservice-specific bad smells (called “microservice smells” hereafter) as indicators of situations—such as undesired patterns, antipatterns, or bad practices—that negatively affect software quality attributes such as understandability, testability, extensibility, reusability, and maintainability of the system under development. Background Several generic architectural-smell detection tools and practices have been defined in the past years. 7–9 Moreover, several microservice-specific architectural patterns have been defined. 10 However, to the best of our knowledge, no peer-reviewed work and, in particular, no empirical studies have proposed bad practices, antipatterns, or smells specifically concerning microservices. However, some practitioners have started to discuss bad practices in microservices. In his ebook Microservices AntiPatterns and Pitfalls, Mark Richards introduced three main pitfalls: Timeout, I Was Taught to Share, and Static Contract Pitfall. 11 Moreover, in the past two years, practitioners have given technical talks about bad practices they experienced when building microservices. In Table 1, we summarize the main bad practices presented in these works. Unlike these works, we identified a set of microservice smells based on bad practices reported by 72 participants. Later, we map our set of microservice smells to the bad practices identified in Table 1.