Book Image

Testing with JUnit

By : Leonard Przybylski, Frank Appel
Book Image

Testing with JUnit

By: Leonard Przybylski, Frank Appel

Overview of this book

Table of Contents (16 chapters)
Testing with JUnit
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Summary


In this chapter, we've seen how collaborating components have an impact on our ability to write tests that run units shielded from the influences of other parts of a software system. We've learned how to use test doubles to isolate the components from real-world DOCs and hence, keep our tests fast, reliable, and maintainable.

To do so, you've been pointed first to the significance of indirect inputs and outputs. Once you understood this basic interaction principle between SUT and DOC, we went on with an in-depth discussion of the various double patterns available. In this context, you've been told about the intended use of dummy-, fake-, stub, spy, and mock stand-in types. After looking at the possibilities of mock frameworks and questioning their pros and cons, you experienced how generated doubles increase work efficiency in practice.

Finally, you learned about test helpers that, in contrast with doubles, do not collaborate with components under test, but rather decouple the test...