Elektrine lite

← Feed

@erinaceus@chaos.social

Post #4443727

2026-08-07 06:25 UTC

@icing@chaos.social 10 is not that much. On some days, I write 10 test cases before lunch…

Replies (1)

  • @CppGuy@infosec.space 2026-08-08 09:32

    @erinaceus@chaos.social Right. It really depends on the job in hand. For simple and obvious fixes, just a few #test cases might be enough. For a larger feature or one with lots of tricky edge conditions, I might write tens or hundreds. Occasionally (for things like numeric rounding or date-formatting near boundary conditions or line-wrapping UTF-8 text) I'll write a #Perl script to autogenerate some of them. I don't use an #LLM to write tests for the same reason that I don't ask QA to write the tests for me: I have a deeper understanding of how the code works, the problems and bugs I encountered while writing it, and sometimes the bugs that a future maintainer might allow to slip in. I do ask #QA to review the tests to make sure I've not missed anything. Knowing that a review is coming helps to keep me honest. I have a fairly radical view that the tests are almost more important than the shipping #code, because a good set of tests enables you to overhaul and improve the code in ways that would otherwise be too dangerous. Lack of tests leads to small, timid localised fixes, which leads to a dense thicket of special cases, which leads to an unmaintainable codebase that eventually has to be thrown away. If you don't have decent tests then, sooner or later, you won't have a product. @icing@chaos.social

    Open ##4443723