A couple of years or so ago, I had the pleasure of meeting Peter Coffee, who now works for Salesforce.com, but back then was Technology Editor at eWeek. We showed Peter our CQ2 product, and one of his comments went along the lines of “It’s only a matter of time before we start to see source code quality brought up in litigation cases.”
Rick Mueller is a DUI criminal defense lawyer who, on his blog, reproduced the transcript of a paper given by William C. Head and Thomas E. Workman Jr. at the International Council on Alcohol, Drugs and Traffic Safety in Seattle on August 30th. The paper is titled “An Analysis of ‘Source Code’ Litigation in the United States.” The transcript is long, but makes for fascinating reading, in my opinion, because it’s the first time I’ve come across a real example of what Peter Coffee was talking about.
I found their analysis, from a purely legal standpoint, of the state of software quality to be quite interesting.
Head and Workman start out by stating something that we all know to be true, but bears stating nonetheless: “All non-trivial software has defects.” That in itself is good news for an attorney, I guess. They go on to state that, unlike hardware components, which may simply have worn out, defective software works exactly the same way in every machine that contains the same software. So, you can’t compare results from two identical machines to find out which one has the defective “part”.
Head and Workman provide a kind of attorney’s guide to software development, in which they make some interesting observations:
Specialization and multiple handoffs
“The programmer who writes the source code is usually not the scientist upon whose science the machine is based,” they say, and then go on to point out that many others are involved in the production of the finished product. “With each handoff, opportunity for misunderstanding and mistakes in the final product, the source code, increases thereby degrading the quality of the product.”
Comments
Good programmers write comments, they say, but comments “often pose suspicions about problems that have been elusive and have not been specified and may not have been corrected. They may also contradict the instructions to the computer, as represented in the source code, meaning that either the comments are wrong, or the software is not correctly written.” You can’t argue with that!
Debugging code
If anyone’s ever left any debugging code in production software, look out: “Programmers often record information that will be helpful in resolving ongoing errors and defects. An examination of the source code will usually reveal extra steps that are not necessary to the computation of the results, but which will record information that relates to actual or potential error conditions. The mere existence of this kind of activity suggests that the programmers are trying to collect additional information in order to resolve problems they have seen, but have been unable to isolate and fix.”
Testing
This section includes an interesting analysis of why testing every path through even a small program would be impossible. Their example assumes a 1,000 line program with a 2-way control statement every 20th instruction. That gives a total of 1,125,899,906,842,620 unique paths through the code, which, even at one minute to run and check the results for each path, would take one person a total of 2 billion years to complete the testing.
Defect rates
The good news is, they tell us, that we can estimate the number of defects in any piece of code by applying the average of 25 defects per 1,000 lines of code. Thus: “The estimated number of defects is calculated by multiplying the number of lines of code by 25, and dividing that product by 1,000.”
Code reviews
“A computer scientist,” Head and Workman tell us, “preferably with a background in verifying software quality, can frequently find defects in software by “reading” the source code. In addition, source code may be reviewed automatically through automated review of the source code.” “When a DUI-DWI defense attorney requests the source code for a Breath Testing Machine, it is with an aim to conduct a “code review” to look for defects.”
There’s nothing in here that we don’t already know about. But, I find it intriguing that the legal profession is starting to familiarize itself with these concepts with a view to using the weaknesses in our quality processes to question the integrity of information and analysis provided by software.
Leave a comment »