4.35 out of 5
4.35
384 reviews on Udemy

Practical Test Driven Development for Java Programmers

A truly practical approach to the fundamentals of test driven development in Java, featuring JUnit and Mockito,
Instructor:
Matt Greencroft
2,438 students enrolled
English [Auto-generated]
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

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 has been written using Java 8 and JUnit4.  If you use Java 9 or above then by default you’ll get offered JUnit5. You’ll be able to follow along with the course as all the theory is still perfectly valid, however there are some small syntax changes between JUnit4 and JUnit5. If you’re not sure, check the Q&A for this course where you’ll find the answers to these. I’ll be adding some extra lectures to this course to cover the differences with the newer versions of Java/Junit very soon!

Chapter 1 - Introduction

1
Introducing TDD
2
What will we test?
3
How to get support while you're taking this course

Chapter 2 - JUnit

1
Introducing our first example project
2
Using the IntelliJ IDE

In this course I use the Eclipse IDE, but if you're using IntelliJ this video will show you how to use JUnit in your IDE

3
Creating a project structure for test cases
4
JUnit Basics

Chapter 3 - First tests

1
Thinking about examples and outcomes
2
Step 1 - getting to red
3
Step 2 - getting to green
4
Why you must always start with a failing test!
5
Adding more tests
6
Finally writing some code

Chapter 4 - Practising the basics

1
Testing for exceptions - and challenge number 1
2
Challenge 2 - writing a test
3
Solution to challenge 2
4
Getting to more complex requirements and finding hidden bugs
5
Challenge 3 - Adding further business requirements

Chapter 5 - Refactoring

1
Getting started with refactoring - extracting constants
2
More refactoring - restructuring our code

Chapter 6 - Best Practices

1
What is a good or bad test?
2
JUnit Asserts

Chapter 7 - Stubs

1
The challenge of testing code that has dependencies
2
Creating a test stub using just Java

Chapter 8 - Mocks and Mockito

1
Why we want to test behaviour as well as logic
2
Setting up Mockito and creating a mock
3
Using mocks to test behaviour
4
Mockito syntax options

Chapter 9 - Fakes and Tautologies

1
What are Fakes or Dummies
2
Practical exercise - using Mockito to create a stub
3
Refactoring our tests - using setup and teardown
4
How to avoid tautologies

Chapter 10 - Handling legacy code

1
Loading up the case study
2
Understanding the challenge part 1
3
Understanding the challenge part 2
4
Using a Spy
5
Practical exercise - finding the fault in the business logic

Goodbye!

1
Bonus lecture - links to other courses
You can view and review the lecture materials indefinitely, like an on-demand channel.
Definitely! If you have an internet connection, courses on Udemy are available on any device at any time. If you don't have an internet connection, some instructors also let their students download course lectures. That's up to the instructor though, so make sure you get on their good side!
4.4
4.4 out of 5
384 Ratings

Detailed Rating

Stars 5
171
Stars 4
175
Stars 3
32
Stars 2
5
Stars 1
1
2596a792981c13a00fa894e487e9c708
30-Day Money-Back Guarantee

Includes

4 hours on-demand video
1 article
Full lifetime access
Access on mobile and TV
Certificate of Completion