Model-based testing using rules
The RapidRep Test Suite can determine target results by evaluating rules. This enables a fully automated test evaluation even when the expected result is not known in advance.
RapidRep sets of rules are flexible and not subject to a rigid pattern. They should be structured in a way that they are comprehensible for all parties involved. This gives the test result high transparency and consequently credibility. At delivery, RapidRep includes various examples for adjustable sets of rules whose structures have proven themselves in practice.
Sets of rules play an important part in model-based testing with RapidRep. You will find a more general introduction to this topic here: model-based testing.
A step-by-step evaluation of rules transforms the original data into an expected result. The determination of the desired value is the decisive step for the automated test evaluation with RapidRep, if the expected results for the test object are unknown in advance.
RapidRep rules have the following general properties
- Rules have the form: If (condition) -> Then (action)
- Each rule is uniquely identifiable via the attribute RULE_ID.
- The attribute ORDER_ID affects the order of the evaluation of rules.
- Each rule performs a very specific task in a set of rules (functional aspect).
- Each rule must have at least one attribute, which the rule engine can use to evaluate the If-condition.
- Rules may have as many other attributes as needed.
Properties of a RapidRep set of rules
- Each set of rules can be uniquely identified by its name.
- One set of rules implements at least one functional aspect.
- For each functional aspect there exists at least one rule.
- All rules of one set have an identic rule structure (same attributes).
Examples for sets of rules
Example for a technical set of rules
ORDER_ID | RULE_ID | CONDITION | SOURCE | ASPECT | DESCRIPTION |
1 | 1020 | STOCK < 0 | "N1" | LIMIT_1 | This is a demo rule |
2 | 1050 | STOCK >0 AND STOCK < 50 | "B1" | LIMIT_1 | This is a demo rule |
3 | 1022 | TRUE | "B0" | LIMIT_1 | This is a demo rule |
4 | 1057 | ACCOUNT_TYPE = 'A' | 100 | REF3 | This is a demo rule |
5 | 1024 | ACCOUNT_TYPE = 'Z' | 400 | REF3 | This is a demo rule |
... | ... | ... | ... | ... | ... |
The set of rules presented above shows a snippet displaying 5 rules in total, whereby the first 3 rules implement the functional aspect "LIMIT_1".
The rule evaluation of LIMIT_1 is being done according to the waterfall principle: if the condition of rule 1020 (STOCK < 0 ) is met, use "N1" as result. If not, check whether the condition of rule 1050 is fulfilled. If so, RapidRep provides "B1" as result. Else the result is always "B0" (rule 1022).
Example for a subject-specific set of rules
ORDER_ID | RULE_ID | CONTRACT_TYPE | UNDERLYING | PRODUCT_CLASS | HOLDING_PERIOD |
50 | 499 | * | CRE | RECOG_EQUITY_COL | 5 |
51 | 500 | CRMPTFTP | OTHER | MAIN_EQUITY_COL | 5 |
52 | 136 | * | BOND | DEBT_COL_D | 5 |
53 | 88 | EQUITY | FUND | RECOG_EQUITY_COL | 10 |
54 | 95 | GOLD | REC | GOLD_COL | 1 |
... | ... | ... | ... | ... | ... |
This set of rules is very different from the technical example. The columns have subject-specific names and content so that for example a business department would be able to fill in content or confirm it. The procedure for RapidRep to evaluate the rules is still similar.
Functional decomposition
For more complex test objects, one single set of rules often is not enough. Several rule evaluation steps, either performed in parallel or sequentially, may be required to determine the target result.
Thereby, each set of rules has the task to perform a particular transformation step and to pass on the (interim) result to subsequent transformation steps.
If you consider a rule evaluation step as a function f(x) = y, then x is the amount of input data, y the (interim) result and f the logic mapped in a set of rules.
Then the functional decomposition looks for example as follows: f(x) = g(h(x),i(j(x)))
This functional calculation model, expressed in sets of rules, first requires the analysis of the set of rules j(x) = z, afterwards h(x) and i(z) can be determined parallel and eventually be calculated with a set of rules, displayed here as function g.
The RapidRep Designer can model these sequential and parallel steps in the script control of a report definition.
Synopsis
Model-based testing using rules heavily contributes to automation in the test execution. The target values which are often unknown for the target/actual-comparison can be determined in an elegant, compact and transparent manner by using sets of rules.
In order that the contents of the RapidRep sets of rules receive a preferably wide support in the project, sets of rules of almost any structure can be evaluated using RapidRep. This increases acceptance and facilitates content maintenance and coordination.
We recommend Excel workbooks as medium for the creation and maintenance of rules. Using a wizard, RapidRep can safely upload any set of rules to the RapidRep Repository. In the repository, the set of rules will be under version control and following its release, it will be available for the rule-based target value determination.
Model-based testing using RapidRep is also covered in our brochure "Model-based testing":
Download (pdf - 725.8 KiB)