Jump to ratings and reviews
Rate this book

Bad Tests, Good Tests

Rate this book
Nowadays, developers are expected to provide code verified by automated tests. This idea is deeply rooted in our software production process, and can be facilitated by a number of different tools. We must spend a considerable amount of time creating and maintaining tests.

The tests we write should verify some important parts of the system. They should exercise all important cases and document the way the software works. They are also expected to survive refactorings, and even redesigns, of the system.

Unfortunately, not all of the tests we write live up to these expectations. This book provides numerous examples of improvements you can introduce to make your tests stronger, more readable, and more resilient to changes. You’ll learn about real-life issues, and discover ways of overcoming them. You’ll get to know new techniques for writing high-quality tests.

The goal of this book is to teach you how to write tests in such a way that all the effort you put into them really pays off!

If you’ve had only limited experience with tests, then this book will help you avoid the dead ends and traps others have fallen victim to. Learning from your own mistakes is great, but learning from the mistakes of others even better!

If you are writing tests on a daily basis, then you’ll benefit especially from being able to compare your own approach to writing tests to those explored here. Seeing how others go about meeting the challenges involved is certainly one of the best ways of improving your own skills in the field.

120 pages, Kindle Edition

First published December 15, 2013

8 people are currently reading
68 people want to read

About the author

Tomek Kaczanowski

6 books7 followers

Ratings & Reviews

What do you think?
Rate this book

Friends & Following

Create a free account to discover what your friends think of this book!

Community Reviews

5 stars
22 (46%)
4 stars
18 (38%)
3 stars
3 (6%)
2 stars
4 (8%)
1 star
0 (0%)
Displaying 1 - 2 of 2 reviews
Profile Image for Цветозар.
464 reviews91 followers
October 24, 2025
Лично религиозно ползвам verifyNoMoreInteractions и забелязвам, че доста проблеми се решават с това, та има съвети, с които не съм съгласен. Също за безплатно-достъпния пдф бих очаквал да има поне цветове в стайлинга на кода, все пак не си го принтирам на хартия.
138 reviews2 followers
September 23, 2016
//polish
Jest to książka poświęcona dobrym praktykom w trakcie pisania testów w Java. Prezentowane testy są napisane głównie w JUnit i Mockito. Książka jest przeznaczona dla osób które mają jakieś podstawowe pojęcie o pisaniu testów w tych bibliotekach, ponieważ autor nie wyjaśnia podstaw tylko od razu przedstawia złe praktyki.

Cała książka opiera się na pokazywaniu przykładowych testów, które są napisane w brzydki sposób, omówieniu związanych z nimi problemów oraz pokazanie poprawionego testu. Autor omawia częste błędy popełniane podczas testów oraz promuje zasady czystego kodu.

Książka jest napisana w lekki sposób oraz jest krótka(niewiele ponad 100 stron). Autor chciał tą książką reklamować swoje inne książki o testach, więc udostępnił ją za darmo(chyba że ktoś chce wpłacić dobrowolnie). Książkę można pobrać na stronie wydawcy:
https://leanpub.com/zletestydobretesty

Jeśli programuje się już w Java i napisało się trochę testów, to wiele przykładów będzie bardzo oczywiste, jednak ze względu na krótkość oraz darmowość polecam każdemu programiście Javy. Dodatkowo dowiedziałem się, że istnieją takie biblioteki jak assertJ i JUnitParams, które na pewno wykorzystam w przyszłych testach.
Displaying 1 - 2 of 2 reviews

Can't find what you're looking for?

Get help and learn more about the design.