3 ms·
Ask HN: 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?
- PaulHoule 4y agohttps://www.amazon.com/Working-Effectively-Legacy-Michael-Feathers/dp/0131177052 https://www.amazon.com/Working-Effectively-Legacy-Michael-Fe...
- readyplayernull 4y agoIt 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 :)
- aastronaut 4y agoTo add to this, for me personally the difficult part in automated test isn't the definition of expected output, but the retrieval of actual output in an automated way. Test frameworks can and will only focus on a limited set of interaction (Playwright for DOM, detox for mobile etc.). I think Brendan Gregg's books[0][1] are quite inspiring for an understanding of a system with its inner workings, and provide information about various tools one can use to dissect a system and get some actual output in an automated way. [0]: https://www.brendangregg.com/systems-performance-2nd-edition-book.html https://www.brendangregg.com/systems-performance-2nd-edition... [1]: https://www.brendangregg.com/bpf-performance-tools-book.html https://www.brendangregg.com/bpf-performance-tools-book.html
- hayst4ck 4y agoThe 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/ 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%20Code.pdf http://misko.hevery.com/attachments/Guide-Writing%20Testable...