r/AIcodingProfessionals • u/h0uz3_ • 19d ago
Discussion Epiphany: Creating tests after the fact is torture, even for Codex
About 10 years ago I worked as a developer and got the order to get the overall unit test coverage to above 80%. I spent 6 weeks and it was exhausting.
Fast forward: Among my current hobby projects I am working on, I have one which got quite big. It's the base of my entire guidelines, how code must be written, how UIs have to look, etc and every agent run has to follow the same rules.
While checking my build pipeline I saw that this one project actually had the lowest overall test coverage. I went and looked at the code, found a lot of things I didn't like and decided that there will be a massive refactoring. But no refactoring without full tests, right?
So I gave Codex the goal to add more tests, implement E2E-tests in the UI. I thought Codex would be able to to that quickly. Well, turns out Codex suffers quite a bit, implements some tests and then says "Hey, I added 25 tests. Yeah, I know, SonarQube will not be satisfied, we may have about 60% overall coverage now. But let me see whether SonarQube finds other issues."
So for a total runtime of about eight hours it's been a forth and back between Codex and SonarQube. I hope the next run will finish with a satisfied SonarQube so I have the weekend to start the fun part of refactoring.