Intermediate
13h
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.
In this course, you will learn how to write a unit test for Java applications using JUnit. You'll start by covering unit-testing foundations, which provide you with a starter set of information about writing basic tests in JUnit. You’ll learn about JUnit organization and assertions, and you’ll pick up a few core quality practices for unit testing such as the Right BICEP and the CORRECT way.
Towards the end, the bigger design picture focuses on the relevance of design to unit testing and vice versa. You’ll refactor your tests, and you’ll learn how to use mock objects to deal with trouble-some dependencies.
In this course, you will learn how to write a unit test for Java applications using JUnit. You'll start by covering unit-testing...Show More
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
Learn how to effectively test Java applications using JUnit
Show more
Content
1.
Before We Begin
3 Lessons
Get familiar with pragmatic unit testing principles, JUnit practices, and their benefits.
2.
JUnit Test Foundations
8 Lessons
Get started with foundational JUnit concepts, writing unit tests, and maintaining test clarity.
3.
Digging Deeper into JUnit Assertions
9 Lessons
Break apart critical JUnit assertions, styles, decorators, floating-point comparisons, and exception handling techniques.
4.
Organizing Your Tests
8 Lessons
Break down complex ideas for organizing and optimizing unit tests in JUnit.
5.
Mastering Manic Mnemonics!
7 Lessons
Deepen your knowledge of the FIRST principles to enhance unit test effectiveness and reliability.
6.
What to Test: The Right-BICEP
8 Lessons
Investigate the Right-BICEP technique for structured unit testing, focusing on correctness, boundaries, inverses, cross-checks, errors, and performance.
7.
Boundary Conditions: The CORRECT Way
8 Lessons
Piece together the parts of evaluating boundary conditions using the CORRECT acronym for thorough testing.
8.
The Bigger Design Picture
5 Lessons
Try out refactoring techniques to optimize code clarity and maintainability using JUnit tests.
9.
Bigger Design Issues
6 Lessons
Get started with applying SOLID principles, command-query separation, and optimizing test maintenance for better design.
10.
Using Mock Objects
7 Lessons
Break apart the use of mock objects to streamline and improve unit testing.
11.
Refactoring Tests
10 Lessons
Enhance your skills in refactoring tests to improve readability, maintainability, and effectiveness.
12.
The Bigger Unit-Testing Picture
10 Lessons
Dig deeper into Test-Driven Development, its cycle, incremental coding, refactoring, and effective test documentation.
13.
Testing Some Tough Stuff
6 Lessons
Tackle testing challenges in multithreaded code, application logic extraction, database testing, and mocking controllers.
14.
Testing on a Project
4 Lessons
Piece together the parts of unit testing, team standards, CI, and code coverage.
15.
Wrapping Up
1 Lessons
Get familiar with applying unit testing techniques in practice and continuously refining skills.
16.
Appendix - Setting up JUnit
2 Lessons
Unpack the core of setting up JUnit in IntelliJ IDEA and NetBeans.
Certificate of Completion
Showcase your accomplishment by sharing your certificate of completion.
Course Author:
Developed by MAANG Engineers
Trusted by 2.8 million developers working at companies
"These are high-quality courses. Trust me. I own around 10 and the price is worth it for the content quality. EducativeInc came at the right time in my career. I'm understanding topics better than with any book or online video tutorial I've done. Truly made for developers. Thanks"
Anthony Walker
@_webarchitect_
"Just finished my first full #ML course: Machine learning for Software Engineers from Educative, Inc. ... Highly recommend!"
Evan Dunbar
ML Engineer
"You guys are the gold standard of crash-courses... Narrow enough that it doesn't need years of study or a full blown book to get the gist, but broad enough that an afternoon of Googling doesn't cut it."
Software Developer
Carlos Matias La Borde
"I spend my days and nights on Educative. It is indispensable. It is such a unique and reader-friendly site"
Souvik Kundu
Front-end Developer
"Your courses are simply awesome, the depth they go into and the breadth of coverage is so good that I don't have to refer to 10 different websites looking for interview topics and content."
Vinay Krishnaiah
Software Developer
Hands-on Learning Powered by AI
See how Educative uses AI to make your learning more immersive than ever before.
AI Prompt
Code Feedback
Explain with AI
AI Code Mentor
Free Resources