Search⌘ K
AI Features

Code Smells

Explore how to recognize code smells such as duplicated code and long parameter lists in Go test code. Learn why refactoring based on tests is crucial to maintain clean, understandable, and efficient code during test-driven development. Understand how improving test naming, parameter management, and assertions can enhance your TDD practice.

We'll cover the following...

Code smells

Code smells act as alarm bells in our code that can lead to inefficiencies or failures in the worst-case scenario. Usually, the root cause is a failure to follow programming best practices while coding the program. Every programming language establishes its coding rules and practices, but if we don’t follow them, we’ll likely find code smells. Examples of code smells are:

  • Duplicated code
  • Long methods
  • Long parameter list
...