Evidence of TDD in the Bible (Eph 1:4 NLT)

I read a scripture this morning which shows clear evidence that God practices some form of Test Driven Design. Bear with me as it may sound non-obvious or one huge stretch. Just read Ephesians 1:4 NLT where it says:

Even before he made the world, God loved us and chose us in Christ to be holy and without fault in his eyes.

The key phrase is Before he made the world… That is before he wrote the code of humanity he chose us. Again, this may be counter-intuitive, but think about it. He chose us… he designed who we were to be before we existed. That is, he designed our outer interface or the blueprint for who we were to be in advance of implementing us. Y’all probably think I’m playing but I don’t kid around when it comes to scripture. This particular passage strikes me in a certain way as it’s the first I’ve read that clearly paints a connection from my faith to my coding practices. I’ve always known there was a pattern between what I study at church and the how I practice development but I couldn’t put my finger it. Then this passage jumps right out of the good book and describes the connection.

No long winded rant is necessary for tonight’s post, I believe the word says enough as it is written. Think about it.

Ten T.D.D. Commandments

Update* A while ago I thought it was cool to use the file system during a test but a little bunny taught me otherwise. I’ve removed a redundant commandment as well.

Inspired by Ashcroft… not that Ashcroft but this one.

Ten Commandments of Unit Tests

1. I am the class being tested. Thou shalt not test any other class but me.
2. Thou shalt NOT write implementation without a unit test.
3. Thou shalt ensure the bar is red before any code is written.
4. Thou shall NOT write two tests which depend upon each other
5. Thou shall NOT test private methods.
6. Thou shall NOT access files during unit tests.
7. Thou shalt always refactor both test and implementation code after every green bar.
8. Thou shall NOT worship (or test) any false classes (mocks).
9. Thou shall NOT define more than one behavior in a unit test.
10. Thou shall NOT commit code without green bars on all tests.