Search icon CANCEL
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
Mastering Software Testing with JUnit 5

You're reading from   Mastering Software Testing with JUnit 5 Comprehensive guide to develop high quality Java applications

Arrow left icon
Product type Paperback
Published in Oct 2017
Publisher Packt
ISBN-13 9781787285736
Length 350 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Boni Garcia Boni Garcia
Author Profile Icon Boni Garcia
Boni Garcia
Arrow right icon
View More author details
Toc

Test anti-patterns

In software design, a pattern is a reusable solution to solve recurring problems. There are a bunch of them, including for example singleton, factory, builder, facade, proxy, decorator, or adapter, to name a few. Anti-patterns are also patterns, but undesirable ones. Concerning to testing, it is worth to know some of these anti-patterns to avoid them in our tests:

  • Second class citizens: Test code containing a lot of duplicated code, making it hard to maintain.
  • The free ride (also known as Piggyback): Instead of writing a new method to verify another feature/requirement, a new assertion is added to an existing test.
  • Happy path: It only verifies expected results without testing for boundaries and exceptions.
  • The local hero: A test dependent to some specific local environment. This anti-pattern can be summarized in the phrase It works in my machine.
  • The hidden...
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