Software Testing - when computer glitch kills - race condition error example

By Otek | Otek | 27 Aug 2021


7db054fae49d85f8f3d819ea67cdaa87d29a83a1f77bc0ce92b9fce045db7729.jpg

Hello :)

I'm glad that You enjoyed my series about Software Testing :) If You don't read the first part or want to know why am I qualified to write about testing, check that post:

https://www.publish0x.com/otek/software-testing-part-01-it-is-worth-becoming-a-software-tes-xmmydvz

This time I want to cover one of the software/hardware errors called: race condition - on the example of one of the most tragic software errors in history: Therac-25 case.

 

Therac-25

Therac-25 was a machine for radiotherapy of cancer used in the 1980s produced by Atomic Energy of Canada Limited (AECL). It was the successor of Therac-6 and Therac-20 versions (those two were produced in cooperation with the French company CGR).

Between 1985 and 1987 there were at least six cases when patients were given massive overdoses of radiation. As a result of that 5 people dies. What happened?

7eb9391f65267220f811779581a96d3197d52fc0e5e5cde6cd517ff0e3d8a0be.png

AECL denies


The first accident happened in 1985 - the patient lost her breast and feeling in her hand, it turned out that the machine administered about 100 times more radiation than should. However - AECL said that is impossible to fault is on the machine side, so no action was taken.

In the same year another Therac-25 got error and give much more radiation than was ordered by the machine operator - in result 3 months later, the patient who participated in the procedure died due to complications of irradiation.

The AECL took a long time to deny the guilt, recognizing that there was no possibility that Therac-25 would get the doses wrong or irradiated despite the contrary. Nevertheless, a few more people were burned, and the case was brought to court.

Investigation

What was the result of the court investigation?

The main issue was race condition error also known as a race hazard. It happens when some steps should have proceeded in a particular order and, for some reason, that logic order was changed.

Let's take a simple example of refueling a car. We got 3 simple steps:

  1. Open fuel flap

  2. Pour fuel into the tank

  3. Close fuel flap

What will happen when You will try to perform 3rd step before finished 2? You will break your fuel flap or spill fuel around the car. That can occur when it will be set up that step 3 will start after 60 seconds after step 2 started - but if for some reason step 2 will take longer, step 3 will start anyway even when step 2 isn't finished.

Something similar happens in Therac-25 case. Machine operators were so experienced in operating this device that clicking and set up the next steps before earlier was saved by the machine. We can say that in some cases a human was faster than a machine.

Why did it happen?

Of course errors in software isn't something new, but why it wasn't found before Therac-25 was launched in hospitals?

Researchers who investigated the accidents found that code was poor quality and AECL make some really bad decisions and doesn't much care about quality:

  • AECL had never tested the Therac-25 with the software and hardware combination until it was put together at the hospital.

  • Machine worth over $ 1 million software was written by one person.

  • The hardware provided no way for the software to verify that sensors were working correctly.

  • AECL did not evaluate the software design while evaluating how the machine may deliver the expected results and what failure modes might exist, instead focusing solely on the hardware and claiming that the software was bug-free.

That are just a few examples of how bad was a AECL approach to Quality control. It also in a sad way shows how important Software testing is.

 

Hope that example of race condition error was interesting :) See you in next episodes :)

 

__________________________________________________________________________________________________

BTW. If You want to try another crypto earning platform just check that: https://noise.cash/u/Otek

How do you rate this article?


8

0

Otek
Otek

You Can also earn crypto here: https://read.cash/r/Otek


Otek
Otek

Just what I think about different topics. Mainly about crypto but not only

Send a $0.01 microtip in crypto to the author, and earn yourself as you read!

20% to author / 80% to me.
We pay the tips from our rewards pool.