YAGNI and designing ahead

Hand-drawn terracotta timber frame with three hatched panels on the left that continues to the right as open beams over flowing cream, sand, umber and moss contour lines.

YAGNI (“You Aren’t Gonna Need It”) is the rule that software should be built for the needs it has now, not for needs someone foresees (Jeffries, 1998). Its opposite is designing ahead: anticipating likely changes and structuring the code so they will be cheap. Fowler’s case for YAGNI is an argument that it holds only when code is easy to change, and Parnas’s case for designing ahead rests on reasoning about one example (Fowler, 2015; Parnas, 1972). Studies test their premises instead: how often speculative features go unused, whether over-general code causes faults, and whether late changes cost far more. The most quoted figures, “64% of features rarely or never used” and “100 times more expensive to fix later”, rest on small or unpublished samples (Mountain Goat Software, 2016; Menzies et al., 2017).

Origin and meaning of YAGNI

YAGNI comes from Extreme Programming, an agile software method (Wikipedia, n.d.). Martin Fowler traces the phrase to Kent Beck and Chet Hendrickson on the C3 project. Ron Jeffries wrote in 1998 that features should be built when actually needed, not when merely foreseen (Fowler, 2015; Jeffries, 1998).

In Fowler’s account, YAGNI targets presumptive features: capabilities built for a need that is expected but not yet real. He names four costs of such a feature: building it, delaying other work, carrying it in the code, and repairing it (Fowler, 2015). YAGNI does not cover work that makes code easier to change, such as refactoring, which means restructuring code without changing its behaviour (Fowler, 2015).

Fowler makes the rule conditional on cheap change. He states that YAGNI is viable only if code is easy to change, and that without enabling practices such as testing and refactoring it becomes harmful (Fowler, 2015; Fowler, 2004). Beck argues that the rule was never about the cost of writing code but about the cost of speculative structure (Beck, 2026).

How often speculative work goes unused

The strongest data on wasted work concern product ideas, not code, and they show that most ideas fail. Google, LinkedIn and Microsoft test ideas in A/B tests, which compare users shown a change with users not shown it. About two-thirds of promising ideas failed to improve the metric they were built to move (Kohavi et al., 2020). At Microsoft, a third of tested ideas were significantly positive, a third flat and a third significantly negative (Kohavi, 2012; Kohavi et al., 2009b).

People also predict poorly which ideas will work. Over 200 people asked to predict the outcome of eight A/B tests got 2.3 right on average. The Microsoft team concluded that ranking features in advance may be less reliable than most people believe (Kohavi et al., 2009b).

Higher failure rates are reported for other firms. Google is reported to have seen as much as 96.1% of its ideas fail to give positive results, and Booking.com 9 out of 10 (Colson et al., 2021). The authors who report these figures caution that they come from a small, non-random set of ideas at young tech firms (Colson et al., 2021).

The widely repeated claim that 64% of features are rarely or never used rests on very little. It comes from a keynote by the Standish Group’s chairman and is based on four internal-use applications, not commercial products (Mountain Goat Software, 2016). The Standish Group’s better-known project-success figures also failed an independent check: applied to 5,457 forecasts from 1,211 projects, its definitions gave figures that did not reflect those projects (Eveleens & Verhoef, 2010).

A vendor figure is similar in kind. The analytics company Pendo reported that 80% of features in the average product are rarely or never used. The figure rests on three months of usage across 615 customer subscriptions, where a “feature” is whatever customers chose to tag (Pendo.io, 2019).

Speculative Generality in code Contested: studies disagree on this

Inside the code, YAGNI’s target has a name in the catalogue of code smells (patterns thought to signal design problems): Speculative Generality. One definition is a class declared abstract that has very few subclasses, which make little use of its methods (Nocera et al., 2026). It is common: in 395 releases of 30 open-source projects, it appeared in 80% of releases (Palomba et al., 2018).

Studies disagree on whether it causes harm. A study of 395 releases ranked removing Speculative Generality as highly beneficial for change-proneness (how often a class has to be changed) but of limited benefit for faults (Palomba et al., 2018). In three open-source systems, the smell went with fewer faults in Eclipse only, and every significant smell effect on faults was under 10% (Hall et al., 2014).

Adjusting for confounders, factors that affect both the smell and the outcome, removes the significant link. In a 2026 cohort study of three Java systems, the significant association between Speculative Generality and change-proneness disappeared after adjustment, and the association with faults lost significance too (Nocera et al., 2026).

