Page 20 - The Art of Designing Embedded Systems
P. 20
Disciplined Development 7
Two decades later nothing has changed. . . except that firmware is
even more expensive.
What Does Firmware Cost?
Bell Labs found that to achieve 1-2 defects per 1000 lines of code
they produce 150 to 300 lines per month. Depending on salaries and over-
head, this equates to a cost of around $25 to $50 per line of code.
Despite a lot of unfair bad press, IBM’s space shuttle control soft-
ware is remarkably error free and may represent the best firmware ever
written. The cost? $lo00 per statement, for no more than one defect per
10,000 lines.
Little research exists on embedded systems. After asking for a per-
line cost of firmware I’m usually met with a blank stare followed by an ab-
surdly low number. “$2 a line, I guess” is common. Yet, a few more
questions (How many people? How long from inception to shipping?) re-
veals numbers an order of magnitude higher.
Anecdotal evidence, crudely adjusted for reality, suggests that if you
figure your code costs $5 a line you’re lying-or the code is junk. At
$100/line you’re writing software documented almost to DOD standards.
Most embedded projects wind up somewhere in between, in the $2040/line
range. There are a few gurus out there who consistently do produce qual-
ity code much cheaper than this, but they’re on the 1% asymptote of the
bell curve. If you feel you’re in that select group-we all do-take data for
a year or two. Measure time spent on a project from inception to comple-
tion (with all bugs fixed) and divide by the program’s size. Apply your
loaded salary numbers (usually around twice the number on your pay-
check stub). You’ll be surprised.
Quality Is Nice. As Long As It’s Free
The cost data just described is correlated to a quality level. Since few
embedded folks measure bug rates, it’s all but impossible to add the qual-
ity measure into the anecdotal costs. But quality does indeed have a cost.
We can’t talk about quality without defining it. Our intuitive feel that
a bug-free program is a high-quality program is simply wrong. Unless
you’re using the Netscape “give it away for free and make it up in volume”
model, we write firmware for one reason only: profits. Without profits the
engineering budget gets trimmed. Without profits the business eventually
fails and we’re out looking for work.

