|
Siebel Business Rules Administration Guide > Developing Siebel Business Rules > Process of Developing Business Rules >
Testing a Rule Module
This task is a step in Process of Developing Business Rules. You can use the Siebel Test Harness in HaleyAuthority to test your rules in a simulation environment before deploying the rule module. For this topic, assume your knowledgebase includes the following statements defined as part of a rule module named SR Priority: if a service request does not have a priority then set "Priority" of the service request to "3-Medium"
if the priority of a service request is "1-ASAP" then set "Recommendation" of the service request to "Escalate"
You begin by configuring the Siebel test harness. For more information, see Siebel Test Harness. Configuring the Siebel Test Harness
The first time you perform a test in HaleyAuthority you must configure the Siebel test harness. For subsequent tests, you are not required to configure the test harness again. Instead, you can use the configuration that is completed in this topic. To configure the Siebel test harness
- In HaleyAuthority, from the application-level menu, choose the Tools menu, then the Options menu item.
- Click the Tests & Cases tab.
- In the Test dll window, make sure Siebel Test Harness is chosen.
- Adjust output reporting.
During Siebel Test Harness execution, a series of messages containing information about the current test displays in a separate test harness output window. You can adjust the level of output reporting by enabling or disabling the components listed in the output window.
- Make sure connectivity with the run-time environment is established.
Siebel Test Harness acquires connectivity information, such as connect string, user name and datasource, from the information you provided when importing objects to HaleyAuthority. For details about establishing connectivity, see Importing Siebel Objects into HaleyAuthority.
Next, create a test case. Creating a Test Case
This topic describes how to create a test case. To create a test case
- In HaleyAuthority, click the Tests & Cases tab at the bottom of the screen.
The Tests & Cases window displays.
- Right-click the Test Cases folder, then choose Add a Test Case.
- In the Edit Test Case dialog box, enter a name for the test case in the Description field, then click OK.
SR Priority is an example of a test case name you can enter.
Next, create an example instance for the test case. Creating an Example Instance for a Test Case
After creating a test case, you create instances of concepts that serve as simulated data on which the rules act. To create an example instance for a test case
- Click the Concepts tab at the bottom of the screen.
The Concepts window displays.
- Expand the entity concept.
- Locate, then right-click a concept for which you must create an instance.
- Choose Add, then choose An Instance Or Example.
- For this example, choose the service request entity.
- In the instance dialog box, enter the following entries, then click OK:
- Expand the Instances folder under the service request entity.
Note that test_sr_1 is added as an instance.
- Right-click test_sr_1, choose Properties, then click the Facts tab.
- To add a fact to your instance, click the New icon, then choose a phrasing for your fact.
For example, test_sr_1 has a priority. For the priority value, type 1-ASAP in the priority field, then click OK. Click OK again to close the Properties dialog box.
NOTE: If the associated property includes a value, then add a fact to the instance. For example, to test using a service request instance that does not include a priority value, do not add a has a priority fact to the instance.
Note that the New icon is square and yellow.
- Associate the applicable test cases with the instance.
For example, right-click the test_sr_1 instance, choose Test Cases, click the SR Priority check box, then click OK.
TIP: Alternatively, you can add an example instance to a test case by right-clicking the test case in the Tests & Cases window, then choosing Examples.
- (Optional) Repeat Step 3 through Step 10 for each additional concept.
You must create an example instance for each concept that the rules reference.
Because this example is intended to act on one service request at a time, you must associate only one service request at a time with this test case. Next, run the test case. Running the Test Case
This topic describes how to run the test case. To run the test case
- Click the Tests & Cases tab.
The Tests & Cases window displays.
- Locate, then right-click the applicable test case.
For example, SR Priority.
- Choose Test Case.
- In the HaleyAuthority Enterprise dialog box, click Yes to deploy your logic.
- In the Deploy Configuration dialog box, make the following entries, then click OK:
- Accept the default of the Deploy check boxes checked for all modules.
TIP: To improve performance, you can uncheck other modules that are not part of your test.
- Enter or browse to a directory for the deployed module. For example,
D:\temp.
The Siebel Test Harness dialog is displayed with connection information you provided when importing objects. Note that the directory you specify possesses no persisting value, and does not affect the eventual run-time database to which the module is deployed.
- Click Next.
- In the Siebel Test Harness dialog box, choose the module you must test from the List of Modules defined in HaleyAuthority.
For example, SR Priority.
- Make sure the Select All Rule Modules check box does not include a check mark, then click OK.
This step logs you in to the run-time database so that the Siebel Test Harness can acquire metadata about the run-time environment. After you click OK, the test case executes.
Next, examine test results, then run more tests. Examining Test Results
This topic describes how to examine test results. To examine test results
- Examine data displayed in the Output Window.
For this example, only one statement displays because none of the other conditions for the statement are satisfied:
1 if the priority of a service request is "1-ASAP" then set "Recommendation" of the service request to "Escalate"
Note that only statements that are executed are displayed. For more information, see Test Harness Output Window.
- Test other conditions of your rule module:
|