Part 2. Different testing strategies

This part of the book reveals the various strategies and techniques used in testing. Here we take a more scientific and theoretical approach to explain the differences. We describe incorporating mock objects, or stubs, and dive into the details of in-container testing.

The first chapter of this part describes different techniques for improving the quality of your tests—measuring test coverage, practicing test-driven development, and writing testable code.

The sixth chapter of the book is dedicated to stubs. We look into another solution to isolate the environment and make our tests seamless.

The seventh chapter starts by explaining what mock objects are. We give a thorough overview of how to construct and use mock objects. We also give a real-world example showing not only where mock objects fit best but also how to benefit by integrating them with JUnit tests.

The last chapter describes a totally different technique: executing tests inside a container. This solution is different from the previous ones, and just like them it has its pros and cons. We start by presenting an overview of what in-container means and how it’s achieved, and at the end of the chapter we compare the mocks/stubs approach to the in-container approach. Along with the theoretical benefits, this chapter serves as a good starting point to understanding chapters 13 and 16.

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

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