...

/

Pitching Tests at the Right Level

Pitching Tests at the Right Level

Discover the comparative advantages of detailed and high-level test methods.

Introduction

There are numerous best practices associated with unit testing. For example, one of these is to include one assertion per test if possible. However, other best practices are more subjective. One of these practices is how many test methods to write to determine whether the application code behaves as expected. One approach is to write as many test methods to explicitly test individual, desired behaviors. Another approach is to write fewer test methods that test the functionality as a whole. Although writing fewer test methods is more succinct, this approach comes with the disadvantage of rendering the test cases more difficult to follow. This reduces the effectiveness of the test code as a means of documentation. ...