Asking developers to do QA is broken – why anyone should own QA
Silver bullets. They don&#x27;t exist.<p><i>Code review.</i> Read the results of someone thinking through a process. Spot more than they will, simply by throwing more eyes at it. Actually fairly effective: getting a senior dev to cast even a lazy eye over everything gives more opportunities to discuss Why It&#x27;s Done This Way and Why We Don&#x27;t Do That and Why This Framework Sucks And How To Deal With It with specific concrete examples which the other dev is currently thinking about. But it&#x27;s still easier to write the code yourself than review it, and things still get missed no matter how careful you try to be, so it&#x27;s still just another layer.<p><i>Unit tests.</i> They cover the stuff we think to check and actually encountered in the past (ie. regressions). Great for testing abstractions, not so great for testing features, since the latter typically rely on vast amounts of apparently-unrelated code.<p><i>Integration tests.</i> Better for testing features than specific abstractions, and often the simplest ones will dredge up things when you update a library five years later and some subtle behaviour changed. Slow sanity checks fit here.<p><i>UI-first automation (inc. Selenium, etc).</i> Code or no-code, it&#x27;s glitchy as hell for any codebase not originally designed to support it; tends to get thrown out because tests which cry wolf every other day are worse than useless. Careful application to a <i>few basics</i> can smoke-test situations which otherwise pass internal application sanity checks, and systems built from the start to use it can benefit a lot.<p><i>Manual testing.</i> Boring, mechanical, but the test plans require less <i>active</i> fiddling&#x2F;maintenance because a link changed to a button or something. Best for exploratory find-new-edge-cases, but throwing a bunch of students at a huge test plan can sometimes deliver massive value for money&#x2F;coffee&#x2F;ramen. Humans can tell us when the instructions are &#x27;slightly off&#x27; and carry on regardless, distinguishing the actual important breakage from a trivial 2px layout adjustment or a CSS classname change.<p>So that&#x27;s the linear view. Let&#x27;s go meta, and <i>combine techniques for mutual reinforcement.</i><p><i>Code review</i> benefits from <i>local relevance</i> and is hampered by <i>action at a distance.</i> Write static analysers which enforce relevant semantics sharing a lexical scope, ie. if two things are supposed to happen together ensure that they happen in the same function (at the same level of abstraction). <i>Encourage relevant details to share not just a file diff, but a chunk.</i> Kill dynamic scoping with fire.<p><i>Unit and Integration tests</i> can be generated. Given a set of functions or types, ensure that they all fit some specific pattern. <i>This is more powerful than leveraging the type system to enforce that pattern,</i> because when one example needs to diverge you can just add a (commented) exception to the generative test instead of rearchitecting lots of code, ie. you can easily separate sharing behaviour from sharing code. <i>Write tests which cover code not yet written, and force exceptions to a rule to be explicitly listed.</i><p><i>UI testing</i> is rather hard to amplify because you need to reliably control that UI in abstractable ways, and make it easy to combine those operations. I honestly have no idea how to do this in any sane way for any codebase not constructed to enable it. If you&#x27;re working on greenfield stuff, congratulations; some of us are working on stuff that&#x27;s been ported forwards decade by decade... <i>Actual practical solutions welcome!</i><p>That&#x27;s my best shot at a 2D (triangular?) view: automated tests can enforce rules which simplify code review, etc. The goal is always to force errors up the page: find them as early as possible as cheaply as possible and as reliably as possible.<p>The machine can&#x27;t check complex things without either missing stuff or crying wolf, but it can rigidly enforce simple rules which let humans spot the outliers more easily.<p>And it is <i>amazing</i> how reliable a system can become just by killing, mashing and burning all that low-hanging error-fruit.