Principles of Automated Testing
lihaoyi.com
lihaoyi.com
I prefer to spend my extra time writing code that validates all inputs and all possible error conditions, and logging exceptional situations that can't be handled within the error system.
Tests I find valuable are ones that explore performance and data quality issues. For example in my current project the original developers decided to assume our server APIs always return nil data (hopefully with an error) or that they will return perfectly formed JSON, and if not, would crash. The truth is it's unlikely the server doesn't return poorly formed JSON for a "successful" request, but I wrote code to test 3,000 stores with various data inputs just to test a single API to find out if it did.
Of course I"m not writing a server API. If I was, I'd definitely be writing unit tests. But in a mobile app, there is plenty of work to do to improve the app directly that provide far more value than most unit tests can.
My two 0.02 € on this:
Features have external and internal complexity. External complexity is documentation, usage, support while internal complexity is time spent on maintenance and development, increased complexity of the code, reduced stability etc.
External and internal complexity are unrelated, and when deciding whether to add some feature both must be considered against the assumed advantages of the feature.
Lots of mobile app code has inputs dependent upon a variety of events from network calls to user inputs, and it's "output" can be almost anything from UI state changes, pixel maps or database changes. Then your design group wants to change the UI, and you have to refactor everything, and rewrite every single unit test.
This is only true if the test is run in process and there it is stateful. Performing out of process tests on stateless units are very effective.