Unit test coverage in the agentic age
Now that none of us write code any more, we’re all thinking about the best ways to get agents to do it all for us. In order to ensure our agents do a good job we need to have quality standards in place. One standard part of software development is writing tests.
Back when I was a software engineer full time (now more of a devops type) I worked on many different projects where we implemented writing unit tests. In most cases, it was an afterthought, a badge of honour or something to appease someone else. However, there were a couple of projects that I worked on where we followed the red, green, refactor process.
If you’re given a project where you have time to think straight then RGR works incredibly well and, it was a joy to code that way. This doesn’t happen in real life..often.
What happens, is we settle for 70% coverage or whatever, often tests written after the code just to hit the coverage target.
Now that we have agents, we can direct them as to what we would do if we had infinite time, no emotional attachment to our code and all the knowledge in the world.
Getting 100% isn’t a lofty goal, it’s well within reach, provided our agent isn’t coding like we used to, but is say…given the persona of Uncle Bob (minus the politics) or maybe a hybrid of Uncle Bob and Martin Fowler? If the agent thinks like those guys then surely we’ll have the best code in the universe with 100% coverage?
This is something I’m in the process of trying now. But taking a step back, if you’re still coding stuff as you then you’re doing it wrong…unless you are actually Bob or Martin :D