Business Rules Tables

Business Rules Tables are used to implement tests driven by sets of data. The tables have a set of data columns and one or more assertion columns. If a set of input data (i.e., a rule) fails during execution, the remaining rows will still be executed.

A Business Rule Table has two kinds of columns:
  • Input column - These columns represent input data for the given rule.
  • Assertion column - These columns represent an expectation. The row fails if, during execution, the value of the column is different from the value specified. Assertion columns have a question mark at the end.

For example:

In Twist, a Business Rules Table to test the functionality for calculating Simple Interest might be described as follows.

Calculation of Simple Interest
PrincipalTenureRate of interestInterest
10000483200
0450
-10046Invalid Principal amount
5000-146Invalid Tenure
31004-6Invalid Rate of interest