Practical Test-Driven Development for Java Programmers
3h 51mIntermediate2018-10-25
Authors

Matt Greencroft
Matt Greencroft is a full-time trainer and software development consultant.
Course details
Learn how to use tests to drive the writing of your code, a key component of agile programming. More than just theory, this course covers a range of practical topics that can help Java developers get up and running with test-driven development (TDD). Instructor Matt Greencroft helps to acquaint you with the process that's required for TDD, as well as how to deal with real-world challenges you may encounter when carrying out TDD. Discover how to write your first test and determine what makes a good or bad test. Plus, learn how to test code where there's a dependency on third-party resources, how to create mocks and stubs with Mockito—a popular third-party library—and more.
Skills covered
EclipseSpringSoftware TestingJavaDevOps FoundationsOracleDevOpsPersonaProgramming LanguagesOpen SourceSoftware Development
Concepts
0. Introduction
- 01 - Welcome
1. What Is Test-Driven Development
- 02 - What is test-driven development
- 03 - What do you want to test
2. Introducing JUnit
- 04 - The case study
- 05 - Set up instructions for IntelliJ users
- 06 - Setting up the project structure
- 07 - JUnit basics
3. Writing Your First Tests
- 08 - Examples and outcomes
- 09 - Getting to red
- 10 - Getting to green
- 11 - Why you always start with red
- 12 - Adding more tests
- 13 - Understanding the business logic
- 14 - Finally writing some code
4. Practicing the Basics
- 15 - Testing for exceptions
- 16 - Challenge 1
- 17 - Walkthrough 1
- 18 - Challenge 2
- 19 - Walkthrough 2 and challenge 3
- 20 - Walkthrough 3
- 21 - Getting to more complex requirements
- 22 - Using TDD to safely fix bugs
- 23 - Challenge 4 and walkthrough 4
- 24 - Finishing the business requirements
5. Refactoring
- 25 - Introducing refactoring
- 26 - Restructuring code
6. Best Practices
- 27 - Good and bad tests
- 28 - JUnit asserts
7. Stubs
- 29 - Testing code with dependencies
- 30 - Building an example
- 31 - Creating the stub
8. Mocking with Mockito
- 32 - Why mocks are useful
- 33 - Creating a mock
- 34 - Testing behaviour
- 35 - Mockito syntax options
9. Fakes and Tautologies
- 36 - Reviewing fakes and tautologies
- 37 - Challenge 5
- 38 - Walkthrough 5
- 39 - Using setUp and tearDown
- 40 - Tautologies
- 41 - How to avoid tautologies
10. Handling Legacy Code
- 42 - Loading up the final case study
- 43 - Understanding the project structure
- 44 - Understanding the business logic
- 45 - Adding Mockito
- 46 - Setting up the tests
- 47 - The need for spying
- 48 - Challenge 6
- 49 - Walkthrough 6, part 1
- 50 - Walkthrough 6, part 2