Choosing the next functionality to test

Now that you know how to structure a test properly, you still might feel a bit insecure about what to test, where to start, how to continue, and how to know when you are done. What follows will be a few heuristics to help you in mastering these hurdles.

Start with the happy path

Meszaros defines the happy path as the normal path of execution through a use case or the software that implements it; also known as the sunny day scenario. Nothing goes wrong, nothing out of the ordinary happens, and we swiftly and directly achieve the user's or caller's goal, [MESZ07]. Regarding the addition of an item to our timeline functionality, the happy path is made up of an item that gets sorted into a list of existing items, ...

Get Testing with JUnit 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.