About Parameterized Validation

Parameterized validation simplifies validation logic and improves maintainability of test.

How it works

The expected result of an action depends on the input and the validation must be able to determine expected result to perform its task correctly. One way to determine the expected result is to use programmed logic, but for complex behavior this approach leads to much program code to maintain. Another approach is to add an extra parameter to the test method to control the validation and to control the parameter outside the program code.

Like all other parameters used in Combinatorial Testing the parameter controlling the validation is a collection of factors with each factor having a limited set of possible values. For example, the parameter telling how many objects to expect to be affected by a Delete operation in a CRUD system could take three values: ‘Zero’, ‘One’ or ‘Multiple’.

The factors used in a combinatorial test design reflect the behavior of the system under test and there is a direct link between the choice of the test data and the expected result. Moreover, this link is often very straight forward. For example, the Delete operation is expected to return 1 if the data is inserted or updated and 0 otherwise. 

The trick with parameterized validation is to bring the decisions about how to validate together with the decisions about what to test and to express both jointly in a combinatorial setting. 

QS provides powerful features to combine combinatorial test design with choice of validation. This provides the ability to create Scalable Test Designs, which are test designs where the strength of the test, overall or in specific areas, can be adjusted up and down while the correct validations are applied automatically.