Code smells (also known as bad smell when referred to software) are undesirable symptoms within the source code. Code smells are not problematic per se, but they can evidence some kind of issue nearby.
As described in previous sections, tests should be simple and easy to read. With that promises, code smells should be present in our tests under no circumstances. All in all, generic code smells might be avoided in our tests. Some of the most common code smells are the following:
- Duplicated code: Cloned code is always a bad idea in software, since it breaks the principle Don’t Repeat Yourself (DRY). This problem is even worst in tests, since test logic must be crystal clear.
- High complexity: Too many branches or loops may be potentially ...