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
Conferences
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

Integrating code coverage reports


The last section will revisit and deepen the knowledge about the assets and drawbacks of code coverage. It'll conclude this book by showing you how to add coverage analysis to your CI build.

Enlarging on code coverage

Recall Chapter 2, Writing Well-structured Tests, and we know code coverage reports can be a useful tool to detect gaps of untested passages in our production classes. However, full coverage does not guarantee complete or even reasonable behavior verification. To substantiate these statements a bit more, let's take a look at a class highlighted with full coverage:

Full coverage

The preceding image shows the alleged pleasant case if full instruction and branch coverage has been reached. But it can't be stressed enough that full coverage alone testifies nothing about the quality of the underlying assertions!

The only reasonable conclusion to draw is that there are obviously no uncovered spots. In this sense, adding a single statement to a covered path...

lock icon The rest of the chapter is locked
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