Test negative cases first

What does it mean to test negative cases first? In many computer games, especially role-playing games, it is common for the game designers to make it very difficult to win the game if you simply go straight to the boss. Instead, you must make side quests, make wrong turns, and get lost in the story before you can fight the boss. Testing is no different. Before the problem can be solved, we must first handle bad input, prevent exceptions, and resolve conflicts in the business requirements.

In the Todo application, we mistakenly flew through and added an item to the Todo list without verifying that the item was valid. Now, the sprint is over and our user interface developers are mad at us because they do not know what ...

Get Practical Test-Driven Development using C# 7 now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.