by Chance Smith
Incase you haven’t heard we first we need to talk about what Test Driven Development (TDD) is.
It’s a seemingly simple workflow. you just write tests first and then write code that passes your tests. Just one at a time. Yeah, sounds nuts. So dumb, right?! Let me explain the steps…
- RED: Write a failing test
- GREEN: Write just enough production code to past that test
- REFACTOR: Refactor any of your code without failing a test. Stay green.
These steps are all thanks to Kent Beck and Uncle Bob. Go read their books. Back to TDD…
This is a simple but challenging process. You will struggle, but with much software enegineering maturity you will get better at this. Start now. Worry about doing it wrong later.
Why you need TDD
Let’s list the ways:
- less browser refreshing, because your tests are testing that part of the code for you
- run your code less, because your tests are testing that part of the code for you
- let the failing tests show you what to go fix or add next
- refactor or abstract anything you want, just keep the green lights on
How do I start writing tests?
Here is a collection of testing videos that our team found helpful to get us started.
Go write some tests
I’m going to say it again…
Start now. Worry about doing it wrong later.
Need help getting started
Did this help or save you time?
Reward me with a ☕️❤️.