Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Testing with JUnit

You're reading from   Testing with JUnit Master high quality software development driven by unit tests

Arrow left icon
Product type Paperback
Published in Aug 2015
Publisher
ISBN-13 9781782166603
Length 200 pages
Edition 1st Edition
Tools
Arrow right icon
Authors (2):
Arrow left icon
Leonard Przybylski Leonard Przybylski
Author Profile Icon Leonard Przybylski
Leonard Przybylski
Frank Appel Frank Appel
Author Profile Icon Frank Appel
Frank Appel
Arrow right icon
View More author details
Toc

Summary

In this chapter, we've learned about the structure of a well-written unit test. We've got to know how to use the four phases, that is setup, exercise, verify, and teardown, to map a single test to a certain component behavior. We've addressed the different techniques to set up a test fixture efficiently and illustrated the relation of a behavior to its verification.

Once we were familiar with how to write a test, we've been concerned with what to test. We've understood why we should always start testing with happy-path scenarios and do the corner cases later on. Moreover, we've been introduced to how code coverage can help detect holes in our safety net.

In the last section, we've discussed the pros and cons of the various test naming conventions. We've learned about the difficulties to map behavior verification into a meaningful name, and showed some possibilities to reduce a test name to the essentials.

The next chapter will evolve our example...

You have been reading a chapter from
Testing with JUnit
Published in: Aug 2015
Publisher:
ISBN-13: 9781782166603
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image