3 ms·
Hmm, if I’m having to write tests for my tests, I feel something has gone wrong in my life ;)
by silveroriole 6y ago
Hmm, if I’m having to write tests for my tests, I feel something has gone wrong in my life ;)
- rocqua 6y agoIf this leads to having to spend less time on writing tests in total, things have gone right. These fakes are much less maintenance heavy. As changes to implementation details don't require changes to tests. Hence, whilst you need to write tests for your tests, you spend less time writing tests in total.
- chriswarbo 6y agoA "fake" isn't a test; it's a real, working implementation of some interface. The only reason we don't use such implementations in production is for some non-functional reason (efficiency, resilience, etc.). For example, if we want a key/value store we might choose Redis for production, but a HashMap is a perfectly good fake (and you can bet that the language/library implementing HashMap has a ton of tests!)
- srtjstjsj 6y agoA fake is an implementation. The same tests you use on the real implementation also test the fake implementation.