• Twitter
  • LinkedIn
  • Xing
+49 7353 981781
Heicon Ulm
  • HOME
  • COMPANY
  • PRODUCTS
  • HEICON BLOG
  • English
    • Deutsch
    • English
  • Menu Menu
You are here: Home1 / FuSa__General2 / Challenges when determining the structural source code coverage on the...

Challenges when determining the structural source code coverage on the target!

FuSa__General

Structural Coverage Target: The proof of a 100% structural source code coverage is required by almost all functional safety standards (IEC61508, ISO26262, DO 178C, etc.). In the individual SIL / ASIL levels, only the type of source code coverage is differentiated. Essentially, the Statement Coverage (low SIL / ASIL Level), the Branch Coverage and the MC / DC Coverage (high SIL / ASIL Level) are required. For good reasons, however, e.g. no path coverage required. These would mean that you would check all the combinations of paths that are possible in a software. This would be an extremely high multiple of test cases compared to MC / DC coverage.

In the following blog, I discuss the question of the advantages and disadvantages of determining the coverage on the final hardware as opposed to a coverage analysis on a simulator provided by the compiler manufacturer.

Spontaneously you may come to the conclusion that a coverage measurement on the final hardware is the best method for safety reasons. Some of the arguments that are repeatedly put forward are: Dead code is found under real conditions. The coverage is relied upon taking into account the real HW / SW interfaces. Formal unit tests are not required any more.
For a meaningful answer, it has to be clarified whether hardware is “only” the microcontroller and allocated memory. Alternatively the focus of the test could also be the entire hardware including I / Os,  FPGAs etc.

Structural Source Code Coverage – The common practice:

The measurement of code coverage  by executing the source code on the microcontroller has been a common practice in aviation for decades. From these many years it can be concluded that there are almost no mistakes, which are found additionally. A test on a simulator shows exactly the same errors in most cases. Here there is no recognizable advantage of the test on the target. It should also be noted that in this procedure virtually all software is not instrumented at once, but only relatively small parts. Because of the available tools on the market, however, it is not a big effort to determine the complete coverage.

Structural Source Code Coverage measurement on the real hardware:

A “real” test on the hardware does usually include the complete hardware (e.g. Microcontroller I/Os, FPGAs, etc.). However, with the conventional methods of coverage measurement, the problem arises that the timing behavior of the software as well as the memory requirement will change massively if the software is instrumented. The instrumentation is again necessary to be able to determine the coverage at all. This means, in practice quite often, that the software is no longer or only very limited to run on the real hardware.

However, in order to carry out tests in this way, it is often the case that only parts of the software are instrumented, tests are carried out accordingly, and the total coverage is then added up. The problem here is, however, that no commercial tool support is available for this. This results in a completely unacceptable effort to determine the overall coverage. With very time-critical systems, any instrumentation can lead to a meaningless test being no longer possible.

Solution:

The obvious solution to the above problem is a technology that no longer requires the source code to be modified, but which can still measure code coverage. Currently, there are developments from some tool vendors ongoing, which may result in such a solution. For selected hardware architectures, some solutions are already close to be finished.
The aerospace industry has developed an alternative approach which also achieves all safety goals with respect to the structural coverage:

  1. All tests (unit, integration and system tests) are compiled with exactly the same compiler and compiler settings as used in the operational code.
  2. Simulators and emulators are accepted for execution of coverage tests.
  3. The tests are written 100% against requirements. The structural coverage is only determined in the background. Whenever a gap occurs, it is analysed. There are, in principle, only three possible gaps: incomplete requirements, incomplete test specifications, unused source code. With this approach, an 100% source code coverage is achieved, which is covered by 100% requirements-based tests.

Related HEICON Blog posts

  • Structural Source Code Coverage – Cost without benefit?
  • Structural source code coverage and Requirements – Is there any dependency?
  • Requirement completeness using data- and control flow analysis

Are you ready for a functional safety workshop, to analyse improvement potentials in your development process, then send a mail to: info[at]heicon-ulm.de or call +49 (0) 7353 981 781.

 

15. June 2017/0 Comments/by HEICON Global Engineering GmbH
Tags: CENELEC, EN50128, Functional Safety, IEC61508, ISO26262, Requirements, RTCA DO178, Structural Coverage, Testing, Verification
Share this entry
  • Share on Facebook
  • Share on Twitter
  • Share on WhatsApp
  • Share on LinkedIn
https://heicon-ulm.de/wp-content/uploads/2019/12/DI1A6023_klein_Functional_Safety.jpg 433 547 HEICON Global Engineering GmbH https://heicon-ulm.de/wp-content/uploads/2020/07/heicon-logo-5.png HEICON Global Engineering GmbH2017-06-15 16:40:052021-02-03 21:48:08Challenges when determining the structural source code coverage on the target!
You might also like
Functional Safety Functional Safety – What is it?
Functional Safety Tool qualification – The pain of functional safety (part 2)!
Railway EN 50129 Safety Case
Functional Safety Agile development methods and functional safety – An unbridgeable contrast? (Part 2)
Functional Safety Freedom from Interference – The practice in Industry!
Automotive Fault Injection Test in ISO 26262 – Do you really need it?
0 replies

Leave a Reply

Want to join the discussion?
Feel free to contribute!

Leave a Reply Cancel reply

Your email address will not be published. Required fields are marked *

Categories

  • A_Requirement Engineering
  • B_Validation and Verification
  • C_Config- / Change Management
  • D_Security
  • FuSa__General
  • FuSa_Aerospace
  • FuSa_Agriculture
  • FuSa_Automotive
  • FuSa_Industrial
  • FuSa_Railway

Contact

HEICON Global Engineering GmbH
Dipl. Ing. (FH) Martin Heininger
Kreuzweg 22
88477 Schwendi

Phone: +49 7353 – 98 17 81
Mobile: +49 176 – 24 73 99 60

Email: info[at]heicon-ulm.de

IMPRINT  |  DATA PROTECTION

Good safety development process – What is it?Functional SafetyAutomotiveISO 26262 Freedom from interference – What is that?
Scroll to top