Home > User Support > CoverageMaster winAMS FAQ

CoverageMaster winAMS FAQ

Coverage Measurement

013_03: Why should I disable compiler optimizations for MC/DC testing?

Question:

Why should I disable compiler optimizations when compiling the object code that includes hook code for MC/DC testing?

Answer:

CoverageMaster executes both actual target object code and hook included object code when performing MC/DC tests. The function’s output values and C0 coverage results are obtained from the actual target object code execution, and only the MC/DC and C1 coverage result will be obtained from the hook included object code execution.

The actual target object code is recommended to be compiled using the same optimization options (optimizations enabled) as the target code to maintain test reliability. However, the hook included object code is recommended to be compiled with optimization options disabled (turned off) in order to execute the hook code test efficiently.

After generating the hook code, you can see the inserted hook code in the copied source files. The hook code inserted source code has a different structure from the code implemented in the actual source code. Hence it is unnecessary to maintain the same compiler optimizations when building the object file.

In addition, the hook source code is intended for measuring MC/DC correctly. For this reason, it is necessary that the code not be affected by compiler optimizations.

The output results for the optimization applied test object increase test quality since the test runs on the same object code that will be run in the actual product.

Regarding functional safety, functional safety tool certification has been obtained for MC/DC measurement using this method.

Please refer to the following PDF for details on the MC/DC test flow.

[Reference] How MC/DC is Measured (PDF)


Related Technical Tips Search

Other technical tips in GAIO's web site can be searched for using the links below.

Search key word link: MC/DC Measurement | Compiler optimization
Technical Tips Google Search


Information Links