Automating the Generation Of Test Data - Gnorion/BizVR GitHub Wiki

Automating the Generation Of Test Data As an initial step in getting VV to generate suitable test data I can have it start with all the declared input variables and then look through the rules to gather up all the values (or ranges) against which that variable is tested. That would provide a minimum set of test values.

You might want to add more to cover special cases.

So for the MS02 example VV suggests using these test values.

You cannot consider the decision test until every one of these values has been used in at least one test.

image

I plan on including this in the results json that VV returns to BizVR. Maybe with the lists as arrays.

To be completely thorough you might need to invoke the rules with every possible combination of these values. In this case you'd need 2 x 4 x 3 x 6 = 144

Additionally,f you are worried about testing the boundary values for each of the ranges, you might need 2 x 4 x 3 x 16 = 384 tests (a value for the lower, the upper and somewhere in the middle). Strictly speaking, shouldn't you test every value in the range?

And if you add in some values other than what's listed about you could need 3 x 5 x 5 x 18 = 1350.

NOTE: This is considering the entire decision since at the moment that's all we can test.

If we are able to test individual decision tables then the number of test case comes down considerably to the sum of the test cases for each of the tables rather than the product 4 x 3 =12 for size table + 6 for color table+ 3 x 3 x 2 = 18 for price table + 3 for shipping + 3 for tax = 41 total tests

Since as part of running test we also need to define what the expected results should be (otherwise how would we know if the test passed), 41 tests is much more manageable than 144 tests.

image

For reference here are all the rules

R1 RGB1 Determine Price: if color = 'red' then price is 5    
R2 RGB1 Determine Price: if color = 'blue' and size = 'small' and shape = 'square' then price is 10    
R3 RGB1 Determine Price: if color = 'green' and shape = 'round' then price is 15    
R1 RGB2 Detemine Size: if length < 15 or  > 100 and width < 15 then size is 'large'    
R2 RGB2 Detemine Size: if length < 10 and width < 10 then size is 'small'    
R3 RGB2 Detemine Size: if length = 12 and width in [15..1000] then size is 'medium'    
R1 RGB3 Determine Color: if wavelength <  450 then color is 'UV'    
R2 RGB3 Determine Color: if wavelength in [450..495] then color is 'blue'    
R3 RGB3 Determine Color: if wavelength in (495..570] then color is 'green'    
R4 RGB3 Determine Color: if wavelength in (570..590] then color is 'yellow'    
R5 RGB3 Determine Color: if wavelength in [590..620] then color is 'orange'    
R6 RGB3 Determine Color: if wavelength in [620..750] then color is 'red'    
R1 RGB4 Determine Shipping: if price < 10 then shipping is 2    
R2 RGB4 Determine Shipping: if price > 10 then shipping is 5    
R1 RGB5 Determine Tax: if price < 12 then tax is 3    
R2 RGB5 Determine Tax: if price > 12 then tax is 5    
⚠️ **GitHub.com Fallback** ⚠️