Running a Unit Test

Unit testing enables you to improve the quality and reliability of your applications by writing unit tests as your system is built and by performing extensive unit testing with minimal user intervention. You can build your own unit testing driver or you can use the default JADE unit test functionality.

Develop tests for a unit of code (which can be a fragment, a method, or a module) as the code is written, to ensure that quality is built into a project from the early stages.

Unit tests isolate each part of the program and show that the individual parts are correct. They provide a strict, written contract that the piece of code must satisfy. Use unit testing to:

The Jade menu displays the Unit Test Debug command if a user-defined schema with the JadeTestCase subclass, a JadeTestCase class or subclass, or a method in a JadeTestCase subclass is selected.

Visual Studio uses the F9 key to set breakpoints, by default, and uses the F5 key to run and continue debug execution. JADE uses the F5 key to set breakpoints and the F9 key to run and continue debug execution. Switching between the two development environments can lead to confusion and frustration when using the F5 and F9 keys. You can swap the F9 and F5 accelerator key bindings, by checking the Swap F5 (Toggle Breakpoint) and F9 (Execute/Continue) accelerators check box on the Short Cut Keys sheet on the Preferences dialog. This check box is unchecked by default (that is, false). For details, see "Maintaining Shortcut Keys", in Chapter 2.

To run a unit test and invoke the test dialog

To execute and debug a unit test, perform one of the following actions

The JADE unit test framework is then initiated in JADE debug mode for the selected JadeTestCase class or selected method of the class if a method is selected. For details, see Chapter 17, "Running Unit Tests", in the JADE Developer’s Reference.