Please create an account to participate in the Slashdot moderation system

 



Forgot your password?
typodupeerror
×
The Courts Government Privacy Software News

Court Orders Breathalyzer Code Opened, Reveals Mess 707

Death Metal writes with an excerpt from the website of defense attorney Evan Levow: "After two years of attempting to get the computer based source code for the Alcotest 7110 MKIII-C, defense counsel in State v. Chun were successful in obtaining the code, and had it analyzed by Base One Technologies, Inc. By making itself a party to the litigation after the oral arguments in April, Draeger subjected itself to the Supreme Court's directive that Draeger ultimately provide the source code to the defendants' software analysis house, Base One. ... Draeger reviewed the code, as well, through its software house, SysTest Labs, which agreed with Base One, that the patchwork code that makes up the 7110 is not written well, nor is it written to any defined coding standard. SysTest said, 'The Alcotest NJ3.11 source code appears to have evolved over numerous transitions and versioning, which is responsible for cyclomatic complexity.'" Bruce Schneier comments on the same report and neatly summarizes the take-away lesson: "'You can't look at our code because we don't want you to' simply isn't good enough."
This discussion has been archived. No new comments can be posted.

Court Orders Breathalyzer Code Opened, Reveals Mess

Comments Filter:
  • Coding Standard (Score:1, Interesting)

    by Jack9 ( 11421 ) on Thursday May 14, 2009 @03:37PM (#27955357)

    nor is it written to any defined coding standard

    Er, why would it need or be expected to be? It's a commercial product. I don't think most bank websites are "coded" to any specific standard either.

  • Windows (Score:1, Interesting)

    by Anonymous Coward on Thursday May 14, 2009 @03:46PM (#27955501)

    And the kicker? The new version of the breath tester runs Windows:

    While Draeger's counsel claims that the "The Alcotest [7110] is the single best microprocessor-driven evidential breath tester on the market", Draeger has already replaced the antiquated 7110 with a newer Windows® based version, the 9510. The computer code in the 7110 is written on an Atari®-styled chip, utilizing fifteen to twenty year old technology in 1970s coding style.

    Good luck getting the source code for that one, or analyzing it for bugs.

  • DUH.... (Score:5, Interesting)

    by Lumpy ( 12016 ) on Thursday May 14, 2009 @03:48PM (#27955549) Homepage

    If you got your hands on and analyzed the sourcecode to most DVD' players, TV's (Panasonic runs linux!) and other devices that are complex you will discover that in order to ship it earlier the code is an utter mess.

    Programmers are not joking when we complain about the "It compiles? Ship it!" statement.

    the fault is the Executive staff that refuse to listen to their experts (programmers) and do what they recommend. Instead we get morons that know nothing about programming making unrealistic deadlines and forcing death march coding marathons to give up the mess we have today.

  • Re:Coding Standard (Score:3, Interesting)

    by 0100010001010011 ( 652467 ) on Thursday May 14, 2009 @03:50PM (#27955597)

    Some of this stuff is elementary math.

    2. Readings are Not Averaged Correctly: When the software takes a series of readings, it first averages the first two readings. Then, it averages the third reading with the average just computed. Then the fourth reading is averaged with the new average, and so on .... the comments say that the values should be averaged, and they are not.

    It's been a while but didn't the teacher in 5th grade show you why that wouldn't work?

    Or how about this:

    The A/D converters measuring the IR readings and the fuel cell readings can produce values between 0 and 4095. However, the software divides the final average(s) by 256, meaning the final result can only have 16 values to represent the five-volt range (or less), or, represent the range of alcohol readings possible.

    Who the hell didn't pay attention in the A/D quantization error in controls class?

    I don't want to fill my whole comment with copy and paste from TFA, but not only is this a code standard issue. It's just plain stupidity. Error checking, out of range checking all sound like something a first year programmer should have gotten right.

    I can't say all my MATlab and CANape scripts look pretty or are up to any coding standards, but I try to at least get the basic shit right.

  • Re:Lint is crap (Score:5, Interesting)

    by TigerNut ( 718742 ) on Thursday May 14, 2009 @03:58PM (#27955741) Homepage Journal
    The thing is that probably 95% of the Lint reports could have been fixed by the code designers, just by making appropriate declarations or a bit of type casting. The fact that 60% of the source is reported by Lint, indicates that the designers never bothered to do any kind of static code checking or to clean up warnings, and that points to a lack of care during development and testing.

    At a previous job we had to buy a third-party driver for an embedded PCMCIA controller. The software vendor delivered code that (the first time around) produced about 1200 lines of warnings when we compiled it. We queried them about it and they responded that "we don't compile with warning output enabled". Our reply to them was that our coding standard was that the compile would fail on warnings, and we wouldn't accept their code unless they fixed all the warnings... they cleaned up their act, and fixed a couple of previously unresolved problems in the process.

  • by bcrowell ( 177657 ) on Thursday May 14, 2009 @04:05PM (#27955883) Homepage

    If I were the manufacturer, at this point I'd say: (1) lawyers are expensive; (2) competent programmers are expensive, but less expensive than lawyers; (3) our business is selling the beathalyzer, not the software, so we gain nothing by keeping the source secret; (4) this publicity is hurting us; (5) let's hire some more competent programmers to clean up the code, and then we can make it public; (6) profit!

    This is different from the case of the voting machines. In the case of a voting machine, there are lots of people who might be motivated to hack it, lots of people have access to the machines, and it only takes one compromised machine to throw a close election. If you believe in security by obscurity, then there is at least some logical argument for keeping the voting machine code secret. In the case of the breathalyzer, there's not even that lame argument.

  • Re:But does it work? (Score:5, Interesting)

    by MozeeToby ( 1163751 ) on Thursday May 14, 2009 @04:13PM (#27956039)

    No, but some no trivial amount of code is running the x-ray machine at the dentist, processing my credit card, managing my fuel injection, saving my thesis paper, and timing stoplights throughout my city.

    We trust our lives and livelihoods to shitty code every day and the plain fact of the matter is that shitty code usually works. As programmers we like to think of ourselves as artists; creating a master piece of perfectly engineered code. In reality, all projects face budget and time constraints, most projects have legacy code which is hard to maintain, and most teams have at least one guy who just doesn't get it.

    If the code works, and you can show empirically that the code works, that is proven beyond a reasonable doubt it my opinion. Not beyond any doubt, but that isn't the standard that our justice system is based upon.

  • Re:But does it work? (Score:5, Interesting)

    by digitalunity ( 19107 ) <digitalunity@yah o o . com> on Thursday May 14, 2009 @04:16PM (#27956093) Homepage

    Actually, research I read when I got my DUI in 2007 seemed to indicate the release of alcohol vapors into the air by the lungs can vary widely between persons, by as much as 20%.

    This has nothing to do with body size, type or metabolic rates that I'm aware of, but more research is obviously needed for the scientific community to reach a consensus. The sampling process is fundamentally flawed but the courts have routinely rejected any evidence to the contrary.

    I don't know about 49 of the states, but in Washington state, if you want something more accurate than a breathalyzer, you have to demand the police take you to the hospital to have blood drawn at your own expense. They are required by law to comply, but 99% of DUI suspects know nothing of their rights.

    If I got pulled over again that same night, I would have driven home without a DUI and even if they did manage to get me to perform parking lot special olympics(also called the field sobriety test), I would have asked for a lawyer. Like most first time offenders, I took a plea deal to avoid significant jail time and paid the ridiculous fine and took alcohol awareness classes. The whole thing was a farce, intended to make money.

    I blew .086% and easily could have challenged the results in court, given the breathalyzer had a sticker on it that said it hadn't been calibrated in 2 years.

  • Re:Lint is crap (Score:5, Interesting)

    by MadShark ( 50912 ) on Thursday May 14, 2009 @04:21PM (#27956205)

    I work on embedded system stuff every day. At the end of the day, there are NO lint warnings in my code. First, I tend to avoid coding practices and designs that generate lint warnings. By and large, lint warns for a good reason most of the time. Second, in the limited number of situations where lint flags something incorrectly, there are methods for silencing the warnings via special comments. I'm currently working on a 50000 line project, and there are about 70 places in the entire code base were we had to tell lint to ignore a warning. Each warning suppression is documented as to why lint is incorrect.

    Lint isn't a perfect tool by any means but in my opinion, anyone developing C code without it is not acting in a professional manner.

  • Re:Coding Standard (Score:3, Interesting)

    by Jack9 ( 11421 ) on Thursday May 14, 2009 @04:27PM (#27956301)

    Lots of evidence in court (like say, testimony) are not held to a documented standard. That isn't a very good argument imo.

  • Re:But does it work? (Score:5, Interesting)

    by geekgirlandrea ( 1148779 ) <andrea+slashdot@persephoneslair.org> on Thursday May 14, 2009 @04:28PM (#27956345) Homepage

    Well, if we assume the machine was sensitive up to the LD50 for ethanol of 0.5% BAC, then with only 4 bits of precision the uncertainty just from the rounding error is comparable to the difference between being over the limit and being completely sober. This was covered in the comments on Bruce Schneier's blog [schneier.com]. That one's probably wrecked a few peoples' lives too.

  • Re:But does it work? (Score:3, Interesting)

    by Rene S. Hollan ( 1943 ) on Thursday May 14, 2009 @04:31PM (#27956399)

    Yes, but in WA you can be convicted under DUI with 0% BAC.

    The "influence" does not have to be alcohol, nor an identifiable chemical intoxicant.

    Driving erratically is evidence enough of being "influenced".

  • Re:But does it work? (Score:3, Interesting)

    by Anonymous Coward on Thursday May 14, 2009 @04:33PM (#27956435)

    To get more convictions... this makes sense now.

    Common wisdom holds that the end of a breath from the "bottom" of the lungs contains a higher percentage of alcohol than the main body of the breath, this is held to be why the officer will tend to tell you to push harder to get that last higher sample into the device. If anything sets off the machine, it'll be that last bit with a more concentrated sample.

    Whether that reflects the *actual* blood alcohol level in any well defined and useful fashion needs to be explored some more.

  • Re:But does it work? (Score:5, Interesting)

    by TheEldest ( 913804 ) <theeldest@gm a i l . c om> on Thursday May 14, 2009 @04:47PM (#27956737)

    This seems to make sense to me. The breathalizer is supposed to measure the blood alcohol content, and this is done by measuring the alcohol content in air expelled by the *lungs* (with a knowlege of partial pressures).

    But if you equally weight beginning readings with ending readings, then you can be skewed by the first reading, which comes from the air in the mouth, instead of the lungs (giving low scores for people with time since their last drink, and people high scores with a recent last drink).

    I would think that this method would give a more accurate reading by filtering out the readings from 'mouth air' and giving preference to 'lung air'.

    But regardles, tests should have been done using both methods, and comparing to blood test to see which returns more consistantly accurate results. I wonder if those tests need to be made public as well.

  • Re:But does it work? (Score:5, Interesting)

    by SoupGuru ( 723634 ) on Thursday May 14, 2009 @04:48PM (#27956749)

    Remember when it used to be you couldn't drunk drive?
    Then it was you couldn't be behind the wheel while drunk?
    Then it became you couldn't even be in the driver's seat with the car off while drunk?
    Then it became you couldn't drive if you couldn't get out and walk in a straight line?
    Then it became reciting your alphabet backwards...
    Then suddenly, you couldn't have an arbitrary percentage of alcohol in your blood to do all those things.
    Then it became whatever the machine said your blood alcohol might be.

    There are no laws against drunk driving anymore. There are laws about not being able to potentially operate a vehicle if a machine determines you have enough alcohol on your breath.

  • Re:But does it work? (Score:5, Interesting)

    by Grishnakh ( 216268 ) on Thursday May 14, 2009 @05:02PM (#27956973)

    I disagree. Anything upon which guilt or innocence rests on needs to be held to a higher standard.

    For many other applications, especially non-government ones, if the code doesn't work well, then customers probably aren't going to buy it, and changes will be made. For instance, your example of fuel-injection code. If you don't do that correctly, you're going to have an engine that runs like crap and get poor economy. Cars that run poorly generally don't sell well. They might sell some, but as we see with GM and Chrysler, you have to do better than that to avoid bankruptcy.

    Saving your thesis paper? The code in TeX is probably some of the most bug-free code around. At least I hope you're using TeX and not something crappy like MS Word for a thesis. But even MS Word isn't that bad, since so many businesses rely on it and don't have problems with random data corruption to my knowledge.

    Timing stoplights is a good counterpoint to your example. In my experience, stop lights have horrible timing most places I go. It's almost like they're intentionally designed to make you stop at every single light, unless you drive at > 80mph on surface streets. Why is such poor performance accepted from our traffic lights? Because they're run by the government, and we the people don't have a choice. That's exactly the same as this breathalyzer crap: if you're accused, you don't get a choice about which breathalyzer they use on you. It's decided by the government (probably with help from bribes), and that's what they use, whether it works well or not.

  • Re:But does it work? (Score:5, Interesting)

    by The Moof ( 859402 ) on Thursday May 14, 2009 @05:03PM (#27956991)
    Don't always assume the judge will, in fact, look at the evidence and arguments. In their eyes, it doesn't look good to overturn a DUI conviction. Period.

    Had a buddy of mine leave a night club and he got pulled over for supposedly making an illegal left turn. Blew over the state's .07 and got arrested per the usual.

    However, the judge didn't care that there was no reason to be pulled over (with photos of the left-turn sign) since the cop explicitly said it wasn't due to erratic driving, *only* the 'illegal' left turn. Examples must be made. DUI upheld.

    Hell, even I got pulled over once for simply driving at 2am, but my breathalyzer revealed a stunning 0.00% BAC. After chatting with the cop for a bit, turns out they were just looking for easy DUI targets, and I happened to be driving on the same road as them.
  • Re:But does it work? (Score:3, Interesting)

    by cayenne8 ( 626475 ) on Thursday May 14, 2009 @05:40PM (#27957693) Homepage Journal
    "Actually, it measures presence/absence of ketones in the air. Also, they have you blow "continuously" for several seconds (the mouth doesn't hold that much). Finally, .08 is considerably drunk, but it isn't you're-falling-over-how-could-you-possibly-think-you-could-drive drunk."

    Keytones!?!

    So, I wonder if you could make an argument against this evidence if you are on Atkins or some other form of low carb diet that puts you into a constant state of ketosis?

    And as for .08...that is NOT drunk, not for most people. The .1 was more fair, but, .08 can get a grown man on just a few glasses of wine with a meal depending on situation.

    It really should be more subjective somehow...I mean, you can have someone that is severely impared on 2 drinks, and another big fella that can have 4-6 beers in a short period and be perfectly fine. I guess they had to have a number somewhere, but, .08 is WAY too low.

    I really hope some of the attempts to break the feds power over the states by blackmailing them over funding can work here soon. It was the MADD groups that are really after NO drinking permitted that forced them to force all the states to raise the drinking age to 21...and lower the limit to .08.

    The feds should NOT have that power.

  • Re:But does it work? (Score:1, Interesting)

    by IDtheTarget ( 1055608 ) on Thursday May 14, 2009 @05:51PM (#27957917)

    Actually, research I read when I got my DUI in 2007...If I got pulled over again that same night, I would have driven home without a DUI and even if they did manage to get me to perform parking lot special olympics(also called the field sobriety test), I would have asked for a lawyer. Like most first time offenders, I took a plea deal to avoid significant jail time and paid the ridiculous fine and took alcohol awareness classes. The whole thing was a farce, intended to make money.

    I blew .086% and easily could have challenged the results in court, given the breathalyzer had a sticker on it that said it hadn't been calibrated in 2 years.

    People like you make me sick. I was an Emergency Medical Technician for two years, and got to see how people like you destroy the lives of innocent families doing nothing more offensive than driving home at night.

    You idiots go on and on about ways to beat the system, without for one second realizing that every time you drive while under the influence, you risk the lives of others.

    If it was up to me, DUI would be classified as "attempted murder", since you KNEW before you left the house that you were going to go drinking, and you KNEW that you had the obligation to make other arrangements for getting home. You DECIDED to risk the lives of the rest of us because you couldn't be BOTHERED to make arrangements for a taxi or a designated driver.

    If I ever go into politics, I'll pass a law that requires you to give up your keys before you're served a single drink, and that requires you to pass a breathalyzer before you are given your keys back. And if you end up murdering somebody anyway, then the bartender/bar owner becomes an accomplice when you are tried.

    Disagree with me? Then try responding at 2am to a scene where a drunk driver kills a family of four, including a 3-month-old child, and the drunk only needs an over-night observation at the ER. THEN you can tell me how I'm over-reacting.

  • Re:But does it work? (Score:3, Interesting)

    by brainiac ghost1991 ( 853936 ) on Thursday May 14, 2009 @06:35PM (#27958611)
    but why were you driving while over the limit anyway. Driving a car is dangerous, not just for you, but for those around you, by being under the influance of alcohol you are risking killing someone. Why take the risk? if you need to drive don't drink any alcohol.
  • by Joe The Dragon ( 967727 ) on Thursday May 14, 2009 @09:49PM (#27960563)

    Equipment can break down and programming errors do occur. Because of the safety issues involved, signals are equipped with a "conflict monitor." A conflict monitor is a simple device, completely independent of the controller, that watches the signal operate. It does this by monitoring a number of conditions, including the voltage to the individual bulbs in the heads.

    If a condition occurs which is not normal (for example opposing greens) the conflict monitor detects the condition and shuts down the intersection. Normally, it places the signal on "flash mode." The main street is given a flashing yellow, to indicate that the situation is not normal and caution is needed. The secondary street is given a flashing red light that should be treated like a stop sign. For safety reasons, the signal will not normally reset itself. A technician must visit the intersection, determine the problem and reset the controller.

  • Re:But does it work? (Score:1, Interesting)

    by Anonymous Coward on Thursday May 14, 2009 @11:42PM (#27961379)

    I realize this article is about screwed up code, and much criticism and analysis is justifiably about that code. However, the reason the code is made so important is because the legal system has been skewed to procedurally depend solely on breathalyzers. This dependency is complete failure to maintain a chain of evidence and providing for a defense, critical issues in determining innocence and guilt.

    In a breathalyzer, the evidence is destroyed. While some /.ers make think "duh," there is little to no reason why there isn't retention of the breath/air sample, in addition to savings of at least 2 additional samples (B and C samples for non-government affiliated independent labs).

    Even athletic drug testing has better procedures and policies in place. If an athlete is caught cheating in the Olympics or in the Tour de France, a B sample is checked to verify the results, and often times (but not always) the A and B samples that were tested still has enough sample left to recheck.

    Our legal was circumvented thanks to bad police, bad judges, and an irresponsible SCOTUS decision and lazy Congresses and Presidents since then that refuse to take the chain of evidence into account. The US Supreme Court stupidly decided that because the breath sample was not "deliberately" destroyed, it could not be held against the prosecution's case.

    Also, there was no impetus to raise the standard, despite it being easy to do so. The first way to do this is the aforementioned storing of a breath sample, which some breathalyzers do as they capture the breath to effectively test BAC. The second, and more accurate in addition to being available as a backup or redundant test method to make sure someone is guilty or innocent, is to take blood samples. Some states allow this, but do not allow the person to choose (refusing a breathalyzer and insisting on a blood test is not always allowed or legal).

    Again, the analysis of the code is extremely important, but only because our system has become so lazy and stupid to rely on such an inferior and singular tests. There is nothing else that quickly comes to mind where insuffient evidence is kept, lab tests completely destroy the entire contents of the evidence, no actual evidence is kept to verify or refute the results for the defense, and all this is allowed to find someone guilty.

  • Re:But does it work? (Score:3, Interesting)

    by ppanon ( 16583 ) on Thursday May 14, 2009 @11:49PM (#27961415) Homepage Journal

    That's close. Since you want to take the previous average, turn it back into a running total by multiplying it by the old item count, sum that with the new value, and finally dividing by the new item count, we get:

    n++
    new average = old average*((n-1)/n) + new_value/n

    which, simplified into your format would actually make it:

    average = (new_value-average)/n++ + average;

    From a numerical analysis point of view though, you're probably better off getting separate totals and count and calculating the average at the end. There will be less accumulated error.

  • Re:But does it work? (Score:3, Interesting)

    by dasunt ( 249686 ) on Friday May 15, 2009 @12:41AM (#27961749)

    The majority of crashes and deaths aren't caused by people that blow a 0.086. They're habitual offenders who blow .25s.

    Don't forget the statistics are sometimes utterly bullshit.

    Here in Minnesota, we had an interstate bridge collapse (the I35W bridge) into a major river a few years ago.

    Officially, all those deaths from the bridge collapse count as alcohol-related fatalities, due to the fact that a few of the people who died had detectable levels of alcohol in their blood.

    Note, they weren't necessarily drunk or even impaired, but since they had detectable levels, it counts.

  • Re:But does it work? (Score:5, Interesting)

    by Splab ( 574204 ) on Friday May 15, 2009 @12:45AM (#27961773)

    Since I'm not an American I don't know how a drunk stop works, but here in Denmark, you get to blow on a mobile device, if it shows up as drunk you are taken to the hospital for a blood sample and only that blood sample will be used against you.

    Are only the mechanical readings being used in the US?

  • Simple test (Score:3, Interesting)

    by SmallFurryCreature ( 593017 ) on Friday May 15, 2009 @01:50AM (#27962209) Journal

    Get a driving game or any other skill/reaction based game. I used Grand Prix Legends. Start driving, give yourself time to adjust to get into a grove. Note your average time and accidents. Don't worry to much about speeding, just about making incident free rounds at the maximum of your capibilty BUT in a race so there is traffic.

    Then start drinking. Slowly, alcohol doesn't work instantly. EVEN half a beer will impact your performance.

    Anyone with any brains can reason this out. We drink alcohol because it affects our brain. To say alcohol does not affect you is just silly. It would be like saying being dipped into icy cold water does not affect you.

    When I see people denying alcohol affects them, even to the extent that 0.8 don't means they are drunk, I see someone who is debating with basic chemistry. What would they argue next, that if their blood has no oxygen they ain't dead?

    Really, test it with a game. An objective game in which you can measure a simple statistic but one that reflects the task of driving. Doing something repetitive that you think you can do on auto-pilot but still requires split second reactions when you least expect it. GTA4 come to think of it might be better. Oh and if you hit anything, anything at all, well. Hand in your drivers license.

UNIX was not designed to stop you from doing stupid things, because that would also stop you from doing clever things. -- Doug Gwyn

Working...