If an agent writes the code, the bug moves into the specification
If an agent writes the code, errors arise in the description of intent: in what the specification says ambiguously or leaves out. The developer's work thus becomes the craft of specification, verification and maintenance, and a test suite's score is worth only as much as the tests behind it.
How this was made: this essay was written by the author's own research and analysis system from the cited sources; Zoltán Varga edited the topic, structure and final text. The cited works are the source of its factual claims.
The word 'specification' is used by developers sometimes for a written text, sometimes for everything the customer expects from the system, and there is always a gap between the two. With code-writing agents, I consider this gap to be the actual subject of the work. In the traditional process, the programmer translates the idea living in their head into a programming language, and is forced to make a decision on every open question along the way: what happens with empty input, which time zone counts, what the user sees in case of an error. The slowness of coding thus also functioned as feedback, because gaps in the description surfaced during the work, and the developer asked back.
Imagine a team building an invoicing system that writes down only this much for the agent: the system sends a reminder about overdue invoices. Within minutes the agent delivers working code which, along the way, has silently decided whether the due date counts in calendar days or banking days, whether a partially paid invoice counts as overdue, and how many times the reminder goes out. The code runs, the tests handed over pass, and no one made the decisions consciously. The error has moved from the translation into the description, where it is much harder to spot, because every sentence of the description appears true.
Formal specification, contract, test: the legacy
The strictest tradition of making the description precise is that of formal methods. In her book Kill It with Fire, Marianne Bellotti presents them as approaches that, in seeking to prove correctness, uncover errors that would be impossible to find by merely studying the code 1. Their most accessible form is formal specification: the design is written out in a markup language that a model-checking program can interpret. Starting from the allowed inputs, the program maps every possible combination of outputs and compares them with the rules fixed in the specification, searching for a result that violates the stated assertions 1. Intent thus itself becomes an object that can be examined.
Bellotti also records the limitations. When her book was written, software teams rarely used formal methods because the learning curve is steep, material for beginners barely exists, and the user community is small and leans towards the academic world 1. The author outlines an organisational solution: a single engineer is enough to formulate and refine the specifications together with the other teams, just as teams also work with a small circle of user experience designers. The author considers contract testing an easier entry point, that is, the automated check that detects when system components have broken the data contract between them; for this, the description of every endpoint is prepared in a machine-readable form 1. From this I conclude that the obstacle to formal description has so far been the human learning cost, and this balance shifts where implementation is cheap but errors in the description are expensive.
The contract is the tool more deeply integrated into everyday practice. Andrew Hunt and David Thomas's book The Pragmatic Programmer starts from the everyday contract, which records the rights and obligations of the parties as well as the consequences of breach, and then applies the same concept to the cooperation of software modules 2. The authors describe Bertrand Meyer's design by contract, which Meyer developed for the Eiffel language: developers document and agree on the rights and responsibilities of modules because this ensures the correctness of the program. A program is correct if it does neither more nor less than what it claims about itself 2. The precondition states what must be true for a routine to be callable, and passing good data is the responsibility of the caller 2. In Meyer's well-known system, the counterpart to this is the postcondition, that is, what the routine guarantees upon completion.
Test-driven development records this same intention through examples. According to James Gough, Daniel Bryant and Matthew Auburn's book Mastering API Architecture, the test that the unit will satisfy is written first, the first run fails, then the code that passes the test is written, and finally the code is refactored 3. The authors link the cycle to Kent Beck 3. What the contract and the test written in advance have in common is that they put the intention into a form that can fail. An agent is unlikely to misunderstand such a description. At the same time, a test is an example, and between the examples the implementation is free: whoever fixes the behaviour at a few points leaves the decision at all the other points to the implementer.
The ambiguity of natural language requirements
Most requirements are still born as sentences, and a sentence allows more than its author intends. In his book The Elements of User Experience, Jesse James Garrett places two formulations side by side. According to the first, the most popular videos are highlighted; according to the second, the most viewed videos of the past week appear at the top of the list 4. The first seems clear until someone asks whether popularity is measured by the number of comments or of likes, and what highlighting consists of. The second defines popularity and the manner of highlighting, and so heads off the disputes that tend to break out during or after implementation 4. According to Garrett's general rule, a requirement must be falsifiable, that is, it must be possible to show that it has not been met, and it is hard to show whether a subjective adjective has been met 4.
Mike Cohn's book User Stories Applied offers a more everyday example. According to a menu, soup or salad and bread come with the main course, and the sentence does not settle whether the bread goes only with the salad or with both choices 5. Cohn concludes that the customer gets the developers' interpretation of what was written down, and this may differ from what the customer wanted; written words are usually taken to be precise, yet they are imprecise 5. The continuation of the example is the more instructive part for me: the waiter's spoken question, followed by the bread basket placed on the table, removed the ambiguity 5. The resolution thus came from feedback; polishing the text would not have been enough. In work with an agent, this channel exists only if the team builds it in. If the process nowhere forces a clarifying question, the implementer picks one interpretation and hands over a finished program in which the choice is no longer visible.
What coding agents' test suites measure
The capabilities of coding agents are measured on public test suites, known in the trade as benchmarks. The best-known family is SWE-bench: the task is a real issue, the agent produces a fix, and the solution counts as successful if the tests belonging to the task pass. According to Linghao Zhang and colleagues' 2025 preprint SWE-bench Goes Live!, SWE-bench and its variants have not been updated since their release, cover few code repositories, and require much manual work, which carries the risk of overfitting and data contamination 6. Data contamination here means that the model has already encountered the task in its training data. The authors therefore built a continuously updatable suite, whose first release contains 1319 tasks drawn from issues opened since 2024 in 93 code repositories. On this, the agents examined performed substantially worse than on the static suites, even under controlled evaluation conditions 6.
Boxi Yu and colleagues' 2026 preprint, SWE-ABS: Adversarial Benchmark Strengthening Exposes Inflated Success Rates on Test-based Benchmark, examines what the scores actually contain. The system leading the SWE-Bench Verified leaderboard scored 78.80 per cent, but according to the authors' re-evaluation, one in five of the fixes the top thirty agents were credited with solving is semantically incorrect and passed only because weak tests did not expose the error 7. The researchers strengthened the tests in two steps: first they targeted code not covered by the tests, then they generated plausible but incorrect fixes to bring the blind spots to light. They managed to supply a stronger test for 50.2 per cent of the 500 tasks; 19.71 per cent of previously accepted fixes failed, and the leading agent's score dropped to 62.20 per cent, placing it fifth 7.
Soham Dan and colleagues' preprint, also from 2026, SWE-Bench Pro V2: A Cleaner, Harder-to-Game Coding Benchmark, goes back to the task descriptions. According to the authors' report, 480 of the 731 tasks had to be corrected or removed; the work was carried out by 23 contracted engineers over 404 hours, and every rewritten task description was checked by a second engineer who solved the task using only the text 8. The stricter procedure restricts network access to the model endpoint and re-evaluates every fix in a clean environment, so the agent cannot download an existing fix and receives no points for any change other than its own fix. On the new set of 642 tasks, state-of-the-art agents achieve at most 99.4 per cent, while on the 51-task difficult subset, system results range between 52.9 and 98.0 per cent 8.
I read the three works together as a miniature version of the specification problem. The test suite score measures whether the fix satisfies the tests, and the tests capture only part of the intent. Where a test is weak, a flawed solution also appears successful; where the task text is imprecise, the measurement records the description's error as the agent's fault or merit; where the environment leaves a loophole, the agent scores points even by circumventing the intent. A development team is in the same situation whenever it accepts agent-written code on the strength of its own tests.
Tacit knowledge and unwritten requirements
Even precise text and robust tests do not cover what the team knows but has never stated. According to Michael Polanyi's concept of tacit knowledge, people know more than they can tell, and software development is full of such knowledge. An experienced developer knows that personal data must not enter the log, that a certain module is also called by the nightly batch processing, and that a system slowdown during month-end closing causes more harm than at other times. These are requirements that no one wrote down because everyone on the team takes them for granted. A new human colleague absorbs this knowledge through code reviews and conversations. The agent works from whatever reaches it in the task text, the code and the tests.
According to research, requirements engineering is an immature area for systems that contain AI as well. Umm-e-Habiba and colleagues' 2024 preprint, How Mature is Requirements Engineering for AI-based Systems?, processed 126 primary studies in a systematic mapping study. According to the results, research focuses mainly on requirements analysis and elicitation, while the most common difficulties include requirements specification, explainability, and the gap between machine learning engineers and end users 9. Walid Maalej and colleagues' 2023 preprint, Tailoring Requirements Engineering for Responsible AI, points out that the acceptance problems reported after deployment from the medical, automotive and scientific fields underline the importance of requirements engineering, and the authors argue that the methods must be tailored to the needs of responsible AI 10. Both works concern systems into which AI is built, that is, a field adjacent to coding agents. Even so, I see the pattern as belonging here: the unwritten requirement shows up after deployment, where fixing is most expensive.
Specification maintenance as a craft
If the error originates in the description, the fix belongs there too. In practice, the specification is then a work product versioned together with the code, reviewed, and linked to tests, and after every production failure the team examines whether the description was silent, ambiguous, or wrong. The fix first goes into the description and a new test; the code is then produced again. Where the team patches the urgent bug directly in the code, the description and the behaviour drift apart, and the next agent is already working from an untrue text.
The experience of those who maintain test suites carries over here as well. Dan and colleagues justify the revision by noting that improving agents reach flaws in the tasks that earlier ones never touched, and use the evaluation environment in ways the original framework did not anticipate 8. The specification thus ages together with the implementer's capability: what it was enough to half-describe for a weaker implementer is a loophole for a stronger one. The test of the second engineer, who works from the text alone, is a check that a development team can also carry out to see whether the description stands on its own. Bellotti's organisational pattern provides a framework for this: one engineer who refines the specifications jointly with the teams, and a shared reference that sets out the system's design and expected behaviour for everyone 1.
The developer as the editor of intent
For the developer's role, what follows from all this for me is that the centre of gravity shifts from typing to stating decisions. The developer's value lies in noticing the open question before the agent silently answers it, and in recording the answer in a form that can fail: as a contract, as a test, and where it is worth it, as a formal model. For this, the ability to read code remains indispensable, because the agent's tacit decisions become visible in the code, and the developer lifts them back from there into the description.
At team level, the change shows up in how responsibility is assigned. The specification has an owner; review covers both the description and the tests, and making the tacit knowledge of experienced colleagues explicit is planned work for which time is allocated. From this perspective, I consider the position of early-career staff delicate. Until now, tacit knowledge has built up while writing code, through mistakes and reviews, and if an agent does most of the coding, this learning path thins out. An organisation can make up for this only with deliberately built practice, for example by having the junior colleague write the tests and contracts, while the more experienced colleague reviews what they left out.
When the description can take the place of the code
My answer to the expectation that the specification will replace the source code is conditional. A specification written in natural language, produced once and then left alone, is unsuited to that role: it is ambiguous, it is silent on what the team takes for granted, and nobody notices when it goes out of date. The history of test suites shows that a machine-generated implementation is only as reliable as its verification is strong, and that the verification itself needs maintenance. The specification takes over the role of code where the team treats it with the same discipline: it gets versioning, review, executable verification and an owner. Until that is in place, the code remains the only place where the system's actual decisions can be read.
Recommended reading
- Kill It with Fire (Marianne Bellotti). Marianne Bellotti's book clearly presents what formal specification and contract testing offer to an organisation maintaining legacy systems, and how they can be introduced in small steps.
- The Pragmatic Programmer: From Journeyman to Master (Andrew Hunt, David Thomas). Andrew Hunt and David Thomas's seminal work explains design by contract in the language of everyday programming practice.
- User Stories Applied: For Agile Software Development (Mike Cohn). Mike Cohn's book discusses why written requirements are imprecise and how the conversation with the customer fills the gap.
- SWE-ABS: Adversarial Benchmark Strengthening Exposes Inflated Success Rates on Test-based Benchmark (Boxi Yu, Yang Cao, Yuzhong Zhang, Liting Lin et al.). Boxi Yu and colleagues' preprint shows how much a leaderboard changes when the tests for the tasks are strengthened.
- SWE-Bench Pro V2: A Cleaner, Harder-to-Game Coding Benchmark (Soham Dan, Jeff Da, Sanyam Bhutani, Miguel Romero Calvo et al.). Soham Dan and colleagues' preprint, through a revision of a test suite, illustrates how much work is involved in maintaining task descriptions and the evaluation environment.
Sources
- [1] Marianne Bellotti (2021): Kill It with Fire.
- [2] Andrew Hunt, David Thomas (1999): The Pragmatic Programmer: From Journeyman to Master.
- [3] James Gough, Daniel Bryant, Matthew Auburn (2022): Mastering API Architecture.
- [4] Jesse James Garrett (2002): The Elements of User Experience.
- [5] Mike Cohn (2004): User Stories Applied: For Agile Software Development.
- [6] Linghao Zhang, Shilin He, Chaoyun Zhang, Yu Kang et al. (2025): SWE-bench Goes Live!. arXiv.
- [7] Boxi Yu, Yang Cao, Yuzhong Zhang, Liting Lin et al. (2026): SWE-ABS: Adversarial Benchmark Strengthening Exposes Inflated Success Rates on Test-based Benchmark. arXiv.
- [8] Soham Dan, Jeff Da, Sanyam Bhutani, Miguel Romero Calvo et al. (2026): SWE-Bench Pro V2: A Cleaner, Harder-to-Game Coding Benchmark. arXiv.
- [9] Umm-e-Habiba, Markus Haug, Justus Bogner, Stefan Wagner (2024): How Mature is Requirements Engineering for AI-based Systems? A Systematic Mapping Study on Practices, Challenges, and Future Research Directions. arXiv.
- [10] Walid Maalej, Yen Dieu Pham, Larissa Chazette (2023): Tailoring Requirements Engineering for Responsible AI. arXiv.