The Reality Check: Why AI Struggles with Real-World Software Engineering

If you have ever used tools like GitHub Copilot or ChatGPT to write code, you know the feeling: it feels like magic when generating a standalone Python function, but often falls apart when asked to build a complex class that integrates with an existing project.

A new paper, “Beyond Synthetic Benchmarks,” confirms this intuition with hard data. It reveals a startling gap between how Large Language Models (LLMs) perform on artificial tests versus real-world software engineering tasks.

Paper: Beyond Synthetic Benchmarks: Evaluating LLM Performance on Real-World Class-Level Code Generation
Authors: Musfiqur Rahman, SayedHassan Khatoonabadi, Emad Shihab


The “LeetCode” Illusion

Current AI benchmarks, such as HumanEval or MBPP, typically ask models to solve self-contained algorithmic puzzles (e.g., “Write a function to reverse a string”). These “synthetic” benchmarks have reported success rates as high as 89% for top-tier models.

However, real software development is rarely about isolated functions. It involves class-level engineering: managing state, handling inheritance, and integrating with external libraries and project-specific dependencies. To bridge this gap, we introduced a novel benchmark derived from real-world open-source repositories, partitioning data into “seen” (older code) and “unseen” (recent code) to rigorously test generalization.

Key Findings: The 89% vs. 25% Gap

The results serve as a reality check for the industry. When tested on this new RealClassEval benchmark, LLMs that scored 84–89% on synthetic tasks plummeted to a mere 25–34% accuracy on real-world class-level generation.

This huge disparity highlights a critical limitation: models are excellent at memorizing syntax and small patterns but struggle with the “architectural” complexity of maintaining class invariants and dependencies. Interestingly, the study found negligible performance differences between “seen” and “unseen” codebases, suggesting that the models aren’t simply failing because they haven’t seen the code before—they are failing because the task itself is fundamentally harder.

Does RAG or Documentation Help?

We also explored if giving the model more help—via comprehensive documentation or Retrieval-Augmented Generation (RAG)—could close the gap.

  • Documentation: Surprisingly, adding comprehensive docstrings yielded only modest gains of 1–3% in functional accuracy.
  • RAG: Retrieval-augmented generation proved more effective, specifically when documentation was incomplete. By retrieving relevant snippets from the codebase, RAG improved correctness by 4–7%, effectively supplying the “concrete implementation patterns” that abstract prompts missed.

Common Failures

An error analysis revealed that 84% of failures in real-world scenarios were due to AttributeError, TypeError, and AssertionError. Unlike synthetic benchmarks where logic errors dominate, real-world failures were often structural—models hallucinated attributes that didn’t exist or misused types, proving they often lack a deep “mental model” of the class structure they are building.

Conclusion

This paper is a wake-up call for researchers and developers. High scores on synthetic benchmarks do not guarantee readiness for production environments. As we move toward autonomous AI software engineers, we must move “beyond synthetic benchmarks” and start evaluating models on the messy, complex, and interdependent reality of actual software development.



Cite the paper
@inproceedings{rahman2019natural,
title={Natural software revisited},
author={Rahman, Musfiqur and Palani, Dharani and Rigby, Peter C},
booktitle={2019 IEEE/ACM 41st International Conference on Software Engineering (ICSE)},
pages={37--48},
year={2019},
organization={IEEE} }



    Enjoy Reading This Article?

    Here are some more articles you might like to read next:

  • Data Version Control (DVC): The Action and The Reaction
  • Is Code Really More 'Natural' Than English?
  • Why Your AI Model Costs More on a Different Machine