4 ms·
What happens where trivial code later needs to grow? What happens when trivial code is invoked by non-trivial code and you need to make a change? If it's trul
by awinder 10y ago
What happens where trivial code later needs to grow? What happens when trivial code is invoked by non-trivial code and you need to make a change?
If it's truly trivial code, you should be able to test it trivially, so I'm a little unsure of why this becomes a make-or-break issue for some people. Pretty sure more time and energy is wasted determining if code is trivial and needs to be tested versus just testing the damned thing ;-).
- theparanoid 10y agoTests are code and code is a liability. The DirectX12 api is non-trivial code; their testing has little in common with TDD.
- marcosdumay 10y agoTrivial code does not grow, it gets replaced. If the replacement is non-trivial, test it. If it's trivial, don't. Anyway, you've saved some useless tests that would need to be rewrite on the first change. Trivial tests may be trivial, but they are numerous: their need grows exponentially with code size. And they generate almost all the false positives you will get.