Testing Derivations

TrialGrid can test Derivations in a similar manner to testing Edit Checks. A Test Case for a Derivation will have steps to enter data into the fields included in the Derivation Steps and then a step to check that the Derivation has calculated the correct result.

TrialGrid can suggest Test Cases for Derivations from the Derivation editor sidebar.

Note

there is no ‘Test Case Advisor’ to generate Test Cases for multiple Derivations at the same time.

Note

TrialGrid will not always be able to suggest appropriate values for Fields in Derivation Test Cases, particularly if the Derivation includes additional Fields which are used to trigger the Derivation calculation in Rave but which do not form part of the Derivation result. If TrialGrid cannot calculate data values then it will create a Test Case which can then be manually edited.

This example tests a Derivation called “AVG_HRT”

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
 @Derivation:AVG_HRT
 Feature: Test Average Heart Rate Derivation

   Background:
     Given I am logged in with role "Investigator"
     And a subject exists

   Scenario:Derivation result
     When I enter data:
       | DataPoint    | Value |
       | V1.VS.HRT[1] | 78    |
       | V1.VS.HRT[2] | 80    |
       | V1.VS.HRT[3] | 82    |
     Then I should see field "V1.VS.AVG_HRT" has value "80"

Note

In the above example the ‘I enter data’ step will only submit data for the specific fields. All others will be ‘untouched’ in Rave. Sometimes Derivations are triggered from an invisible Field which would not be submitted when using an ‘I enter data’ step and so the Derivation would not be run. In this case the ‘I enter and save data’ step should be used.