Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

In an attribute unit test, the actual output value of a target attribute is compared with its expected output value given the input profile and defined business logic (business rule, decicion table, data rule, default value) in the module scope. 

A unit test is saved and can be repeated, allowing to test business logic if changes are made. Also a unit test can be used as a form of documentation. By defining input and expected output, the functional operation is documented.

...

An example of an attribute unit test:

Image RemovedImage Added

Property

Description

Target attribute

The attribute of which the actual value is going to be compared with the expected value.

Expected value(s)

The expected value of the attribute given the input (profiles). If the target attribute is multivalued, multiple expected values can be entered.

Profiles

The input for the tested element, represented as one or more profiles. 

Save and run unit test

Allows running the unit test and shows the result.

Profiles

Manually create a profile

To create a profile manually, use the + the Image Added-button next to "'Profiles"'. Sometimes different inputs for a unit should lead to the same output. Adding multiple profiles to the unit test makes it possible to assign different profiles to one unit test, all leading to the same output.

...

  • User-set values can be assigned to attributes and relations in the profile
  • From the relation value dropdown, new instances can be generated

Copy a profile from another unit test

Sometimes its convenient to copy a profile from another unit test. You can use the Image Added-button for it, after which you can select a unit test and one or more profiles. 

Paste from clipboard

Using the Image Added-button, you can paste profiles (in XML-format) from the clipboard into Blueriq Encore. Such a profile may be copied from another unit test, a data mapping, the webservice debugging log, a quick test, or created manually.

Running a unit test

Running a unit test means checking if the actual outpus value(s) of the unit test, given the input profile(s), matches the expected output value(s). There are two ways to run a unit test in Blueriq Encore: from the unit test itself and from the unit test overview.

...

After runnining unit tests from the overview, a green checkmark or red exclamation mark will be shown. Selecting the unit test in the list on the left will show the expected and actual output value for each profile

Running unit test as a quick test

Running a quick test may help to give you insight in how an attribute is derived, and thus why a unit test is succeeding or failing. To do so, use the contect menu of a profile and choose "Run as quick test", or simply click the Image Added-button. This will transfer the corresponding profile and set the target attribute in the quick test

Unit test coverage

The Blueriq Model Analyzer (BMA) has the ability to calculate a unit test coverage for all decision tables and business rules within a project/module. Read more about it here.