←back to thread

362 points mmphosis | 1 comments | | HN request time: 0.201s | source
1. rtpg ◴[] No.42168333[source]
> Testability is correlated with good design. Something not being easily testable hints that the design needs to be changed. Sometimes that design is your test design.

I have struggled a bit with this at times. There are certain things that can go from "this implementation fits on a postcard" to "this implementation fits on 3-4 pages" if you want to provide the introspection required to provide useful tests (less true in languages like Haskell that provide nice monadic tricks, granted). I like having tests just to prove the point, but I will feel quite bad ripping up _tiny_ implementations to get tests working.

But test code is also code that should be introspected in a certain way (though the objectives are different). Maybe I'm just doing some things the wrong way.