August 2009: CO-ODE has now officially finished
You should still find most of what you are looking for on the site.
But also see here for ongoing OWL work @ Manchester
The OWL Unit Test Framework

The OWL Unit Test Framework provides a mechanism for describing the expected classification status of individual OWL classes, and a test facility that checks whether or not the actually classification status corresponds to the expected classification status. These Unit Tests can be added to existing OWL classes, or special Unit Test classes can be created.

 Download the OWL Unit Test Plugin

OWL Unit Test Plugin (build 1) for use with the OWL Plugin build 226 or later



Last updated: 25th February 2005


 Documentation

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.

1. Enter a name for the Unit Test Class.
2. Specify where to place the Unit Test Class in the class hierarchy. To do this use the plus button to add the classes that should be superclasses of the Unit Test Class.
3. Specify whether or not the class should be consistent or inconsistent after a consistency check. If it is specified that a class should be inconsistent, the wizard will finish here and the Unit Test Class will be created.
4. If the expected consistency of the Unit Test Class being created was specified as being consistent in the previous step the page shown below will be displayed. This page is used to specify the expected inferred superclasses. Use the 'plus' button to add expected inferred superclasses. The next page is similar, but it allows expected inferred subclasses to be specified.
5. On the final page of the Unit Class Creator Wizard press the "Finish" button to create the Unit Test Class. The Unit Test Class will be created and selected in the class hierarchy.

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.


 Author

Matthew Horridge
The University Of Manchester


 Level of Support

The OWL Unit Test Framework is under active development. All comments and suggestions/feature request will be appreciated! Please post questions and requests to the Protege OWL mailing list where I will respond to them, or use the co-ode forum.


 License

The OWL Unit Test Framework is licensed under the Lesser GNU Public License

Copyright University Of Manchester 2004