Part 1. The building blocks

So you want to write tests with JUnit. Where do you begin?

This part of the book lays the groundwork for effectively using JUnit to design and test Java code. Once you understand and can apply these recipes to your work, you will have the foundation you need to write JUnit tests for any behavior you will ever need to implement—all such tests reduce to one or more of the recipes in the next several chapters. The challenge is to recognize these smaller, simpler patterns within the larger code and class structures you find in a typical, industrial-grade Java application. Before we tackle those larger problems, we first handle some smaller ones.

By the end of part 1 you will have seen over 60 essential JUnit techniques covering every aspect of testing: writing, organizing, building, and executing tests, plus managing their data and reporting their results. The recipes in parts 2 and 3 refer often to the recipes in part 1, so be prepared to return to this material often. Before long, the techniques they teach you will become very familiar to you.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset