SoftwareDesignForTesting says:
Electrical engineers have a concept of "design for X": design for manufacturing, for maintenance, for test. Design the (sub)system, keeping in mind the things you'll need to do later.
Isn't this a violation of YouArentGonnaNeedIt? How do I know I are gonna need testing but I aren't gonna need features? HaHaOnlySerious --JohnFarrell
That would be the case if your designed your software in anticipation of adding tests later. YouArentGonnaNeedIt (because you aren't gonna do it). Better write the test in anticipation of having to write production code later - that's one thing you know for sure you'll be doing.
CodeUnitTestFirst. Then code for testing. You clearly need it, as you've already done it. ;->