Test Driver Sequence Diagrams

Component Testing for C++

The following example illustrates typical results generated by a Test Driver script:

Instances

When using a Test Driver script, each of the following C++ Test Script Language keywords are represented as a distinct object instance:

  • TEST CLASS

  • TEST SUITE

  • TEST CASE

  • STUB

  • PROC

You can click an instance to highlight the corresponding statement in the Text Editor window.

Checks

Test Driver checks are displayed as Passed ("") or Failed ("") glyphs attached to the instances.

You can click any of these glyphs to highlight the corresponding statement in the Text Editor window.

  • CHECK

  • CHECK PROPERTY

  • CHECK STUB

  • CHECK METHOD

  • CHECK EXCEPTION

To distinguish checks that occur immediately from checks that apply to a stub, method or exception, the three latter use different shades of red and green.

You can click an instance to highlight the corresponding statement in the Text Editor window.

Pre and Post-conditions

The following pre and post-condition statements are green (Passed) or red (Failed) actions contained in STUB or PROC instances.

  • REQUIRE

  • ENSURE

Exceptions

Component Testing for C++ generates UNEXPECTED EXCEPTION Notes whenever an unexpected exception is encountered. These notes will be followed by the ON ERROR condition.

Error Handling

Whenever a check and a pre- or post-condition generates an error, or an UNEXPECTED EXCEPTION occurs, the ON ERROR condition is displayed as shown in the following diagrams.

An ON ERROR BYPASS condition:

An ON ERROR CONTINUE condition:

Comments and Prints

COMMENT and PRINT statements generate a white note, attached to the corresponding instance.

Messages

Messages can represent either a RUN or a CALL statement, or a native code stub call, as shown below:

Related Topics

Contract-Check Sequence Diagrams | About the UML/SD Viewer | UML Sequence Diagrams