Generic Test Case Generation From DMN - Gnorion/BizVR GitHub Wiki

GENERIC RULE MODEL FOR TEST DATA GENERATION

Up until now we have been using VV to generate test data directly from each individual rule model by examining all the values actually tested in the rules.

While this works fine, it does have some limitations:

test data values can only be based on the values that are actually in the rule model all the values in the rules will be used (you cannot choose the values) only variables that are used in conditions can be used (variables hidden in expressions can't be used) it only works with tables - not FEEL expressions

However, I figured out a way around those limitations and that is to generate the test data from a separate model that does not depend on the actual rules or expressions . One advantage of this approach is that a business user assigned to testing can create bulk test cases without being able to peek inside the rules and cheat.

You can of course insert these test data generation tables into the business model in addition to keeping them separate.

The model looks like this:

image

Basically you just create a table for each variable you are interested in and then include values (or ranges) like this

image

Then when you run this generic model through VV it will generate all the combinations of the values for the variables you identify with ovals.

image

To exclude a variable you simply put an X the end of its name (so the name won't match anything in the tables).

By default all combinations are generated (which means if you run it on TLP you would get 1728 test cases - which is an awful lot)

But you can use this generic approach to partition the tests.

For example suppose you say "Today I will run tests just on females"

All you need to do is edit the gender table and remove "male" and all your test cases will be for females.

At the moment you would need to create such a generic model manually - but in principal it should be possible to create some of it automatically by introspecting the models to be tested. It could be set up initially based on the variables in the models and their values but then those values could be modified to suit the testing requirements