Industry TrendsPublished 7 min read

Why Does Unmaintainable Firmware Cost More Over Time?

Unmaintainable firmware costs more because every change, fix, security patch and component substitution takes longer and breaks more often than it should, for the whole life of the product. This article explains the warning signs, the metrics that make the cost visible, a method to estimate it and the remedies, from audit to targeted redesign.

Why Does Unmaintainable Firmware Cost More Over Time?

Unmaintainable firmware costs more over time because the cost of each change keeps rising while the number of changes does not fall. Bug fixes, security patches, new features and replacements for obsolete components all pass through the same code, and when that code is hard to understand or test, each change is slower and riskier. Over a product life of five to fifteen years, that extra cost can exceed what the firmware cost to write.

The difficulty for executives is that the cost is spread out. It appears as slipped release dates, an engineer who cannot take leave, a field fault that takes weeks to reproduce or a customer security questionnaire nobody can answer. None of these is labelled "maintainability" in a budget, so the problem is usually discovered when a key engineer leaves or a critical component goes end of life.

What are the warning signs of unmaintainable firmware?

Each sign has a business effect and a proportionate remedy.

Signs of unmaintainable firmware, their business effect and remedies
Warning signBusiness effectTypical remedy
Only one engineer can build or change the firmwareKey person risk; work stops when they are unavailableReproducible build, documentation and a second trained engineer
Build depends on one PC or an old integrated development environment (IDE) installationReleases cannot be reproduced or auditedScripted build in continuous integration with pinned toolchain versions
No automated tests; releases tested by handRegressions reach customersHost based unit tests for logic and hardware in the loop tests for critical paths
Hardware access scattered through application codePorting to a new microcontroller means a rewriteA hardware abstraction layer introduced module by module
Compiler warnings disabled or ignoredHidden defects and undefined behaviourEnable warnings and static analysis, fix findings by severity
Vendor libraries edited in placeSecurity patches from the vendor cannot be appliedSeparate vendor code from project code and track changes as patches
Timing fixed with delay loops and magic numbersIntermittent faults that are hard to reproduceEvent driven design or a real time operating system with defined priorities

Where does the extra cost appear over the product life?

Poor maintainability charges a premium at every phase after the first release:

  • Feature updates: each new customer requirement touches more code than it should, and estimates become unreliable.
  • Field fault analysis: without logging, diagnostics and clear structure, reproducing an intermittent fault can take longer than fixing it.
  • Security patches: when a vulnerability is published in a library or real time operating system (RTOS), unclear dependencies delay the patched release while customers wait.
  • Component obsolescence: when a microcontroller, radio module or sensor reaches end of life, tightly coupled code turns a part substitution into a partial rewrite.
  • Customer and compliance questions: security questionnaires, software bills of materials and audit requests need knowledge that may exist only in one engineer's memory.
  • Team changes: new engineers take months to become productive, and the departure of one person can stall all releases.

Which metrics make maintainability visible?

Track a small set of metrics per release rather than a large dashboard:

  • Lead time for a small change: days from an agreed small fix to a tested release build.
  • Regression rate: defects found after release that were introduced by that release.
  • Build reproducibility: whether a clean machine can rebuild the exact shipped binary.
  • Static analysis findings by severity, tracked as a trend rather than a target of zero.
  • Test coverage of critical modules such as boot, update, communication and safety related logic.
  • Onboarding time: weeks until a new engineer ships a reviewed change independently.

How do you estimate the cost of poor maintainability?

A practical estimate compares current change cost with what a maintainable codebase would need. Annual excess cost = changes per year multiplied by excess engineering hours per change multiplied by loaded hourly rate, plus field defect cost caused by regressions, plus a provision for forced work such as an obsolescence port. Excess hours per change can be estimated by asking the team to size a few typical changes twice: in the current code and in a clean module.

The following numbers are hypothetical and for illustration only. Suppose a product receives 60 changes a year, each takes 16 extra engineering hours because of manual testing and unclear structure, and the loaded rate is 50 USD per hour. That is 48,000 USD a year in excess effort. If two regressions a year each cause 10,000 USD of field service and support, the annual excess reaches 68,000 USD before counting any port to a new microcontroller. Multiplied over the remaining product life, this figure frames how much an audit or refactoring programme can reasonably cost.

