Tech Blog

Test-Driven Development

March 8, 2015

Normally when you are making a program you go top to bottom. Think of how you are going to gode it, actaully write the code, write tests then refactor it. It is pretty straight forward.

Test-driven developement is a different development cycle that revolves around making the test first and writing code to past those tests. The first thing you do in this cycle is to add a test. Then you run the code, the test should fail at this point since we haven't writen any code to pass the test yet. Then you write some code. Run tests again. If the code still fails fix it, if it passes refactor your code. And then finally repeat the cycle.

This is designed so that you are teseting you code and making sure it works before you move to the next section of code. You break down a large program to a more manageble size.