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.
| Warning sign | Business effect | Typical remedy |
|---|---|---|
| Only one engineer can build or change the firmware | Key person risk; work stops when they are unavailable | Reproducible build, documentation and a second trained engineer |
| Build depends on one PC or an old integrated development environment (IDE) installation | Releases cannot be reproduced or audited | Scripted build in continuous integration with pinned toolchain versions |
| No automated tests; releases tested by hand | Regressions reach customers | Host based unit tests for logic and hardware in the loop tests for critical paths |
| Hardware access scattered through application code | Porting to a new microcontroller means a rewrite | A hardware abstraction layer introduced module by module |
| Compiler warnings disabled or ignored | Hidden defects and undefined behaviour | Enable warnings and static analysis, fix findings by severity |
| Vendor libraries edited in place | Security patches from the vendor cannot be applied | Separate vendor code from project code and track changes as patches |
| Timing fixed with delay loops and magic numbers | Intermittent faults that are hard to reproduce | Event 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)

