
Explore the basics of test driven development in Java, learn the red, green, refactor cycle, and build a robust movie store interview question solution with a growing test suite.
Learn TDD in Java by creating a new Maven project in IntelliJ, using JUnit for tests, with an optional Gradle option and a movie store artifact version 1.0.
Explore a simple core Java movie store project to practice test-driven development, implementing a searchable movie collection with partial-title queries like 'Harry' without external dependencies.
Practice test driven development in Java by building a movie store and writing the does nothing test that returns zero results for a partial title search, using JUnit and Hamcrest.
Implement simplest production code to pass the failing test in a red-green-refactor TDD cycle, doing the minimum to satisfy empty list expectation and gaining rapid feedback as tests go green.
Practice red, green, refactor by copying the test to implement an add method and a partial title search that returns a movie; use hamcrest to assert results contain Harry Potter.
Add a simple list of movies and implement the minimal search to pass the test, returning the first partial title match.
Refine test coverage in Java by iterating tests for a case-insensitive, partial-match movie search that returns two results, containing Star Wars and Star Trek.
Master your IDE with shortcuts, quick refactoring, and efficient coding in Java TDD, as interviewers value fluent IDE handling over manual copy-paste and typing.
Use TDD to implement a Java solution by building a result list, adding movies, handling case insensitivity via uppercase titles, and returning the result to pass the tests.
Learn TDD in Java by embracing no nulls in internal systems, relying on comprehensive tests, and using for loops to ensure data accuracy without null checks.
Refactor tests by moving shared moviestore data into fields and a setup method, eliminating duplication and enabling a generated dataset for the upcoming search by director test.
Write a test for exact title matches, handle case sensitivity, and implement a find by director method in a Java TDD workflow.
Learn TDD in Java explores speeding refactoring by adding a second parameter with a default value, implementing a director method, and ensuring tests go green with concise, maintainable code.
Learn how to implement a release-year range finder in Java using TDD, handling edge cases and test-driven verification with 1999 to 2002 scenarios, including 2000 and 2001 releases.
Refactor after red and green by eliminating duplicated data initialization, condensing code, and pursuing an object-oriented solution instead of switch statements in test driven development.
Explore refactoring techniques in Java by introducing a predicate interface to encapsulate matching logic, pass movie conditions with anonymous inner classes, and extract a find by method while preserving tests.
Learn to upgrade Maven projects from Java 7 to Java 8, apply lambda expressions and anonymous functions for cleaner, inline code, and practice clear reasoning during interviews.
This course teaches Test Driven Development from the ground up using an example paired programming interview question. This interview question is taken from a real interview which I ran for several years and continues to be used in a number of institutions.
The interview is conducted as a TDD, pair-programming challenge. This is important to note. It was not the eventual solution that mattered so much as the journey there. Sometimes we would hire people who didn’t get the solution, and other times we wouldn’t hire people who did.
The Challenge
Implement a “movie store” (like blockbusters or Netflix). The store needs to hold a number of movies (let’s say a maximum of 100, but for our testing purposes 4 or 5 is sufficient). We need to be able to search the movie store for titles based on a number of different criteria.
Sounds pretty simple huh?
It’s amazing how many people it trips up though.
In the interview we would reveal each requirement one by one. As we’re doing TDD we’re building the requirements one at a time. Just like in the interview, I'll reveal each requirement one at a time.
The goals
The solution should have beautiful, clean code, without repetition or hacks. It should be code that you would be proud to have in production.
It should be well tested.
You do not need to worry about databases, threading, user interfaces, API access or 3rd party libraries. This a pure Java question.
You should be mindful about performance, but it’s not a major concern.
You should not over engineer the solution.
The solution
Don’t worry if you’ve never done TDD- I even teach you how to do TDD from the start.
This course is approximately an hour long and comes with all the code available to download.
The training is about much more than just coming up with a solution- we discuss many of the areas that candidates fall down in interview and how to avoid them.