Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

LinkedIn Learning

Practical Test-Driven Development for Java Programmers

via LinkedIn Learning

Overview

Prepare for a new career with $100 off Coursera Plus
Gear up for jobs in high-demand fields: data analytics, digital marketing, and more.
Learn the fundamentals of test-driven Java development. This hands-on course covers how to write tests for tricky scenarios, use mocking frameworks like Mockito, and more.

Syllabus

Introduction
  • Welcome
1. What Is Test-Driven Development?
  • What is test-driven development?
  • What do you want to test?
2. Introducing JUnit
  • The case study
  • Set up instructions for IntelliJ users
  • Setting up the project structure
  • JUnit basics
3. Writing Your First Tests
  • Examples and outcomes
  • Getting to red
  • Getting to green
  • Why you always start with red
  • Adding more tests
  • Understanding the business logic
  • Finally writing some code
4. Practicing the Basics
  • Testing for exceptions
  • Challenge 1
  • Walkthrough 1
  • Challenge 2
  • Walkthrough 2 and challenge 3
  • Walkthrough 3
  • Getting to more complex requirements
  • Using TDD to safely fix bugs
  • Challenge 4 and walkthrough 4
  • Finishing the business requirements
5. Refactoring
  • Introducing refactoring
  • Restructuring code
6. Best Practices
  • Good and bad tests
  • JUnit asserts
7. Stubs
  • Testing code with dependencies
  • Building an example
  • Creating the stub
8. Mocking with Mockito
  • Why mocks are useful
  • Creating a mock
  • Testing behaviour
  • Mockito syntax options
9. Fakes and Tautologies
  • Reviewing fakes and tautologies
  • Challenge 5
  • Walkthrough 5
  • Using setUp and tearDown
  • Tautologies
  • How to avoid tautologies
10. Handling Legacy Code
  • Loading up the final case study
  • Understanding the project structure
  • Understanding the business logic
  • Adding Mockito
  • Setting up the tests
  • The need for spying
  • Challenge 6
  • Walkthrough 6, part 1
  • Walkthrough 6, part 2

Taught by

Matt Greencroft

Reviews

4.6 rating at LinkedIn Learning based on 128 ratings

Start your review of Practical Test-Driven Development for Java Programmers

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.