Last updated: 25th February 2005
The functionality of the OWL Unit Test framework is accessed from the "OWL Unit Testing submenu on the "Tools" menu shown below. The OWL Unit Test framework operates by attaching Unit Test information to OWL named classes. This information, which is formatted as XML, is attached to classes via the use of OWL annotation properties. This means that the Unit Test information doesn't impact on the ability to classify an ontology with a DL reasoner. It also means that the Unit Test information persists in the OWL ontology file.
When the Unit Tests are executed, classes that have Unit Test information attached to them are examined and checks are performed to ensure that the actual classification status of such classes corresponds to the expected classification status. This mechanism makes it possible to turn existing OWL classes in an ontology into OWL Unit Test Classes simply by attaching Unit Test information to them. However, it is recommended that special purpose Unit Test Classes are created, in order to maintain a separation between Unit Test Classes and ontology domain classes. This guide describes how to create and use Unit Test Classes.
Creating Unit Test Classes
To create a Unit Test Class select "Create unit test class" from the "OWL Unit Testing" submenu on the "Tools" menu. This will pop open a wizard that acts as an assistant in creating the Unit Test Class. Fill in the fields required by the wizard by following the steps below.
Running Unit Tests
Before any OWL Unit Tests are run, the ontology should be classified first.
The OWL Unit Test plugin integrates with the Protege-OWL Ontology Test Framework. This means that the various OWL Unit Tests can be run along with the ontology tests by pressing the "Run ontology tests" button on the Protege toolbar. The test settings can be configured (gloablly enabled/disabled) via the "Test Settings..." option on the "OWL" menu.
To directly run the OWL Unit Tests select the "Run Unit Tests" item from the "OWL Unit Testing" submenu that is located on the "Tools" menu.
After the Unit Tests have been run, the "OWL Unit Test Results" panel shown below will appear at the bottom of the Protege application window. Each line in the Unit Test Results window represents a single Unit Test - the actual result is indicated by the icons in the "Type" column. A red circle with a cross in the centre (
) means that the test had failed, a green circle with a tick in the centre (
) means that the test has been passed. In both cases, a message is displayed in the test result column that describes the reasons why a test has been passed or failed.
Finding Unit Test Classes
It is conceivable that OWL Unit Tests will be scattered thoughout an ontology. In order to assist in finding Unit Test Classes, the "Find Unit Test Classes" item on the "OWL Unit Testing" submenu can be used. This will cause a list of Unit Test Classes to be displayed at the bottom of the Protege application window as shown below. A Unit Test Class can be navigated to by double clicking it.
Editing Unit Test Information
The Unit Test Class information such as expected consistency, expected inferred superclasses and expected inferred subclasses that is stored for each Unit Test Class can be edited or created and attached to any selected named class by pressing the "Edit Unit Test Information" button shown below. (This button is located on the button bar at the bottom of the OWL Classes tab).
The Unit Test information dialog shown below will pop open. As can be seen it is possible to add a comment the Unit Test Class, and also modify the test parameters. It is also possible to enable or disable OWL Unit Tests on an individual basis. To do this, check or uncheck the "Enabled" check box at the top of the Unit Test information dialog.
Showing and Hiding Unit Test Classes
It is possible to hide all Unit Test Classes (and then show hidden Unit Test Classes). To do this select the "Hide all unit test classes" from the "OWL Unit Testing" submenu on the "Tools" menu. To show any hidden Unit Test Classes select the "Show all unit test classes" from the "OWL Unit Testing" submenu.
Removing Unit Test Information
To remove Unit Tests either delete the Unit Test Class that the Unit Test information is attached to, or, select the class that the Unit Test information is attached to and then select "Remove Unit Test Information" from the "OWL Unit Testing" submenu.The University Of Manchester
Copyright University Of Manchester 2004
