TDD Katas
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.
Index
Learning Objectives
- TDD
- Basic Functional Programming
TDD
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.
Specifications
- 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:
- README
- 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
- README
- 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.
Challenge:
Resources
Lists of Katas:
- Great:
- Easier:
- Harder:
TDD:
- 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
- Anti-TDD
- Uncle Bob Speaks
Live, Online TDD:
Pure Functions:
- Very Clear Video
- Article
- Article & Video, more advanced.
Challenge: