[ Go to August 1997 Table of Contents ]

Dialog Box /
Mike Kelly
Mike Kelly

Wanted: Code Editors
We need a new player in the software development drama, a role for which testers have already auditioned: a code editor.

The other day, I received a bug report from a software tester on my team. Typically, bug reports list a series of user actions ("pull down this menu, select this item, check this box," and so on) that cause problems ("result: app crashes"). Until I received this report, I thought that was all testers did: Mimic users determined to expose every boundary condition and unexpected combination of actions. We developers love them for it, preferring our mistakes to be discovered internally rather than in the marketplace.

Yet this particular bug report wasn't written from a user's perspective. It said, "On line 673 of ReadRegistry, you allocate memory that will never be freed if you take the error returns on lines 795 or 807." I called the tester. "How'd you find this?" I asked. "I read the code," he replied.

Such an error would have been difficult to find using normal user-oriented testing methods. Our memory allocator reports memory leaks while debugging versions of the product, but a tester would have had to encounter one of two unusual error conditions to notice it. When reviewing the code, though, the oversight was obvious.

Of course, developers should schedule regular code reviews to catch these mistakes-and we should brush after every meal and never get more than 30 percent of our calories from fat.

Yet even if a regular code review had been done, this error wouldn't have been caught. Such reviews are done when the initial coding of the routine is complete. The two error returns this tester uncovered were added in response to a separate bug, well into the bug-fixing cycle, when code reviews are even more infrequent.

What's really needed is a new player in the software development drama, a role for which these testers auditioned: a code editor.

An editor would be the buffer between the developer and the product-just as a magazine editor is the buffer between the writer and the printed page.

Most organizations have adopted software coding standards. But adherence to these standards is left to the individual developer and to the occasional code review. Editors could be the keepers of the software stylebook. This is more than trivia; on large development teams, standards enable me to understand code written by someone else.

More importantly, code editors could serve as fact checkers. They would watch for unhandled boundary conditions, missed cases, memory leaks, omitted error handling-all the common mistakes we usually find only when we force testers to be 800-pound gorillas jumping on our product for months. And as product development cycles adjust to "Internet time," catching bugs early takes on even greater importance.

So are editors testers or developers? A little of both, really. Editors need to understand more about writing software than most testers and even more than some developers. A good editor also understands the art of writing efficient, elegant code and might suggest changes that compress 10 lines to four. At the same time, editors stand at the front lines of the test team, stopping bugs before they get into the shared code base.

Editors may also develop automated tools, but they'd appreciate that these tools, just like automatic grammar and spelling checkers, can only go so far in replacing what the eye catches.

There's a shortage of good developers now, and many of the skills that would make a good code editor also make a good developer. So I doubt the role of code editor will emerge any time soon; we'd rather put editors to work writing code and fixing bugs. But as we reach a plateau in software growth and have more skilled developers and testers than we can use, putting some to work as code editors could be a great way to improve software quality.

Mike Kelly is a lead software design engineer on the Office team at Microsoft Corp. This column does not necessarily reflect the opinions of either Microsoft Corp. or WINDOWS Magazine. Contact Mike care of the editor at the e-mail addresses here. Have an opinion (or a gripe) about Windows computing you'd like to share? Send it to Diganta Majumder at the e-mail addresses here.


Windows Magazine, August 1997, page 59.

[ Go to August 1997 Table of Contents ]