On Thursday, 1 May 2014 at 12:04:57 UTC, Xavier Bigand wrote:
It's just a lot harder when you are under pressure.
I am working for a very small company and our dead lines
clearly doesn't help us with that, and because I am in the
video game industry it's not really critical to have small bugs.
Not every body have the capacity or resources (essentially
time) to design his code in the pure conformance of unittests
definition, and IMO isn't not an excuse to avoid tests
completely.
If a language/standard library can help democratization of
tests it's a good thing, so maybe writing tests have to stay
relatively simple and straightforward.
My point is just when you are doing things only for you it's
often simpler to them like they must be.
I know that and don't have luxury of time for perfect tests
either :) But it is more about state of mind than actual time
consumption - once you start keeping higher level tests with I/O
separate and making observation how some piece of functionality
can be tested in contained way, you approach to designing modules
changes. At some point one simply starts to write unit test
friendly modules from the very first go, it is all about actually
thinking into it.
Using less OOP and more functional programming helps with that
btw :)
I can readily admit that in real industry projects one is likely
to do many different "dirty" things and this is inevitable. What
I do object to is statement that this is the way to go in
general, especially in language standard library.