Author Studio comes with a built-in tester that empowers you to comprehensively test the execution of decisions and rules with your own input data without leaving Author Studio.
The tester uses the same Decision Services API available in the InRule SaaS Portal ensuring that rule execution will work the same in the tester as compared to being called from end applications. It provides an authentic demonstration of your rules and evaluates the execution results for correctness, efficiency, performance, and edge cases.
If you have used our desktop rule authoring tool irAuthor, you may be wondering if the Author Studio Tester could be compared to irVerify. Yes, the Tester in Author Studio is the SaaS answer to irVerify and can even be used to test rule changes in Author Studio before checking them back into the catalog.
Launching the Tester
There are two ways to launch the tester.
- The first option is to launch it from the grid view of an entity, decision, or rule set.
You can hover over the component you would like to test and click on the test icon, or you can click on the area the component is in and then click on the test button.
- The second, and most common way to launch the tester is in the context of an entity, decision, or rule set. The Test option is enabled when you are in an appropriate context to launch the tester. Once Test appears in dark text in the navigation pane, click on it to open the tester. In the GIF below, you can see that when the user is in the gird view, the Test button is not enabled, but once the user has opened a Rule, the test button is enabled because they are in the context of a testable component.
Launching a decision vs. an entity or rule set
When you launch the Tester from a Decision, you have a very user-friendly interface that organizes the structure of the input and output to match that of the Entity making it clear to the end user which values are associated with the input and which are associated with the output. The ability to define input vs output is the key difference with launching the Tester from the context of a Decision.
Entities and Rule sets have a single entity structure in the tester used for both input and output meaning you will see values associated with the input and the output in both views.
Testing auto vs. explicit rule sets
When launching the tester in the context of an entity, you will be testing that component and any of its children as well as auto rule sets. The test will not include explicit rule sets outside of that entity.
If you launch the tester in the context of an explicit rule set, you will be testing that rule set as well as any auto rule sets.
Testing overview
The tester is divided into two sections, Input and Output, that you can toggle between once you have run the Tester.
We are using a decision as the example in the screenshots below. Running the Tester with a decision gives the user the ability to define input vs output.
Input
To run the tester, fill out the required information in the Input section. You can fill out the form manually or use JSON. There are three ways to use JSON data, by pasting JSON in the JSON editor (4), by using the Import button (5), or by dragging and dropping a JSON file onto the input area.
3. Decision input entity - This is the name of the entity that serves as the input to this Decision.
4. JSON - This will open the JSON editor that has copy and paste functionality.
5. Import - Import a JSON file to use as your input data.
6. Export - Export your input data as a JSON file.
7. Form clear - This will clear all data from the form so you can start over.
8. Field elements – This section displays the field elements from your rule.
Execution options
On the left side of the tester are the Execution options. Here you can use the toggles to customize the output.
9. Apply Rules/Apply Decisions – Click here to run the tester.
10. Execution Statistics - Provides a summary of the execution statistics. See Summary for an explanation of the execution statistics.
11. Execution Log – Generates an execution log that contains all of the rules, actions and state changes that were performed in the request. It can be viewed inside of the Author Studio interface, copied, or downloaded. Click on the View hyperlink in the Execution log row to open the Execution log.
In the Execution log you can view, copy (1), and download (2) the log.
12. Auto Show Notifications - Displays any triggered notifications in a separate panel once the rules have been applied. You can view, copy (1), and download (2) the notification from the notifications window. Click on the X (3) to close the notifications window and view the output.
13. JSON-only mode - This functionality replaces the input and output fields with a JSON editor that is optimal for large data sets that may otherwise cause the tester to lag or for users who have existing JSON data sets.
Output
The Output tab shows you the results of applying rules. If you would like to go back and change the input data, click on Input at the top of the page.
Simple collections
When launching the tester in the context of a decision, simple collections are shown in a grid format instead of a tree when there are 10 or less fields in the collection.
Rule execution summary
The rule execution summary can be found in the execution panel when you are in output mode.
1. Total execution time - The total time to execute the rule application. This includes time for any compilation steps.
2. Total rule evaluation time - The total time to process conditions in the rule application. This time excludes compile steps and action execution.
3. Total metadata compile time - Aggregate time for runtime meta data generation during this execution sequence.
4. Total function compile time - Aggregate time for .NET delegate generation during this execution sequence.
5. Rule sets fired - The number of rule sets that were executed.
6. Rules evaluated - The number of rule evaluations that were performed.
7. State changes - The number of value changes that were made to the entity schema data values.
8. Actions executed - The number of rule actions executed.
9. Input entities - Total number of input entities instantiated before execution.
10. Output entities - Total number of output entities instantiated after execution.
11. Notifications - The number of fire notification actions that were executed during rule execution.
12. Validation changes - The number of times a field or entity was set valid/invalid.
13. Errors – The number of errors generated during rule execution. If errors exist, you can click View to view a log of the errors.
Testing
To run a test
- Add values to the field elements. You can do this manually or use JSON.
- Select the execution options you want to use when running your test.
- Select Apply Decision. If you are testing a Rule Set or an Entity the button will say Apply Rules.
- Once the test has been run, you are automatically navigated to the Output tab where you can see the result of your test.
Tester limitations
The current version of the tester does not have the following functionality at this time:
- Regression testing
- Rule tracing
- Watch lists
- Metrics
- Or performance statistics reports
Comments
0 comments
Please sign in to leave a comment.