HACKER Q&A
📣 ibobev

Could you recommend a good book about writing automated software tests?


I very much appreciate the value of writing automated tests for the software, but I don't have much experience beyond elementary unit tests of functions with well-defined inputs and outputs. Real-world software has complex object relationships, multiple side effects, and user interactions. Could someone recommend me a good book or online resources about patterns and strategies for writing more complex automated tests that take into account the complexity of real-world software?


  👤 hayst4ck Accepted Answer ✓
The first paradigm to understand is that everything that makes code bad is also what makes it hard to test. If code is hard to test, that means the code is bad.

This was in my opinion the best and quickest source on good testing practice, which often meant change the code being tested:

https://misko.hevery.com/code-reviewers-guide/

Sadly, it looks like he has neglected his site, but the content can still be seen through google cache.

This page still seems to work and contains a much meatier amount of content: http://misko.hevery.com/attachments/Guide-Writing%20Testable...



👤 readyplayernull
It depends on the kind of software you are testing and the tools available. There are different testing frameworks for web, mobile, native, databases and also performance measuring tools. I don't think there is a book that covers all those topics. Even dynamic web automation is quiet complex and requires a lot of work to track the controls and events in the DOM, might even require defining best practices for the devs to set labels and signals. BTW, I'm an Automation Engineer looking for job :)