This is the code repository for Test-Driven Development with Java, published by Packt.
Create higher-quality software by writing tests first with SOLID and hexagonal architecture
Test-driven development enables developers to craft well-designed code and prevent defects. It’s a simple yet powerful tool that helps you focus on your code design, while automatically checking that your code works correctly. Mastering TDD will enable you to effectively utilize design patterns and become a proficient software architect.
This book covers the following exciting features:
- Discover how to write effective test cases in Java
- Explore how TDD can be incorporated into crafting software
- Find out how to write reusable and robust code in Java
- Uncover common myths about TDD and understand its effectiveness
- Understand the accurate rhythm of implementing TDD
- Get to grips with the process of refactoring and see how it affects the TDD process
If you feel this book is for you, get your copy today!
All of the code is organized into folders. For example, Chapter08.
The code will look like the following:
public class DiceRoll {
private final int NUMBER_OF_SIDES = 6;
private final RandomGenerator rnd =
RandomGenerator.getDefault();
Following is what you need for this book: This book is for expert Java developers and software architects crafting high-quality software in Java. Test-Driven Development with Java can be picked up by anyone with a strong working experience in Java who is planning to use Test-driven development for their upcoming projects.
With the following software and hardware list you can run all code files present in the book (Chapter 1-15).
Chapter | Software required | OS required |
---|---|---|
1-15 | Amazon Corretto JDK 17 LTS | Windows, Mac OS X, and Linux (Any) |
1-15 | IntelliJ IDEA 2022.1.3 Community Edition | Windows, Mac OS X, and Linux (Any) |
1-15 | JUnit 5 | Windows, Mac OS X, and Linux (Any) |
1-15 | AssertJ | Windows, Mac OS X, and Linux (Any) |
1-15 | Mockito | Windows, Mac OS X, and Linux (Any) |
1-15 | DBRider | Windows, Mac OS X, and Linux (Any) |
1-15 | Postgres | Windows, Mac OS X, and Linux (Any) |
1-15 | psql | Windows, Mac OS X, and Linux (Any) |
1-15 | Molecule | Windows, Mac OS X, and Linux (Any) |
1-15 | git | Windows, Mac OS X, and Linux (Any) |
We also provide a PDF file that has color images of the screenshots/diagrams used in this book. Click here to download it.
- Page 90 (Code Block 1, line 4): private void assertScoreForGuess(Score score, Letter… should be private void assertScoreForGuess( Score score, Letter… expectedScores )
Alan Mellor is an academy lead at BJSS, training the next generation of consulting software engineers, and the author of Java OOP Done Right: Create object-oriented code you can be proud of with modern Java. Alan started with a Sinclair ZX81 computer with 1K of RAM and is very happy to have better computers now. Alan’s work includes industrial control in C, web applications for e-commerce, gaming, and banking in Java and Go, and document warehousing in C++. His most visible code is part of Nokia Bounce and the RAF Red Arrows flight simulator if you go back far enough.
If you have already purchased a print or Kindle version of this book, you can get a DRM-free PDF version at no cost.
Simply click on the link to claim your free PDF.