*** Welcome to piglix ***

Code smells


Code smell, also known as bad smell, in computer programming code, refers to any symptom in the source code of a program that possibly indicates a deeper problem. According to Martin Fowler, "a code smell is a surface indication that usually corresponds to a deeper problem in the system". Another way to look at smells is with respect to principles and quality: "smells are certain structures in the code that indicate violation of fundamental design principles and negatively impact design quality". Code smells are usually not bugs—they are not technically incorrect and do not currently prevent the program from functioning. Instead, they indicate weaknesses in design that may be slowing down development or increasing the risk of bugs or failures in the future. Bad code smells can be an indicator of factors that contribute to technical debt.Robert C. Martin calls a list of code smells a "value system" for software craftsmanship.

Often the deeper problem hinted by a code smell can be uncovered when the code is subjected to a short feedback cycle where it is refactored in small, controlled steps, and the resulting design is examined to see if there are any further code smells that indicate the need of more refactoring. From the point of view of a programmer charged with performing refactoring, code smells are heuristics to indicate when to refactor, and what specific refactoring techniques to use. Thus, a code smell is a driver for refactoring.

A 2015 study utilizing automated analysis for half a million commits and the manual examination of 9,164 commits determined to exhibit "code smells" found that:

The term appears to have been coined by Kent Beck on in the late 1990s. Usage of the term increased after it was featured in Refactoring: Improving the Design of Existing Code.Code smell is also a term used by agile programmers.


...
Wikipedia

...