Test hungry methods demand a high amount of unit/integration tests in order to cover all the execution paths, and this is especially important given the high usage of these methods.

Impact

Since many other methods or functions are dependent on test hungry methods, a change to this method will have an extensive impact.

Characteristics

  • The method / function has high complexity.
  • The method / function has high incoming dependencies.

Guidelines

  • All statements and branches in a test hungry method should be covered in unit testing.
  • If a a test hungry method has too many conditional branches, consider refactoring it into multiple small methods / functions.