4 ms·
I agree with your general point, but currently don’t think the math adds up on unit testing for us. Its not that it wouldn’t be better if we had unit tests. Bu
by valuearb 9y ago
I agree with your general point, but currently don’t think the math adds up on unit testing for us.
Its not that it wouldn’t be better if we had unit tests. But their benefits are mostly in the future, meaning they need to be discounted for the value of time. And even without discounting, they won’t be as valuable to customers and our product as actually creating new and fixing existing features.
If our product fails in the next year, any efforts yielding most of their benefits after that are wasted. Any efforts that yield more customers and usage now, gives us more resources to do more things in the future, including unit tests.
That way if we get to that major, risky expansion in the future we will have more resources to write unit tests then, when they are most useful.
And lastly, i’ve reviewed the bugs that business prioritizes for us. Virtually none, including crashes and feature fails, would be caught by traditional unit tests. Lots of them were force unwrapping code written by original contractors that would pass unit test, but crash in multithreaded environment of garbage collection frees the right object.
To do unit tests we would also have to write a ton of mocks, making our production code less maintainable and understandable, and potentially introduce new bugs.