I am beginning work on a personal project and I started writing unit/integration tests as one of the first steps. As I started, I realized this is the first project I am setting up from scratch and starting to write tests. (Other projects I have worked on I was brought in after the initial round of tests were already written. I simply needed to write new tests for new functionality we were adding.)
This lead me to think, how should I handle this? Should I write a bunch of tests, that I know will fail initially, and then go through and get them to pass? Or should I write one test, get it to pass, then write another test, get it to pass, and so on?
So, what do you think is the best way to handle this?
- Write a bunch of tests and then go through to make them pass?
- Write one test at a time and don't move on to writing another test until the current one passes?