From 04:00 PM CDT – 08:00 PM CDT (09:00 PM UTC – 01:00 AM UTC) Tuesday, April 16, ni.com will undergo system upgrades that may result in temporary service interruption.

We appreciate your patience as we improve our online experience.

LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

UTF code coverage bug?

Hi,

 

I stumbled upon the following issue: if I measure the code coverage with UTF there are certain cases when

  • (Wrong completeness😞 UTF does not return all uncovered diagrams.
  • (Wrong correctness😞 UTF returns conditionally disabled diagram as uncovered.

 

I created a small project to illustrate the problem (project attached with this post). There are three VIs in the project which I want to unit test with UTF: conditionalDisableStructure.vi, errorCaseStructure.vi and errorCaseStructureWithCDS.vi.

 

For the first two VIs the UTF test works fine, but if I use those two (conditional disable structure and case structure) in errorCaseStructureCDS.vi, UTF marks the CDS’s Default branch as an uncovered diagram (wrong correctness), although it was covered in conditionalDisableStructure.vi. Furthermore there is another uncovered diagram (the error case), but UTF does not show that one (wrong completeness).

 

Can you confirm that it’s a bug? Can anybody enter a CAR and let NI know?

 

Thanks,

Balazs

0 Kudos
Message 1 of 2
(2,067 Views)

 

UTF code coverage does not play with Conditional Disable Structures: see this https://forums.ni.com/t5/LabVIEW/Unit-test-framewok-code-coverage-with-Conditional-Disable/td-p/3569.... CDS change the compiled code depending on the setting of the symbol which means the compiled code is fixed (unlike a case structure which maintains the "if" nature in compiled code). This impacts how the UTF runs your VIs which execute the compiled code.

 

This explains why the CDS, on it's own, has 100% coverage - as far as the UTF is concerned, without the CDS your block diagram is just error in to error out.

 

As far as why it incorrectly reports the CDS and not the Error Case - I would say that this is indeed a bug; even though the actual test ignores the CDS in the compiled code (as it doesn't exist) the VI Server node search afterwards to determine coverage and calculate the relevant uncovered nodes for display sees more than one structure and, since in the compiled code there is only one structure, it references the first in the list - the CDS. If I remove the CDS then the result is as expected for the errorCaseStructure. I think that this bug is unlikely to get fixed given NI's development priority is on NXG where there will be a new unit test framework.

 

Based on past experience creating a code coverage tool (outside UTF) I believe this is a limitation of the VI Server API that UTF leverages. My personal suggestion is not to use CDS as they generally make debugging of compiled code in build specifications more difficult.

0 Kudos
Message 2 of 2
(2,022 Views)