Can LLMs Produce Better Object-Oriented Designs than Human-Involved Development?
This study compares object-oriented design quality across pre-LLM, post-LLM, and pure-LLM Java projects, finding that while LLM-generated code exhibits lower complexity and fewer code smells, it often suffers from oversimplification and weak responsibility separation, underscoring the continued necessity of human guidance in design decomposition.
Original paper licensed under CC BY 4.0 (http://creativecommons.org/licenses/by/4.0/). This is an AI-generated explanation of the paper below. It is not written or endorsed by the authors. For technical accuracy, refer to the original paper. Read full disclaimer
Imagine you are a master architect tasked with building a complex house. You have three different teams to choose from to do the actual construction:
- The Old Guard (PreAI): Experienced builders who have never used a computer assistant. They draw their own blueprints and build everything by hand.
- The Hybrid Crew (PostAI): Experienced builders who now have a powerful computer assistant. They still draw the blueprints and make the big decisions, but they let the computer help them lay bricks and cut wood.
- The Robot Team (PureAI): A team of advanced robots that take a simple verbal description of the house and build the entire thing from scratch, end-to-end, without a human touching a tool.
This paper asks a simple question: Which team builds the best house? Specifically, does the "Robot Team" create a design that is just as good, or even better, than the human teams?
The Experiment
The researchers set up a "construction challenge" using a classic board game called Kalah. They asked three groups to build a Java software program to play this game:
- Group 1 (PreAI): Students from 2021 (before AI coding tools were common).
- Group 2 (PostAI): Students from 2024 (after AI tools became popular).
- Group 3 (PureAI): The same assignment given to three different top-tier AI models, which generated the code entirely on their own.
They didn't just check if the game worked; they looked at the quality of the design. Think of this as checking if the house has a logical layout, if the rooms are the right size, and if the plumbing isn't tangled.
What They Found
1. The Robot Team Built "Smaller" Houses, But They Were Too Simple
The PureAI (Robot) teams built code that looked very clean on the surface.
- The Good News: Their code had fewer "smells" (bad habits like messy code) and seemed less complex overall. It was like a house with very few walls and a very open floor plan.
- The Bad News: This simplicity was actually a problem. The robots oversimplified the design. Instead of building separate rooms for the "Player," the "Board," and the "Pits" (the holes in the game), the robots often smashed everything into one or two giant rooms.
- The Metaphor: Imagine a house where the kitchen, bedroom, and bathroom are all just one big room with no doors. It's very simple and easy to clean (low complexity), but it's terrible for living in because you can't separate your activities (poor "responsibility separation"). The robots missed the important "abstractions" (the distinct concepts) that make a system understandable.
2. The Hybrid Crew (PostAI) Started Acting Like Robots
The students from 2024 (who used AI helpers) didn't build quite as "robotic" as the PureAI team, but they were closer to the robots than the 2021 students were.
- Their designs were also getting a bit too simple, missing some of the distinct "rooms" (concepts) that the 2021 students included.
- However, unlike the robots, the Hybrid Crew's code actually had more messy habits (code smells) than the old-school students. It seems that when humans try to fix or edit robot-generated code, they sometimes introduce new messiness locally, even if the overall structure looks simple.
3. The "Prompt" Matters, But It's Not a Magic Wand
The researchers tried giving the robots more specific instructions, like "Make sure you have a separate class for the Player and a separate one for the Board."
- Result: When the instructions were more specific, the robots did a better job of creating separate "rooms" (concepts).
- Limitation: Even with the best instructions, the robots still didn't quite match the quality of the human-designed houses. They still tended to oversimplify.
The Big Takeaway
Robots are great at laying bricks, but humans are still needed to draw the blueprints.
The paper concludes that while AI can write code that works and looks clean, it struggles with the big picture of Object-Oriented Design. It tends to lump everything together to make things "simple," which actually makes the software harder to maintain later because the distinct parts of the system are lost.
- PureAI (Robots): Great at avoiding small mistakes, but bad at understanding the big structure.
- PostAI (Humans with AI): Starting to lose some of the structural depth, and sometimes making the code messier in the process.
- The Lesson: If you use AI to write software, you must act as the architect. You need to tell the AI exactly how to break the problem down into distinct parts (decomposition) and what each part is responsible for. If you just say "build a game," the AI will build a messy, oversimplified version that looks clean but is hard to fix later.
Drowning in papers in your field?
Get daily digests of the most novel papers matching your research keywords — with technical summaries, in your language.