Embedded Muse 92 Copyright 2004 TGG January 20, 2004
You may redistribute this newsletter for noncommercial purposes. For commercial use contact email@example.com.
EDITOR: Jack Ganssle, firstname.lastname@example.org
- Editor’s Notes
- Standard integers in C
- Bug Tracking Software
- Joke for the Week
- About The Embedded Muse
I’m working on a series of articles that will run in Embedded Systems Programming magazine about debouncing switch contacts. After thousands of presses on a couple of dozen switches my fingers are calloused, but I have a pile of data about the characteristics of bounces. Watch the magazine or embedded.com in April for details.
The next step is to implement and evaluate various debouncing algorithms. Send me your favorite!
There are no current plans to host a public Better Firmware Faster seminar in the near future. I often do this seminar on-site, for companies with a dozen or more embedded folks who’d like to learn more efficient ways to build firmware. See http://www.ganssle.com/onsite.htm for more details.
Standard Integers in C
Michael Barr’s latest piece (http://embedded.com/showArticle.jhtml?articleID=17300092) talks about a much neglected coding practice. As is well known, C doesn’t define word sizes; an int can be pretty much any length. What were those wacky K&R guys thinking? As a result porting code between CPUs with different word sizes can be as exciting as using power tools in the bathtub.
The C99 standard does solve the problem, defining standard data types as follows:
8 bit: int8_t uint8_t
16 bit: int16_t uint16_t
32 bit: int32_t uint32_t
64 bit: int64_t uint64_t
Seems to me wise developers will avoid the use of the “int” declaration in favor of these standard names. If your compiler isn’t C99-compliant, define the C99 types in an include file named stdint.h via typedefs.
I’ve updated my Firmware Standards Manual to include this convention; it’s available at www.ganssle.com/misc/fsm.doc.
Do you have a schedule? I mean a real schedule, one that lists a project’s tasks in detail. Probably there’s an estimated completion time next to each task. Sum those, multiply by some fudge factor, and out pops the ship date.
Problem is, most schedules are static. We produce them, and the boss then uses the document (yellowing with age as the project drones on) to berate and motivate.
Yet we know the schedule is fluid, our estimates best guesses, not precise calculations. Excellent teams work on the schedule document constantly, throughout the project. Every day, record actual times next to estimated times. If you never compare your guesses to what really happens, there’s no way to improve your estimation skills. And when the boss wants to know where all the time is going, instead of shrugging your shoulders like a bored teenager you can give him hard statistics.
One developer recently complained that it’s too hard to remember to log the hours at the end of each day. Nonsense.
“Quality Is Personal: A Foundation for Total Quality Management” by Harry Roberts is one of the best books about quality. His main thesis is that trying harder is a lousy way to improve things. It’s much more effective to change something, to alter your habits, to transform your environment.
Trying harder to stick to a diet won’t work; better, keep only healthy food in the house. Annoyed that you always forget your cell phone? Keep it next to the wallet, so will get scooped up when you waltz out the door. If you can never save money and promise yourself yet again to try harder, you’ll likely fail. Have the bank auto-transfer a sum each month.
In the case of logging hours at the end of the day, don’t just try harder to remember to write it all down – that simply will not work. Change something. In the morning stick the car keys under a reminder note. Have a pop-up note automatically remind you first thing in the morning to log yesterday’s work. Write “Log Hours” in the bottom of your coffee cup.
Stop trying so hard and reinvent the process.
Bug Tracking Software
There’s a poll about bug tracking software on www.ganssle.com. At the moment the results look like:
35% - No bug tracking software used
26% - On other than those itemized listed
13% - PVCS Tracker
12% - Bugzilla
4% - TestTrack
3% - PR-tracker
2% - Visual Intercept
2% - Track
2% - GNATS/PRMS
It’s interesting that 35% of respondents use no bug tracking tools at all. The optimist in me hopes this means these folks fix bugs as soon as they’re found; they never have outstanding bugs that need to be tracked.
Most projects eat 50% of the schedule in debugging. It’s important to log bugs during that effort, even if just managed in a spreadsheet or word processing doc. The log is a retrospective, an accurate history of fully half of the project. If we can glean some understanding from the bug log we can improve, reduce our defects, and slice a big chunk out of the schedule. It’s a feedback loop, and all engineers know that feedback stabilizes systems.
In the “other” category folks wrote in about a few products. Many use Rational’s ClearQuest, though none passed along any positive or negative comments about the product.
The GPL’ed Mantis got several favorable comments. Most felt that though Mantis is somewhat simple, its clear interface appealed greatly, especially when compared to the more cluttered screens sported by Bugzilla.
FogBugz, too, was praised for its lack of featuritis and reliable operation. BugCollector Pro had similar comments.
Hit the site and add your vote!
Joke for the Week
Squirt the Bird: To transmit a signal to a satellite.
Stress Puppy: A person who seems to thrive on being stressed out and whiny.
Swiped Out: An ATM or credit card that has been rendered useless because the magnetic strip is worn away from extensive use.
Assmosis - The process by which some people seem to absorb success and advancement by kissing up to the boss rather than working hard.
Beepilepsy - The brief seizure people sometimes have when their beeper goes off (especially in vibrator mode). Characterized by physical spasms, goofy facial expressions and interruption of speech in mid-sentence.
PEBCAK - Tech support shorthand for "Problem Exists Between Chair and Keyboard."
Uninstalled - Euphemism for being fired. Heard on the voicemail of a vice president at a downsizing computer firm: "You have reached the number of an uninstalled vice president. Please dial our main number and ask the operator for assistance." See also Decruitment.