Developers also disagree about whether the smell is a problem. In one perception study, the original developers never saw a design problem in classes flagged as Speculative Generality, while Master’s students saw one in 53% of cases (Palomba et al., 2014).

The cost-of-change curve Contested: studies disagree on this

Whether late changes cost far more than early ones is disputed, and the answer matters to both positions. Beck called a flat cost-of-change curve the technical premise of Extreme Programming (Shore, 2021). Barry Boehm and Victor Basili wrote in 2001 that fixing a problem after delivery is often 100 times more expensive than fixing it during requirements and design (Boehm & Basili, 2001). The same paper gives about 5:1 for small, noncritical systems, and says good architecture can lower the factor by confining fixes to small, well-encapsulated modules (Boehm & Basili, 2001).

The original data behind the 100-times figure are not available. They came from large systems of the late 1970s at IBM, TRW, GTE and Bell Labs, and the data points were never published for analysis (Menzies et al., 2017). Laurent Bossavit traced a widely cited version of the chart to a 1981 IBM course note and found no data behind its figures (Anderson, 2021).

Newer project data do not show the steep curve. In 171 industrial projects, issues resolved in a later phase did not take consistently or substantially more effort than issues resolved soon after they appeared (Menzies et al., 2017). That study covers only one process, the Team Software Process, and stops before deployment, so it cannot say whether fixes after delivery cost more (Menzies et al., 2017).

Other data put the ratio anywhere from small to large, depending on severity and timing. At a 2002 workshop, participants reported about 100:1 for severe defects but much less for non-severe ones, and one dataset showed about 2:1 after shipment against before (Shull et al., 2002). IBM Rochester data showed about 117:1 for defects slipping from coding to the field (Shull et al., 2002). Steve McConnell cited Hughes Aircraft data: a requirements defect took about 10 times the effort to fix in system testing. He called the common 50 to 200 times figure a rough average (McConnell, 2001).

These figures describe defect fixes, not changes of design or features. James Shore points out that Boehm’s chart shows the cost of fixing defects by phase, not the cost of change over time (Shore, 2021). The 2002 workshop judged the 100:1 rule suited only to processes with a clear release point, and noted it had not been studied for Extreme Programming (Shull et al., 2002).

Designing for anticipated change

The academic case for designing ahead comes from David Parnas. In 1972 he proposed starting a design from a list of difficult decisions or decisions likely to change, and hiding each one inside its own module (Parnas, 1972). In his small indexing example, a likely change such as the storage format touched one module in the hiding design and every module in the conventional one (Parnas, 1972).

Parnas argued that anticipating change must come first. In 1979 he wrote that engineers in other fields are taught to anticipate changes and software engineers are not. There is, he added, no magic technique for unanticipated changes (Parnas, 1979). One must therefore anticipate changes before beginning the design (Parnas, 1979).

Some of his advice resembles YAGNI. He advised starting from the minimal useful subset of a system and searching for minimal increments, and warned that users overstate their requirements (Parnas, 1979). The 1972 argument rests on reasoning about one example system, which had been used successfully in a class project (Parnas, 1972).

Option value and modularity

Economic models frame flexibility as an option: a right, not an obligation, to make a later choice. Kim Clark and Carliss Baldwin value modular design as options to replace early, inferior solutions with better ones. A modular architecture is justified, they argue, when those options are worth more than it costs (Clark & Baldwin, 2002).

The same reasoning supports both sides. Kevin Sullivan notes that delaying an investment preserves the option to make it once the uncertain future is known (Sullivan, 2009a). Beck uses it for YAGNI: even a correct guess about a future need leaves a team worse off, because committing early gives up options and pulls costs forward (Beck, 2026). Rami Bahsoon and Wolfgang Emmerich note that flexibility beyond what a change demands is wasted investment (Bahsoon & Emmerich, 2004).

The models are hard to apply to real projects. Sullivan illustrates delay with a worked numeric example and Bahsoon and Emmerich apply their model to one case from the literature. They state that precise option estimates in software remain an open challenge, relying on experience and judgment (Sullivan, 2009a; Bahsoon & Emmerich, 2004). Sullivan calls for research to develop and validate such theories (Sullivan, 2009a).

Data linking modularity to development cost come from one firm. Across eight versions of its product, architectural complexity (a lack or breakdown of hierarchy or modularity) went with 50% drops in productivity and three-fold rises in defect density. Staff turnover rose by an order of magnitude (Sturtevant, 2013).

