In Episode 4 of Testing All The Things we continue to create the driving licence generator we started in the previous two videos. In this video we create a mock random number generator to create random digits to the end of the driving licence number.
In episode 2 of Testing All The Things we start to exploring Test Doubles. Test doubles are used to isolate the code under test from its dependencies. Test doubles imitate the functionality of a dependency.
Creating test doubles do not require the use of a mocking framework. In the following videos we will not use a mocking framework so we can concentrate of the theory.
In the first video we are looking at the simplest form of Test Double, Stubs.
In the first episode of Testing All The Things we introduce the concept of Test Driven Development (TDD). Using unit tests to guide the implementation of a Queue (Abstract Data Type)
During this episode we follow Uncle Bob’s three Rules of TDD
- You are not allowed to write any production code unless it is to make a failing unit test pass.
- You are not allowed to write any more of a unit test than is sufficient to fail; and compilation failures are failures.
- You are not allowed to write any more production code than is sufficient to pass the one failing unit test.
The GitHub repository for the code produced during this video can be found here.