Practical Test Driven Development for Java Programmers

A truly practical approach to the fundamentals of test driven development in Java, featuring JUnit and Mockito,
Practical Test Driven Development for Java Programmers
File Size :
1.48 GB
Total length :
4h 3m



Matt Greencroft


Last update




Practical Test Driven Development for Java Programmers

What you’ll learn

Be able to confidently create software using Test Driven Development techniques.
Be able to use Mocking frameworks such as Mockito
Understand how to write tests for trickier scenarios
Using TDD techniques to fix applications which weren’t developed using TDD

Practical Test Driven Development for Java Programmers


Basic Java knowledge and at least some experience in programming. No experience of JUnit or writing tests is needed.


This course covers the fundamentals of test driven development for Java programmers… not just the theory, but how to use it in real world project examples. This includes mocking with Mockito. This includes some hands on exercises and how to deal with legacy code that doesn’t have tests in place. IMPORTANT NOTE ABOUT JAVA VERSIONS – This course covers JUnit4 and JUnit5 and is compatible with Java versions 7,8 and 11+.


Section 1: Chapter 1 – Introduction

Lecture 1 Introducing TDD

Lecture 2 What will we test?

Lecture 3 How to get support while you’re taking this course

Section 2: Chapter 2 – JUnit

Lecture 4 Introducing our first example project

Lecture 5 Using the IntelliJ IDE

Lecture 6 Creating a project structure for test cases

Lecture 7 JUnit Basics

Section 3: Chapter 3 – First tests

Lecture 8 Thinking about examples and outcomes

Lecture 9 Step 1 – getting to red

Lecture 10 Step 2 – getting to green

Lecture 11 Why you must always start with a failing test!

Lecture 12 Adding more tests

Lecture 13 Finally writing some code

Section 4: Chapter 4 – Practising the basics

Lecture 14 Testing for exceptions – and challenge number 1

Lecture 15 Challenge 2 – writing a test

Lecture 16 Solution to challenge 2

Lecture 17 Getting to more complex requirements and finding hidden bugs

Lecture 18 Challenge 3 – Adding further business requirements

Section 5: Chapter 5 – Refactoring

Lecture 19 Getting started with refactoring – extracting constants

Lecture 20 More refactoring – restructuring our code

Section 6: Chapter 6 – Best Practices

Lecture 21 What is a good or bad test?

Lecture 22 JUnit Asserts

Section 7: Chapter 7 – Stubs

Lecture 23 The challenge of testing code that has dependencies

Lecture 24 Creating a test stub using just Java

Section 8: Chapter 8 – Mocks and Mockito

Lecture 25 Why we want to test behaviour as well as logic

Lecture 26 Setting up Mockito and creating a mock

Lecture 27 Using mocks to test behaviour

Lecture 28 Mockito syntax options

Section 9: Chapter 9 – Fakes and Tautologies

Lecture 29 What are Fakes or Dummies

Lecture 30 Practical exercise – using Mockito to create a stub

Lecture 31 Refactoring our tests – using setup and teardown

Lecture 32 How to avoid tautologies

Section 10: Chapter 10 – Handling legacy code

Lecture 33 Loading up the case study

Lecture 34 Understanding the challenge part 1

Lecture 35 Understanding the challenge part 2

Lecture 36 Using a Spy

Lecture 37 Practical exercise – finding the fault in the business logic

Section 11: Goodbye!

Lecture 38 Bonus lecture

Experienced and more novice Java developers who want to switch to a more agile way of programming,Programmers who want to improve the way they approach test driven development

Course Information:

Udemy | English | 4h 3m | 1.48 GB
Created by: Matt Greencroft

You Can See More Courses in the Developer >> Greetings from

New Courses

Scroll to Top