Summary

In this chapter, we used TestNG as our testing framework of choice. There wasn't much difference when compared to JUnit, simply because we didn't use any of the more advanced features of TestNG (for example, data providers, factories, and so on). With TDD, it is questionable whether we'll ever have a need for those features.

Visit http://testng.org/, explore it, and decide for yourself which framework best suits your needs.

The main objective of this chapter was to learn how to focus on one unit at a time. We already had a lot of helper classes and we tried our best to ignore their internal workings. In many cases, we did not write specifications that verified that the end result was correct, but we checked whether the method we were working on invoked the correct method from those helper classes. In the real-world, you will be working on projects together with other team members, and it is important to learn how to focus on your tasks and trust that what others do works as expected. The same can be said for third-party libraries. It would be too expensive to test all inner processes that can happen when we invoke them. There are other types of tests that will try to cover those possibilities. When working with unit tests, the focus should only be on the unit we're currently working on.

Now that you have a better grasp of how to use unit tests effectively in the context of TDD, it is time to dive into some other advantages that TDD provides. Specifically, we'll explore how to design our applications better.

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

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