Pragmatic Unit Testing in Java 8 with JUnit
Explore writing unit tests for Java applications using JUnit, delve into JUnit organization, assertions, quality practices, design relevance, refactoring, and using mock objects for dependencies.
Andy Hunt and Dave Thomas founded The Pragmatic Programmers, LLC., with a simple goal: to improve the lives of professional developers. We create timely, practical books and other learning resources on classic and cutting-edge topics to help you learn and practice your craft and accelerate your career. We are not a giant, faceless, greed-soaked corporation. We’re a small group of experienced professionals committed to helping make corporate software development—and your life—easier.
Join 3.1 million developers at
What You'll Learn
- Learn how to effectively test Java applications using JUnit
- Get to know the core quality principles of unit testing
- Master writing cleaner and refactored JUnit tests
Learning Roadmap
1.
Before We Begin
Before We Begin
2.
JUnit Test Foundations
JUnit Test Foundations
3.
Digging Deeper into JUnit Assertions
Digging Deeper into JUnit Assertions
9 Lessons
9 Lessons
4.
Organizing Your Tests
Organizing Your Tests
8 Lessons
8 Lessons
5.
Mastering Manic Mnemonics!
Mastering Manic Mnemonics!
7 Lessons
7 Lessons
6.
What to Test: The Right-BICEP
What to Test: The Right-BICEP
8 Lessons
8 Lessons
7.
Boundary Conditions: The CORRECT Way
Boundary Conditions: The CORRECT Way
8 Lessons
8 Lessons
8.
The Bigger Design Picture
The Bigger Design Picture
5 Lessons
5 Lessons
9.
Bigger Design Issues
Bigger Design Issues
6 Lessons
6 Lessons
10.
Using Mock Objects
Using Mock Objects
7 Lessons
7 Lessons
11.
Refactoring Tests
Refactoring Tests
10 Lessons
10 Lessons
12.
The Bigger Unit-Testing Picture
The Bigger Unit-Testing Picture
10 Lessons
10 Lessons
13.
Testing Some Tough Stuff
Testing Some Tough Stuff
6 Lessons
6 Lessons
14.
Testing on a Project
Testing on a Project
4 Lessons
4 Lessons
16.
Appendix - Setting up JUnit
Appendix - Setting up JUnit
2 Lessons
2 Lessons
The Pragmatic Programmers
We create timely, practical books and learning resources on classic and cutting-edge topics to help you practice your craft and accelerate your career.
Trusted by 3.1 million developers working at companies
Anthony Walker
@_webarchitect_
Evan Dunbar
ML Engineer
Software Developer
Carlos Matias La Borde
Souvik Kundu
Front-end Developer
Vinay Krishnaiah
Software Developer
Built for 10x Developers












Free Resources