Solving Advent of Code 2021 problems with Test Driven Development laws (learning).
TDD states to write tests beforehand and drive the production code from the tests. The three simple rules as Martin Fowler defines here are:
- Write a test for the next bit of functionality you want to add.
- Write the functional code until the test passes.
- Refactor both new and old code to make it well-structured.