Code without a failure rate.
+ The questionWhat does a standard ask of safety software, and what does each requirement prevent?
Each requirement guards one step
When one decision rests on four conditions, it takes at least five tests to show that each condition changes the outcome on its own. The incubator's protective channel can make such a decision when its comparison runs as firmware, as Chapter 3 supposed. The channel can open the cutout when the air is above its limit, when a check finds the protective sensor failed, when the two thermistors disagree, or when an earlier trip is still latched. Four conditions, each true or false, make 16 combinations, and five tests are the fewest that show each condition at work.
A software standard asks for tests of that kind, and not for a failure rate, because a program does not wear out. A fault in a program was built in at some step of its making (Chapter 3). Chapter 15 showed that confidence in such a part is earned by how the part was made. For software, each requirement of a standard guards one step at which a fault can enter: the software requirement that the code is written from, the design that places the code beside other code, the code itself, the tests that run it, and the people who check the work.
Those steps can be drawn as a V. Down its left arm, the software safety requirements take what the software must do from the safety requirements specification (Chapter 17). An architecture then divides the program into parts, each part is designed in detail, and the detail is written as code. Up the right arm, each level is tested against the level opposite: each unit against its detailed design, the assembled parts against the architecture, and the whole program against its requirements. A fault made on the left is found on the right only by a test that can fail at the matching level.
A requirement that a test can fail
A test passes or fails against a requirement, so a requirement that leaves an input undecided cannot be tested at that input. The maker's filing gives the incubator its limits (Chapter 4). The filing sets the air at no more than 38 °C while the set temperature is less than 37 °C, and at no more than 39.5 °C while it is over 37 °C. A set temperature of exactly 37.0 °C falls in neither range. Firmware that applies 38 °C there and firmware that applies 39.5 °C both meet the wording, so no test at 37.0 °C can fail either, and whoever writes the line of code makes the choice. The same filing does assign 37.0 °C in its row for the incubator this one was compared with: there the lower limit applies up to and including 37 °C.
Written so that a test can fail it, the requirement puts 37.0 °C in one of the two ranges and states how soon the cutout must open, in the terms of Chapter 4's response time. It also gives each limit with its unit, so that a number such as Chapter 3's 100.4 cannot be taken for degrees Celsius. Each part then gives a test something to fail. The two limits need a test each (Chapter 17). The boundary between them needs tests at it and on either side, at 36.9, 37.0 and 37.1 °C, since the set temperature moves in steps of 0.1 °C. Testing at and on either side of each boundary is boundary value analysis. Among the dynamic tests of IEC 61508-3 it is highly recommended from SIL 2, in the standard's tables as a maker of software-testing tools maps them (Chapter 15).
Other code kept out of the function's way
Where the comparison runs decides what else can reach it. On a processor of its own, the protective channel's program is small, and no other program writes to its memory or takes its time. On the controller's processor, the program shares both with the control loop, the display and the alarms, and a fault in any of them can reach the comparison. Software built under ISO 26262-6 is examined for three kinds of such interference: in memory, the processor's registers included; in timing and execution, such as one task blocking another or two tasks each waiting for the other; and in communication, any error in what passes between parts of the software.
Freedom from interference is the property that software of lower integrity cannot disturb software of higher integrity in any of those ways. Under IEC 61508 the same property is independence of execution, to be achieved and demonstrated both in space and in time. Each kind of interference has its own measure. A memory management unit lets only the comparison write its own stored limits. A schedule that reserves the comparison's processor time keeps the comparison running, and the watchdog of Chapter 12 backs that schedule. A check carried with each message shows when a message has changed on its way.
The set temperature shows where those measures stop. The protective channel takes from the control side whether the set temperature is above 37 °C. A check on the message shows a set temperature corrupted on the way. But a set temperature that was already wrong when the control side sent it arrives intact and passes every check, and Chapter 14 follows that fault as a cause the two channels share. Separation keeps faults in other code from reaching the comparison. It does nothing about a fault in the comparison's own code, and the remaining requirements are aimed at such a fault.
Rules for the code, and analysis without running it
The C language converts between kinds of number without being asked. If the upper limit of 39.5 °C is stored in a variable meant for whole numbers, the program keeps 39 and drops the half. Set to 39 °C, the top of its range, the incubator then trips as soon as the air rises a little above its set temperature. The code compiles and runs, and the fault shows only where a test happens to probe it.
A coding standard forbids or limits such constructs before any test is run. IEC 61508-3 grades the use of such a standard in two of its tables. In the table for detailed design, design and coding standards are highly recommended from SIL 2. In the standard's table of design and coding standards, the use of a coding standard is recommended at SIL 2 and highly recommended at SIL 3 and 4. Rules against automatic type conversion, dynamic objects and unstructured control flow are highly recommended from SIL 2.
MISRA C is a coding standard for C. Its current edition, MISRA C:2025, was published in March 2025 as an incremental update that supports the C11 and C18 versions of the language. Each of its guidelines is mandatory, required or advisory. MISRA C:2012 marked its rules decidable or undecidable, so that the user of a checking tool can interpret the tool's reports. For a decidable rule, a tool can always tell from the code alone whether the rule is broken; for an undecidable rule it cannot always tell.
Static analysis examines the code without running it. Control-flow analysis follows every path the program can take, and it finds code that no path reaches or a loop with no way out. Data-flow analysis follows each variable from where it is set to where it is used, and it finds a variable read before it is written. Both are highly recommended from SIL 2 under IEC 61508-3. A MISRA C checker is such an analyzer. In the terms of Chapter 15 it is a T2 tool, which can miss a fault but cannot add one. Neither the rules nor the analyzer can tell that 100.4 is the wrong limit. The number is legal and of the right type, and only a check against a requirement that states the unit, by test or by review, finds the wrong limit.
Tests that reach every condition
Tests are written from the requirements, so their passing shows that the requirements are met where the tests looked. Structural coverage measures where they looked: the share of the code's structure that the requirement-based tests ran. Statement coverage asks that every statement run at least once, and branch coverage that every decision be taken both ways. Code that no such test reaches is either untested or does something that no requirement asks for, and either is worth knowing before the program is released.
Modified condition/decision coverage, or MC/DC, goes further for a decision built from several conditions. Each condition must be shown to change the decision's outcome on its own, with the other conditions held fixed. The definition comes from DO-178B, the aviation software standard, under which level A software had to meet MC/DC. MC/DC takes at least one test more than the decision has conditions, while testing every combination takes a number of tests that doubles with each condition added.
Suppose the incubator takes Chapter 12's first choice, so that a sensor failure found by a check opens the cutout. The firmware opens the cutout if any of four conditions holds: the protective reading is above its limit, the range check finds the protective sensor failed, the cross-check finds the two thermistors disagreeing, or an earlier trip is still latched (Chapter 4). The cross-check sets the two readings against each other, so it runs only on readings that pass their range checks. Each condition is true or false, so the decision has 2 × 2 × 2 × 2 = 16 combinations. MC/DC needs one test with all four false, in which the heater stays under the controller, and one test with each condition true on its own, which must open the cutout: 4 + 1 = 5 tests. At a set temperature of 36.0 °C the limit is 38 °C. The first test is a reading of 37.0 °C with everything healthy. Of the other four, one is a reading of 38.5 °C with the control reading at 38.5 °C beside it, so that the two still agree. The others are an open protective thermistor, which reads colder than any air; a reading of 37.0 °C beside a control reading that differs from it by more than the two show when healthy; and a reading of 37.0 °C after a trip that has not been reset. Each of the four differs from the first test in one condition and changes the outcome, so each pair shows one condition at work. Five tests out of 16 combinations is under a third, and for 10 conditions MC/DC takes at least 11 tests out of 1,024.
A fault that branch coverage can miss shows what the extra tests add. Suppose the programmer joined the range check and the cross-check with "and" where the requirement says "or", so that a failed sensor opens the cutout only if the cross-check also finds a disagreement. Branch coverage is complete with two tests, a reading of 38.5 °C that trips and one of 37.0 °C that does not, and both pass. The five MC/DC tests include one with the open thermistor on its own. The requirement says the cutout must open, the firmware leaves it closed, and the test fails. Each condition gets a test whose outcome turns on that condition alone, so in this decision a condition inverted or joined by the wrong word fails at least one of the five.
The standards grade how far the tests must go by integrity level, as makers of testing and coverage tools map the standards' tables. Under IEC 61508-3, full statement coverage is highly recommended from SIL 2 and full branch coverage from SIL 3, and MC/DC is recommended from SIL 1 to 3 and highly recommended at SIL 4. Chapter 8 found SIL 3 for the cutout while the alarm reads the control thermistor, and at that level branch coverage is highly recommended and MC/DC recommended. For road vehicles, ISO 26262-6 grades the same three measures at the level of each software unit, and MC/DC is highly recommended only at ASIL D. Level A aviation software must meet MC/DC under DO-178C, the current edition of the aviation standard (Chapter 26).
Full coverage shows that the tests ran every condition the code contains. A requirement that never became code leaves no condition to cover, so coverage of the code that exists can be complete while the program misses a requirement. Had the latch never been written, the decision would have three conditions, four tests would cover it fully, and only a test written from the requirement that a trip stay latched would fail. Coverage measures the tests against the code. Tests written from the requirements measure the code against what it must do.
Independence, and three standards side by side
A test written by the author of the code may share the author's reading of the requirement, so a misreading passes both the code and its test. Independence in verification means that someone other than the author reviews or tests the work, and the standards grade how far apart the two must be. Under DO-178C, the coverage of level A and level B aviation software is shown with independence. At level B, so is the verification of the requirements, the source code and the executable code.
Under ISO 26262, the independence of the confirmation measures is graded by ASIL, and the functional safety assessment is one of those measures. ZVEI, the German electrical and electronic manufacturers' association, gives this account in a 2020 guideline, and so does Synopsys, a maker of design tools, in a 2023 white paper. An assessment consultancy gives the assessor's independence step by step, from a different team at ASIL C to another department or someone outside the company at ASIL D. Under IEC 61508 the independence of the functional safety assessment is graded by SIL (Chapter 19).
The three standards compared here set their levels on different grounds, and a higher level changes something different in each.
| IEC 61508-3:2010 | ISO 26262-6:2018 | IEC 62304:2006 + AMD1:2015 | |
|---|---|---|---|
| Applies to | software in electrical, electronic and programmable electronic safety-related systems | software in series production road vehicles | medical device software |
| Levels | SIL 1 to 4 | ASIL A to D | software safety classes A, B and C |
| Set by | the risk reduction the function must give (Chapter 8) | severity, exposure and controllability (Chapter 24) | the risk left once risk control outside the software is in place, and the severity of the harm |
| What a higher level changes | how strongly each technique is recommended | how strongly each method is recommended | which activities apply |
An IEC 62304 software safety class follows from two questions: whether the software can contribute to a hazardous situation whose risk stays unacceptable once risk controls outside the software are in place, and how severe the possible harm would then be. The software is class A where the answer to the first question is no, class B where it is yes and the possible harm is not serious injury, and class C where it is yes and the possible harm is death or serious injury, in a regulatory consultancy's account of the standard.
In the same account, a risk control outside the software, usually in hardware, can lower a software system's class, but a part that monitors another inside the same software system cannot. For the incubator, a cutout comparison built in hardware can count as such an outside control for the controller's software, and a comparison running in the controller's own software build cannot.
On 18 November 2026 IEC's catalog listed IEC 62304 in Edition 1.1, the 2006 text with its 2015 amendment. Chapters 3 to 8 of the Academy guide The next patient, the next update follow IEC 62304's activities from requirements to release, among them the handling of software of unknown provenance that a device takes in from others. Its Chapter 4 writes software requirements so that a test, an inspection or an analysis can show whether each is met, which is the property this chapter asks of the incubator's limits.
Write each software safety requirement with its units, each boundary assigned to one side and its time to act, and derive from it at least one test that a wrong program would fail. Decide where the safety function's code runs. Where the code shares a processor, show its freedom from interference in memory, timing and communication, or treat everything that can reach it as part of the function. Adopt a coding standard such as MISRA C:2025, check the code against it with a static analyzer, and record each guideline not followed with its reason. Measure the coverage that the standard asks for at the function's level, give every condition of a safety decision its own pair of tests, and have someone other than the author write or review them.
- A program does not wear out, and a fault in it was built in at some step of its making, so a software standard guards each step of the V, from a requirement that a test can fail to the tests that show it is met.
- Freedom from interference means that software of lower integrity cannot disturb the safety function in memory, in timing and execution, or in communication, and coding rules such as MISRA C and static analysis keep error-prone constructs out of the function's own code.
- Structural coverage measures how much of the code the requirement-based tests ran. MC/DC asks that each condition of a decision be shown to change the decision's outcome on its own: five tests for the cutout's four conditions, where every combination takes 16.
- IEC 61508-3 and ISO 26262-6 grade their methods by SIL and by ASIL, while IEC 62304's classes A to C follow whether an unacceptable risk remains after risk control outside the software and how severe the possible harm is, and decide which activities apply.
Let's Talk