Should you refactor or redesign?

Use a firmware audit to answer this with evidence. A typical decision path:

  • Step 1: Make the build reproducible and put it under version control and continuous integration. Nothing else is safe until this is done.
  • Step 2: Add characterisation tests around current behaviour, especially boot, update and communication, so changes can be verified.
  • Step 3: Rank modules by change frequency and defect history; refactor the few hotspots that carry most of the change load.
  • Step 4: Consider redesign of a module or the whole firmware only when the hardware platform changes, the architecture cannot meet new requirements such as security updates, or refactoring cost approaches rewrite cost.
  • Step 5: Run old and new firmware against the same tests and hardware before switching production.

How do you improve maintainability without stopping feature work?

Few product teams can pause the roadmap for a cleanup project, and they rarely need to. A sustainable approach reserves a fixed share of each release cycle for maintainability work, agreed with product management, and applies a simple rule: any module touched for a feature or fix is left with tests and clearer structure than before. Over several releases, the most frequently changed code improves first, which is exactly where the cost is concentrated. An outside team can help by taking on the groundwork that internal engineers postpone, such as setting up continuous integration, writing characterisation tests, documenting the architecture and running a static analysis baseline, while the core team keeps shipping features.

EmbedCrest supports existing products through a Firmware Health and Security Audit, which reviews codebase, architecture, boot, update, security, real time behaviour and fault handling and returns findings ranked by severity with a remediation roadmap. Follow on work, including debugging, refactoring, redesign, obsolescence ports and security patches, can continue under a product sustenance engagement delivered remotely from our engineering office in India.

Limitations

Be realistic about what an audit or remediation can deliver:

  • Without source code, matching toolchain and hardware samples, remediation is limited and redesign scope grows.
  • Metrics only help if they are measured the same way every release; a single snapshot shows state, not trend.
  • Refactoring changes structure, not features, so it competes with roadmap work and needs explicit time.
  • Certified products may need regression evidence or recertification after significant changes, which affects cost and schedule.

Sources and standards

Practices referenced in this article:

  • MISRA C:2012 (guidelines for C in critical systems)
  • SEI CERT C Coding Standard
  • ISO/IEC 25010 (software product quality model, including maintainability)
  • ISO/IEC/IEEE 12207 (software life cycle processes)
FirmwareTechnical DebtProduct SustenanceCode QualityEngineering Management

EmbedCrest Engineering Team

Embedded Systems Engineers at EmbedCrest Technology

Embedded systems, IoT and Edge AI engineering, delivered from Kalyan, Maharashtra, India.

FAQ

Frequently Asked Questions

How does EmbedCrest take over debugging and redesign of firmware it did not write?

EmbedCrest starts with a Firmware Health and Security Audit to understand the codebase, build and failure history, then debugs, refactors or redesigns under a product sustenance engagement. Useful inputs are source code, toolchain details, schematics and hardware samples. Where source code is missing, we state the reduced options before any work starts.

What does a firmware audit deliver?

A firmware audit delivers findings ranked by severity and a remediation roadmap. It typically covers code structure, build reproducibility, boot and update design, security controls, real time behaviour and fault handling. The roadmap separates urgent fixes, such as update recovery gaps, from longer term work like introducing a hardware abstraction layer.

Is rewriting the firmware from scratch a good idea?

Rarely as a first step. A rewrite loses years of field fixes hidden in the old code and freezes features for months. It makes sense when the hardware platform changes or the architecture cannot meet new requirements. Otherwise, a reproducible build, tests and targeted refactoring of hotspots usually reduce cost with less risk.

How long does it take to see benefits from refactoring firmware?

The first benefits come from a reproducible build and automated tests, often within the first few release cycles, because regressions are caught before shipping. Structural refactoring pays back more slowly, as each hotspot becomes cheaper to change. Measure lead time and regression rate per release to see the effect in your own data.

Ready to Build Your Embedded Solution?

From Edge AI to industrial IoT, our engineering team delivers end to end embedded systems solutions. Let us discuss your project requirements.

Discuss This With an Engineer