Test Driven Development is a philosophy that says you should write tests first, then write the code to pass them.
In theory this will make it easier to avoid bugs and even easier to track down. This is certainly true if you are an experienced developer working on the a project who's architecture, team, and requirements will allow TDD. But not all projects are conducive to TDD, and it can take some time before you understand development well enough to integrate TDD into your work-flow.
What is undeniable is that learning TDD early on in your programming life will teach you strong habits like organized refactoring, thinking of code in terms of behavior not implementation, checking yourself early & often, and explaining your thought process.
In this project you will learn how to use TDD as an effective learning tool by completing and analyzing a minimum of 5 TDD Katas and organizing them into a gallery landing page as you did with JS 30 and CodeWars.
- Basic Functional Programming
This is a highly complex subject, you will learn more about it when we begin to study Statefull Frontend Applications. For now a basic understanding will be more than enough. Functional Programming is when you build your applications completely out of pure functions:
Pure Function: It's return value is determined exclusively by it's arguments.
Building applications entirely from pure functions is a good habit, but requires a high level of programming experience. You are encouraged to apply this paradigm as often as you can without over-complicating your projects.
TDD vs BDD
A quick & dirty analogy might go like this:
TDD ensures the walls won't crumble, BDD ensures the building matches the blueprints.
This project focuses entirely on TDD, we will discuss BDD later on in the Testing unit.
- Follow these guides to TDD & Functional Programming:
- Start building TDD Kata Repos. Just like with the Codewars project, you're never truly finished. This exercise will grow with you. Try to complete 3-4 per week. Each repo will have:
- Introduction to the problem
- Kata requirements explained in order, each linking to their markdowns
- Learning Notes
- Live gh-pages tests as in the CodeWars Repos.
- Completed, Refactored, Beautiful Solution.
- REQUIREMENT.md - one per requirement in your kata
- Describe this requirement. Explain how it builds on the last one.
- List each test case and what you did to pass it
- Include your passing code as a snippet
- Describe & include your refactored code as a snippet
- Request code reviews for each finished TDD repo.
A usual, build a gallery page to feature your Katas and put it up on your portfolio.
Lists of Katas:
- Three Rules of TDD
- Pure Functions, Easy Testing
- Why Unit Tests?
- Simplest Passing Functions
- This Takes Perseverance
- Testing Overview
- Comprehensive Guide
- The R.I.T.E. Way
- Pros & Cons
- Uncle Bob Speaks
Live, Online TDD: