Governance
Reuse Before You Rewrite
Most working software is built from parts that already exist. We set out when reusing code is cheaper and safer than rewriting it, and when it is not.
Reuse is the usual starting point
Almost no commercial software is written from nothing. The 2026 Open Source Security and Risk Analysis report, published in March 2026 from audits of 947 codebases carried out between November 2024 and October 2025, found open source in 98 percent of them. Reuse is already the norm. The useful question is not whether to reuse but how deliberately we do it.
The economic case is large, though modelled rather than observed. A Harvard Business School working paper, summarised in March 2024, estimated that firms would pay about 8.8 trillion dollars to rewrite the open source they use if it did not exist. The authors built that figure from code volume, a cost model and wage data, and they note it may understate the value because operating systems were excluded. We read it as an order of magnitude, not a measurement.
Standards bodies point the same way. NIST Special Publication 800-218, published in February 2022, includes a practice titled "Reuse Existing, Well-Secured Software When Feasible Instead of Duplicating Functionality". It gives the aims as lower development cost, faster delivery and a lower chance of introducing new vulnerabilities, and it singles out security functions such as cryptography.
What a rewrite throws away
An essay published in April 2000 on a software engineering blog makes the classic case against starting over. Its argument is that untidy code often carries fixes for edge cases that were found only through real use, so discarding the code discards that knowledge. It adds that a rewrite hands competitors a lead of two or three years, and that teams wrongly expect to do better the second time.
That is the argument of an experienced practitioner, not a controlled study, and we treat it as such. We think it is directionally right, because the cost of a rewrite is mostly the cost of relearning what the old code already knew.
When reuse fails
Reuse is not safe by default. The inquiry board report on the first flight of the Ariane 5 launcher, as reproduced by Oak Ridge National Laboratory, describes a failure on 4 June 1996, about 37 seconds after ignition, caused by a loss of guidance and attitude information. The board traced it to a data conversion from a 64-bit floating point value to a 16-bit signed integer in software carried over from the earlier Ariane 4. That function was retained for commonality, served no purpose on the new vehicle, and the new vehicle built up horizontal velocity five times more rapidly. The report states that no test was performed to verify the unit would behave correctly under the new conditions.
The lesson is narrow and useful. The code had worked on the earlier vehicle. It had not been checked against the conditions of the new one. Reuse transfers the code, but it does not transfer the evidence that the code is right for the new setting.
A worked comparison (illustrative, not real data)
Suppose a team needs a feature and has two options. All numbers below are illustrative, not real data.
Build: 6 engineer-months at 15,000 dollars a month is 90,000 dollars. Maintenance at 20 percent of the build cost per year is 18,000 dollars a year, or 54,000 over three years. Total: 144,000 dollars.
Reuse: integration of 1.5 engineer-months is 22,500 dollars, and vetting the component for 0.5 months is 7,500 dollars. Keeping it updated for 1 engineer-month a year is 15,000 dollars a year, or 45,000 over three years. Total: 75,000 dollars.
The difference is 69,000 dollars in favour of reuse. The more useful number is the break-even. Reuse costs 30,000 dollars up front plus 45,000 dollars for every engineer-month of yearly upkeep. It matches the build total of 144,000 dollars when upkeep reaches about 2.5 engineer-months a year. Below that, reuse is cheaper. Above it, the dependency has become the more expensive choice.
What the evidence does not show
The figures above do not settle the question. The Consortium for Information and Software Quality estimated the cost of poor software quality in the United States in 2022 at no less than 2.41 trillion dollars, of which about 1.52 trillion was accumulated technical debt. The 2026 Black Duck report found at least one vulnerability in 87 percent of codebases and licence conflicts in 68 percent. None of the headline figures we read compares reused code with newly written code, so none shows that reuse causes the problems it measures.
We think the sensible reading is to manage reuse, not to avoid it, because a rewrite would carry defects and licence questions of its own. The common mistakes are reusing without reading the licence, reusing without a record of what was reused, and reusing without testing against the new conditions. Leopard Source and Leopard Ops are designed to serve outside customers as well as the portfolio, and this is a question any team can ask of its own work.
Going deeper
Three formulas make the comparison repeatable. In plain text:
- Cost of building = Build cost + (Annual maintenance cost x Years)
- Cost of reusing = Integration cost + Vetting cost + (Annual update cost x Years)
- Break-even annual update cost = (Cost of building - Integration cost - Vetting cost) / Years
In the example above, the break-even is (144,000 - 22,500 - 7,500) / 3, which is 38,000 dollars a year, or about 2.5 engineer-months at 15,000 dollars a month.
The idea behind these formulas is total cost of ownership, which in our usage means the full cost of a component over its life, not only its build or purchase price. The NIST practice names provenance data such as a software bill of materials, checking for unfixed known vulnerabilities and confirming that a component is still maintained as examples of vetting. The Harvard paper priced its replacement figure using lines of code, the COCOMO II model and wage data.
We publish our sources so that readers can check every figure, and we welcome correction.
Sources
- 01
- 02Open Source Software: The $9 Trillion Resource Companies Take for Granted
Harvard Business School, Working Knowledge · March 22, 2024
HIGH - 03SP 800-218, Secure Software Development Framework (SSDF) Version 1.1 (full text)
National Institute of Standards and Technology · February 3, 2022
HIGH - 04SP 800-218, Secure Software Development Framework (SSDF) Version 1.1 (publication page)
National Institute of Standards and Technology · February 3, 2022
HIGH - 05Things You Should Never Do, Part I
Joel on Software (software engineering blog) · April 6, 2000
MODERATE - 06Ariane 501 Inquiry Board report (copy hosted by Oak Ridge National Laboratory)
Oak Ridge National Laboratory, reproducing the Inquiry Board report · July 19, 1996
HIGH - 07The Cost of Poor Quality Software in the US: A 2022 Report
Consortium for Information and Software Quality (CISQ) · November 1, 2022
MODERATE
Verification Record
- Verdict
- approved
- Verified
- November 10, 2026