Englische BlogsFunctional SafetyValidation and Verification

Structural Code Coverage – Useful or Cost Without Benefit?

Are you working on software projects wherein functional safety in getting more and more necessary? Perhaps you are already in the middle of a project and have to fulfill the demands out of the IEC 61508, ISO 26262 or comparable standards? If so you maybe familiar with the with the term Structural Source Code Coverage. In my experience, the achievement of structural coverage is often equated with high testing costs, raising doubts about the  ratio of costs to benefits.

This point of view is not necessarily correct, because in practice, the following two errors are often made:

  • The determination of the total coverage is often improperly distributed over the individual test levels.
  • The measurement of the coverage is often not fully automated

Properly used, structural coverage is an efficient vehicle to check the quality of requirements and functional tests automatically.

Following figure provides the connection between the levels of testing and structural coverage:

 Testebenen_Coverage

A good practice is therefore to measure the coverage achieved by the existing functional tests on the HW / SW or the SW / SW integration level. Experience shows that this is between 50% to 80%. With good project management on the unit test level it’s possible to archive the remaining 20% to 50%.

The aim should be to achieve the coverage without leading to additional testing efforts. If the measurement is fully automated, especially on the integration test level, virtually no additional costs should be incurred.Instead of additional costs, structural coverage is an excellent tool to verify the quality of the the requirements and the functional tests automatically. For this reason, the measurement of the structural coverage could even be interesting for projects not related to any functional safety standards.

I’ll be glad to help you also with any specific questions about your project . Send an email to: martin.heininger [at] heicon-ulm.de
An overview of the services can also be found on the HEICON Homepage.


Ein Gedanke zu „Structural Code Coverage – Useful or Cost Without Benefit?

  1. As Martin indicates, a high level of code coverage implies a high level of testing completeness. One of the often over-looked benefits of achieving high levels of testing completeness is that it allows engineers to re-factor the application code with confidence. If you have tests which validate the existing functionality of the application at the API level, then changes to the underlying logic which pass all existing tests, are unlikely to cause functional regressions when shipped to customers.

Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht.