AI Engineering Management

New Student Learning an Old Lesson

An absolute demonstration of TDD today with my AI developer. We've written a workflow document that emphasises the importance of TDD in the project, so he knows that it needs to be done.

We took a ticket from Agent-Knowledge (Lieutenant Green) and discussed it. We did the research, agreed a strategy and prepared for the next stage. That was 50+ tests he wrote in one go. "Okay" I think "well, maybe they are all valid" but I wasn't about to check them all, this is all about following the path and iterating when it goes wrong.

Anyway 50 tests, fine. Then we did the implementation. You might remember that we have a different set of coding standards for AI developers, we co-locate relevant code in one file, so all of the classes we needed to satisfy 50 tests got written in one go, and boy was it a disaster. Code outside of the namespace, constructors mixed up and just got into a mess with the curly braces. These are exactly the problems that AI is really bad at fixing, so instead of trying to fix the code we fixed the processes. We went back and did TDD properly.

We re-read the ticket and the research we did, wrote one test, wrote the code to make that test green. Then the next one, which also meant that we needed a little refactor. Twenty minutes later, the ticket was complete. 40% less code than the original attempt, no formatting errors, far fewer but much better quality testing. He's written it up as the new process.