embedded software boot camp

Firmware Code of Ethics

September 15th, 2006 by Michael Barr

WE THE MEMBERS OF THE EMBEDDED SOFTWARE COMMUNITY, in order to protect our customers (and their customers) from the risks inherent in our products, extend product lifetimes, lower long-term maintenance costs, promote the general welfare of society, and advance the integrity and reputation of our profession, do hereby ordain and establish the following code of ethical conduct.

Check return codes. If a function can return an error code, it will almost certainly return one eventually. How will our software recover if it doesn’t even know an error has occurred? We will, therefore, always check all return codes. When an error is detected, we will take whatever action is required to recover safely.

Document reasoning. We make dozens of design and implementation decisions each week; we forget the reasoning behind others at a similar pace. We will, therefore, document all of our reasoning in the code itself. Furthermore, we will update these comments if our reasoning changes.

Use version control. Even when done carefully and with discipline, making backup copies of source directories, commenting out code that might be needed again, and tracking changes in comments is insufficient. The use of a good configuration management tool is a must. Furthermore, we agree to always perform a diff and provide a good description of the explanation for all changes each time a file is checked in.

Enforce coding standards. No matter how proud we may be of our abilities, we do not “own” the code we produce. Our employers and clients own it; we and others are hired to develop and maintain it. The true owners have the right to enforce a coding standard upon our work. If they do not choose to exercise this right, we will self-enforce a standard in line with generally accepted programming practices.

Run lint regularly. Compilers are more concerned with generating code than the correctness of your syntax. Only a static analysis tool like lint can watch over our shoulders to ensure we’re not straying into dangerous or non-portable programming constructs. We will, therefore, include lint in our development process. If we don’t remove all code with warnings, we will at least understand why each and every warning remains.

Perform code inspections. Automated tools are helpful, but nothing is better than a peer review for finding logic errors. Code inspections have been shown to be many times more efficient than any other single debugging tool. We will always review our code as a group at least once before each release.

Assign one tester to every developer. Programmers make lousy testers, especially when it’s their own code they’re testing. For best results, one independent tester should be hired for every developer. And the testing team must maintain and rerun regression tests regularly, to certify that a new release is at least as good as the previous one.

Measure performance. Of course, there are some kinds of tests that are best performed by the engineers themselves. In real-time systems, we shall directly measure interrupt latency and the time it takes each of our critical subroutines to complete. An oscilloscope and a spare I/O pin are quite handy in this regard.

These best practices are easy things to do, and all are inexpensive to implement. A one or two person design team can as easily follow these rules as a 50-person engineering department. If you aren’t following these rules today, there are no excuses for tomorrow.

Netrinos

March 1st, 2006 by Michael Barr

I’m often asked where the name Netrino came from. The Netrino name and NETRINO.COM domain registration actually predated Netrino, LLC. Back then I was living with two friends and fellow engineers post-college. The three of us wanted to share one Internet pipe (dial-up, mind you, as this was 1996) into the house, then split it off from there. For whatever reason, we also wanted to host our own mailserver and webserver on the 386 Linux box that was going to serve as the gateway.

We chose the name Netrino after some brainstorming, probably because we liked the sense of “little network” and allusion to small particles called neutrinos. The name stuck, and when we moved apart I took it for my business in trade for free e-mail and webhosting for the others for as long as I continue to operate it.

After escaping a trademark infringement complaint from QNX’s Neutrino RTOS in the early days of my firm, I’ve noticed several other Netrino’s on the Internet. For example, there’s the Greek movie Netrino (1999), about which I know nothing. There’s also a British webdesign firm called Netrino.net; given their origins as an ISP, I bet they noticed the “little network” connotation too.

How To: Quickly Suggest Websites to Friends

January 4th, 2006 by Michael Barr

A friend of mine recently asked me if I knew of a way to quickly forward web pages of interest to friends and coworkers. This guy and I have been sending short e-mails with such links for more than a decade. So my first response was: What’s so hard about writing an e-mail? But then I got to thinking about how RSS might be used to forward such links around the web more easily.

After some digging and asking around, I learned this is a way to do this if all of the interested parties are del.icio.us users. Here’s how:

Step 1. Each of you should create a free account at http://del.icio.us For example, I’m known there as “frappucino”.

