LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Using Vectors on SetupVI in UnitTestFramework causes unexpected behavior

I didn't find specific board for UTF so I hope here I can find some feedback on the potential issue we found in Unit Test Framework (UTF).

 

TLDR:

Vectors used in SetupVI for one test case propagate to other test cases where vectors are not selected leading to test case failure.

 

More details below:

One of our colleague is evaluating UTF for our purposes and he stumbled upon an issue that we cannot explain.

We have prepared an example project so that you may be able to reproduce the issue on your end (VectorIssue.zip).

The example is prepared in LabVIEW 2020.

 

The example consists of 3 test cases.

One of those test cases (#2) uses vector values as inputs to SetupVI and expected values of VI Under Test.

The test case that runs after the case with vectors does not use constants from test case definition but takes vector values from previous test case (!).

Strangely, if you run each of the test case separately issue does not occur.

If you use RUN UNIT TESTS button from project menu then you will see failures. 

 

Seems like a bug in UTF but I wanted to consult it here to be sure that we did not configure something in the wrong way.

 

VIs:

VI Under Test (UnderTestVI.vi):

VI simply passes the inputs to the outputs, for the example purposes.

Inputs:

- TestInputString

- TestInputDBL

 

Outputs:

- TestOutputString

- TestOutputDBL

 

SetupVI (SetupVI.vi):

This VI concatenates First and Second input so that VI Under Tests receives Concatenated value as it's Input.

Inputs:

- First (String)

- Second (String)

- DBLin

 

Outputs:

- Concatenated (String)

- DBLout

 

Vectors:

There is one test vector file prepared - Vector_1.lvvect.

This vector contains string (V1_First, V1_Second) and DBL (DBLin) inputs for SetupVI and the expected Outputs (V1_Concatenated, DBLout) for VI Under Test.

 

Test Cases:

#1 Case

First - "test"

Second - "string"

DBLin - 1

 

Expected result:

TestOutputString = "teststring"

TestOutputDBL = 1

 

1 permutation - PASS

 

#2 Case:

First - Vector_1: V1_First (Index 1)

Second - Vector_1: V1_Second (Index 1)

DBLin - Vector_1: DBLin (No Index)

 

Expected result:

TestOutputString = Vector_1: V1_Concatenated

TestOutputDBL = Vector_1: V1_DBLout

 

9 permutations - PASS

 

#3 Case:

First - "ohmygod"

Second - "it'salive"

DBLin - 5

 

Expected result:

TestOutputString = "ohmygodit'salive"

TestOutputDBL = 5

 

Result - FAIL

Should be 1 permutation, but the UTF executes 9 permutations with input values taken from previous test case (#2).

This results in #3 Case failure (see HTML report.html where it is clearly visible that #3 case executes inputs from #2 case)

 

 

 

 

 



Download All
0 Kudos
Message 1 of 2
(1,175 Views)

Additional information:

If I rearrange cases so that the order is #1 -> #3 -> #2 then everything works fine.

 



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