Unit Testing Group

cancel
Showing results for 
Search instead for 
Did you mean: 

How is the Project Code Coverage calculated?

Hi,

 

I'm using the UTF and it isn't clear to me, how the project code coverage is calculated.

First I thought it was the average of all directly tested VI's. Then  I tried to include the indirectly (dependencies) tested VI's to the average, but I didn't get the exact value as given in the test-report?

 

Has anybody any idea, how that value is calculated?

 

Thanks Elias

0 Kudos
Message 1 of 4
(3,082 Views)

Hi Elias,

 

I will do some research on the project part. For the VI part, it is calculated based on the number of subdiagrams that get executed in each test case. 

 

If you have a block diagram with an error case structure inside, there are a total of 3 diagrams. The block diagram for the VI itself, the subdiagram for the Error case and the subdiagram for the No Error case.

 

If the unit test only tests the No Error case, the coverage will be 2/3=66% code coverage. Two block diagrams exercised, the block diagram for the VI itself and the block diagram for the NO error case.

 

I will see what I can find regarding the project coverage. 

 

Regards,

Fab

 

 

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
0 Kudos
Message 2 of 4
(3,064 Views)

Found it!

 

From the help:

http://zone.ni.com/reference/en-XX/help/372584D-01/lvutfconcepts/utfc_code_cov/

 

The description of the code coverage per VI is at the top and is similar to what I explained before.

 

Then it says for Project Code Coverage:

"Project Code Coverage

You can generate code coverage of a project by placing a checkmark in the Include VIs that were not tested checkbox on the Unit Test Framework page. When you execute this test, LabVIEW opens all VIs in this project to count subdiagrams and generates the code coverage of this project. For example, you can create a project that contains two VIs and each VI contains three subdiagrams and a test case that covers all three subdiagrams of one VI. When you execute this test, LabVIEW opens both VIs to count subdiagrams. Since this project contains six subdiagrams and the test covers three subdiagrams, the project code coverage measurement is 50%."

 

Regards,

Fab

For an opportunity to learn from experienced developers / entrepeneurs (Steve, Joerg, and Brian amongst them):
Check out DSH Pragmatic Software Development Workshop!

DQMH Lead Architect * DQMH Trusted Advisor * Certified LabVIEW Architect * Certified LabVIEW Embedded Developer * Certified Professional Instructor * LabVIEW Champion * Code Janitor

Have you been nice to future you?
Message 3 of 4
(3,062 Views)

Thanks for your help. I'll check this out the next days 🙂

0 Kudos
Message 4 of 4
(3,048 Views)