Chapter 1 - Introduction
  • Introducing TDD
  • What will we test?
  • How to get support while you're taking this course
Chapter 2 - JUnit
  • Introducing our first example project
  • Using the IntelliJ IDE
  • Creating a project structure for test cases
  • JUnit Basics
Chapter 3 - First tests
  • Thinking about examples and outcomes
  • Step 1 - getting to red
  • Step 2 - getting to green
  • Why you must always start with a failing test!
  • Adding more tests
  • Finally writing some code
Chapter 4 - Practising the basics
  • Testing for exceptions - and challenge number 1
  • Challenge 2 - writing a test
  • Solution to challenge 2
  • Getting to more complex requirements and finding hidden bugs
  • Challenge 3 - Adding further business requirements
Chapter 5 - Refactoring
  • Getting started with refactoring - extracting constants
  • More refactoring - restructuring our code
Chapter 6 - Best Practices
  • What is a good or bad test?
  • JUnit Asserts
Chapter 7 - Stubs
  • The challenge of testing code that has dependencies
  • Creating a test stub using just Java
Chapter 8 - Mocks and Mockito
  • Why we want to test behaviour as well as logic
  • Setting up Mockito and creating a mock
  • Using mocks to test behaviour
  • Mockito syntax options
Chapter 9 - Fakes and Tautologies
  • What are Fakes or Dummies
  • Practical exercise - using Mockito to create a stub
  • Refactoring our tests - using setup and teardown
  • How to avoid tautologies
Chapter 10 - Handling legacy code
  • Loading up the case study
  • Understanding the challenge part 1
  • Understanding the challenge part 2
  • Using a Spy
  • Practical exercise - finding the fault in the business logic
Goodbye!
  • Bonus lecture