Requirements Drive Everything and AI Could Help to Make Sure Its True

November 3, 2024

One day I faced with one a bit new for me behavior of the development team: the team, located in India, postponed the implementation of a feature, because they saw that the feature might not be required in a terms of business need.

Sounds logical? Yes, but probably only for those who have no historical background in this project. Before the starting of the implementation, there was a long chain of requirements clarification sessions, approvals, creating User Stories, commitment of the team on them, couple of calls with the other dev team leader, who would consume the feature. Then, seemed, the implementation started. But, at the same time, another thread of discussions started, about probably other source of data, instead of that feature. As a result, after couple of weeks when the team was seemingly going to start the work, they reported that they need another business feature to motivate the development.

With that team, the situation was regulated, they got a new business feature, and finally started the work. I almost forgot about that. But recently I had another reason to refresh this event in my memory, now, with the help of AI.

In 2024, any can feel good in development even not having deep roots in that. AI helps tremendously. I thought it’s time to me to try AI-augmented coding , and started building a small web solution, consisting of back-end and front-end, and calling some AI to implement human-like operations. Of course, I needed set of UX pages, some validation logic on front end, then the backend keeping the data in the database and doing whatever I like. Nothing new in the software development world.

New for me, however, was the approach of writing this solution. I used the Claude Coder plugin in Visual Studio Code, and prompts to get what I needed. This is what I had by the moment of writing this article: it spent $5 out of $10 initially granted, and AI wrote tons of lines of code, with I would say a high level of quality. Not bad?!?

The work is still in progress. The remaining part is the most complicated – having all these bricks in place, make sure they are all assembled in the proper order, and work as intended. However, this is not what the article was supposed to talk about.

I am not going, also, write article how to code with AI in general, or with Claude Coder particularly. There are lots of videos and guides. It takes care almost of everything, suggesting the tech stack, implementation of what is needed, and inserting “todo” in the places where no implementation so far. But know what? Each missing or not properly formulated requirement costs you a penny, and Claude Coder is a great tool to feel how it happens in practice.

Yeah, Claude Coder is a crazy patient thing. When you ask her (let it be her) to add this or that, she first shows you how she is going to do that, step by step, then implements the changes on by-file basis, doing all that crazy refactoring when needed, then shows the modified file, where you can review and add something that is missed, or return something that may get lost after next refactoring. Finally, you get all the chain of changes done, and your account get deducted by another $0.1.

And here my “just do it” mindset breaks. Comparing to traditional “iterative” development, where first some basic functionality is implemented, then some more features are getting done, or some rework implemented, with the AI, seems, everything can be implemented in one pass if driven by an ideal architect, or, in two, if someone like me tries to do that.

What I needed to do first, before asking AI to provide a code, is ask her – either Claude or ChatGPT – to provide full requirements, based on my human input. I would need probably several sessions analysing these requirements, thinking of what is missing. Then, only after the requirements are crystal clear, I needed to do the next step and ask Claude to code. Literally, 99 hours of thinking where to kick on the nail, and 1 second to make a single kick.

And, after that kick, the dirty development work comes to play. Code review, line by line, still would be needed. Still, the AI may leave some “todo” items, or even declare a constant, but then forget to use it and take a hardcoded value instead, like one head was thinking on the declarations, and another one was assembling the code from millions of suitable pieces. This is exactly where I am now, at this moment.

A fly in the ointment, by the way, looks like that. At some moment AI in a new version of the file, when you ask her add something more, just writes like that:

..and of course “# … [existing functions] … ” will wipe out all your code before the new piece, so your eyes are your the only friends 😦
..or you may get kind of this one, with the rest of main.py file cut – but you were told that the content remains the same, isn’t it??? Who should take care of it???

..and one more fly in the ointment, every new piece code written in AI in the next update may look like written by another person, with a slightly different approach of alignment of input parameters, handling of errors, so following to the same coding style guide may be explicitly required. Or that new person may even re-invent the wheel, and add some more authentication function, or role. E.g. now I have two beautiful functions instead of one.

check_permission(current_user, ["WRITER", "SUPERVISOR"]) verify_editor_role(current_user)

..and finally, when you are seemingly near to launching the code, you realize that the logic inside is not what you expected, even if it is written absolutely grammatically correct.

..and you can also realize that AI uses obsolete methods for some classes..

But let’s stop, this is a definitely different story, how to write exact prompts to AI that you are understood from the very beginning right. Or, ask ChatGPT to help you on the late stages.

Resuming all said, I am fascinated with the level of knowledge and technical skills demonstrated by the AI today. It spans much wider than a Mid-Senior Level developer would do, possessing rich set of technologies, and looks like a true replacement of Stackoverflow recipes. I enjoyed time spent with Claude Coder, talking with her on a normal manager’s language, and getting a normal developer’s response. And I guess I got my personal lesson of how important is formulating the whole bunch of requirements at the very beginning.

P.S. This article was written by my weak brain, with no help of GPT, and even Grammarly. Sorry for typos and grammar mistakes.