Retrospective cases Weak evidence: few or small studies support this

Case reports show designing ahead both paying off and backfiring, sometimes in the same project. The developers of CRISTAL, a system at CERN, estimate that a generic, flexible data model saved several person-years over the project’s life (Branson et al., 2014). They also report that making every change as open and flexible as possible led to feature creep and spiralling complexity, so they switched to implementations “as simple as necessary” (Branson et al., 2014).

What worked in CRISTAL was selective anticipation. Its designers concentrated on the core objects that could be needed over the system’s lifetime and left application-specific views until required (Branson et al., 2014). Over eight years of production, one of seven server upgrades was needed because a data format designed early did not scale (Branson et al., 2014).

Where each position is said to hold Weak evidence: few or small studies support this

The conditions under which YAGNI or designing ahead apply come from practitioner essays, not from studies. The essays agree that some decisions are worth making early, and differ on which ones (Fowler, 2004; Stannard, 2022; Plant, 2021).

Fowler keeps simplicity as the default when in doubt, yet allows a broad starting architecture. With large amounts of data and many users, he advises a database from day one (Fowler, 2004). Beck says YAGNI does not apply when the need is real and is no excuse never to design (Beck, 2026). A blog post on evolutionary architecture adds that some decisions are hard to reverse, so one would like as much information as possible before making them (Los Techies, 2010).

Critics name cases where waiting fails. Aaron Stannard argues that over a long horizon new requirements are inevitable. YAGNI fails, in his view, where change is both likely and high-impact, so YAGNI decisions should carry an expiry date (Stannard, 2022). Luke Plant, who calls himself a believer in YAGNI, lists things easier to do early. Logging is often too late once a problem appears, and a client and server should detect versions before a second version exists (Plant, 2021).

Unneeded code in AI-written code Weak evidence: few or small studies support this

AI coding agents write some code that reviewers delete or that is never used. In 1,664 merged pull requests written by AI agents in Python, 2.6% of the methods added were deleted before merge, rising to 9.9% in pull requests that needed revisions (Watanabe et al., 2026b). The deleted methods were longer than those that survived (Watanabe et al., 2026b).

Static analysis finds more unused parts in AI code. Comparing over 500,000 Python and Java samples, AI code was simpler and more repetitive than human code but more prone to unused constructs and hardcoded debugging (Cotroneo et al., 2025). The authors read the many unused arguments as the model copying parameter patterns from documentation or signatures without using them (Cotroneo et al., 2025).

One preprint reports that more capable models write more bloated and coupled code, and that code volume almost perfectly predicts structural decline (Zhu et al., 2026a). Duplicated code in AI output is a separate question, covered in code duplication.

Further reading

  • Fowler (2015): the clearest statement of what YAGNI covers, its four costs of a presumptive feature, and why it depends on cheap change.
  • Parnas (1972) and Parnas (1979): the founding case for designing around anticipated change, by hiding each likely change in a module and building from minimal subsets.
  • Menzies et al. (2017): a test of the delayed-fix cost curve on 171 projects, with a review of where the 100-times figure came from.
  • Kohavi et al. (2020): what large-scale experiments show about how often product ideas fail.
  • Branson et al. (2014): a long-running system’s account of when built-in flexibility paid off and when it caused feature creep.

Known gaps

What this article cannot tell you yet.

  1. No study measures the cost of speculative abstraction or generality in code directly; the evidence covers product features, code smells and defect fixes.
  2. No study measures the cost of a late design change, as opposed to a late defect fix.
  3. The project data in Boehm’s Software Engineering Economics (1981) were not examined.
  4. Imai’s 2022 study of Copilot output and later-deleted lines was not examined.
  5. No study measures speculative or unused features in AI-written code; the AI findings here are proxies such as deleted methods and unused constructs.
  6. Whether modular design lowers the cost of a single late change rests on one firm’s data; the Royce CCPDS-R report and a Mozilla redesign study could not be read.
  7. Sullivan’s 1999 and 2001 papers and Baldwin and Clark’s 2000 book on option value were not read.

References

Solid source
Rated highly trustworthy by the research, and every passage taken from it was found in it.
Weak source
Rated low, or a passage taken from it was not found in it.
Medium trust
Rated medium by the research.
Not checked
Rated high, but its passages could not all be checked against it.
Show all 35 references