Step 2. Learn how to keep your bookmarks on del.icio.us and tag webpages you might want to visit again. There are several advantages of using del.icio.us for this purpose, not the least of which is you can access your bookmarks from anywhere in the world. I’ve even gone so far as to make my del.icio.us page the home page in all of my web browsers.

Step 3. There are two available methods for quickly sharing bookmarks through your social network:

  • The first method uses the special “for:” tag and operates via push; that is the sender of the link gives it a shove in your direction by tagging that page “for: username” (e.g., “for: frappucino” would recommend the page to me).
  • The second method requires the receiver to sign up to subscribe to one or more tags you use. They do this in their “inbox.” For example, I’ve chosen to subscribe to pages tagged “vc” by a friend of mine I know follows the venture capital community closely.

Here’s more info about this and other things del.icio.us. Note that friends or colleagues who don’t want to create their own del.icio.us account could simply subscribe to your del.icio.us feed at http://del.icio.us/rss/username via their favorite RSS reader.

My First Patent

December 28th, 2005 by Michael Barr

I’ve had several pending for a while, but my first patent was issued last week. It concerns the calibration of a brake-driven physical therapy product Netrino worked on several years ago for Baltimore Therapeutic Equipment.

Going Pro

December 11th, 2003 by Michael Barr

The recent introduction of the .PRO top-level Internet domain, short for “professional,” and especially the narrow restrictions placed upon its use have got me thinking: Why don’t engineers qualify as professionals? According to the charter of .PRO, only “doctors, lawyers, and accountants” qualify to register such domains. I could not, for example, register the domain MICHAELBARR.PRO and thus market my services as an engineer on the Web.

Why are such folk as doctors, lawyers, and accountants often considered professionals by distinction from other workers? Why aren’t engineers members of that elite group? Like doctors, engineers attempt to debug complex systems and prescribe solutions and workarounds that may or may not work. Like lawyers, we are masters of arcane languages and skilled in making stuff work even in the face of seemingly bad precedents. And like accountants, we sit in our cubicles and crunch numbers—and thus make someone else’s life easier. All four professions are known to pay well and consist predominantly of white collar work.

It cannot simply be that only doctors, lawyers, and accountants are certified to practice in a particular state, as there are professional licensing examinations and boards for engineers in all states too. Engineers who’ve been licensed in this way are generally termed “P.E.’s”, an abbreviation that is short for Professional Engineer. In some states and fields of engineering P.E. licenses are, in fact, requirements for the performance of related engineering work.

I wonder if the crux of the matter isn’t simply that engineering, as a profession, hasn’t been around as long as those other fields. Or perhaps it’s that engineers and the role they play in our society hasn’t, until fairly recently, been as large or important as it is today. In a sense, perhaps the empowering of doctors, lawyers, and accountants with the imprimatur of the state—which developed as the importance of these professions to large numbers of people increased over a long history—is what really made them into elite professionals.

Based on the demonstrated long-term success of the three professional fields, it seems like anything we engineers, as a group, could do to make ourselves more like professionals would be good for individual engineers, the wider group, and society as a whole. For example, during the current downturn there has been much worry that engineering jobs are disappearing overseas. If, however, it was a requirement that any engineer involved in the design of a safety-critical product (or one simply to be approved by the FDA or FAA or another government agency) be certified by the state, such jobs would be tied to this country.

Another upside of the professionalization of engineering might be the wrenching of the power over engineering out of the hands of corporations and management and into the hands of independent engineering firms. Like law firms, such engineering companies would be skilled in specific areas of engineering and licensed to practice in one or more states. They might work on all sorts of different products for all sorts of different companies—essentially based on an hourly billing system that would properly emphasize the quality of the work over meeting a specific deadline.

To accomplish this, of course, more and greater emphasis would need to be placed on continuing education, engineering ethics, and state licensing. Most engineers today get basically no continuing education, which might have something to do with why older engineers as a group are often sidelined or pushed into management. Most engineers today are likewise also not schooled in ethics or licensed in any way; but maybe we should be.

What do you think? Do individual engineers, such as embedded systems designers, have more to gain from state licensing and continuing education than they have to lose? What about society or the greater profession?