How can I compute requirement coverage?
Sample model: Samples/CppSamples/TestConductor/TestingCookbook/CppCompositeCoffeeMachine_wo_ports
Precondition for measuring requirement coverage by executed test cases is the linkage of operations, states and transitions with requirements in the Rhapsody model. Stereotyped dependencies to requirements can be added to model elements in order to establish e.g. traceability or to express that certain model elements contribute to establishing a particular requirement.
The user can define the stereotypes to be considered in the requirement coverage calculation using the property ModelBasedTesting.Settings.StereotypesForDependenciesToRequirements of the code generation configuration of the generated Test Architecture. Consideration of multiple stereotypes can be achieved by listing the stereotypes in a comma separated list. Per default, dependencies with stereotypes trace and satisfy are regarded.
Note that the requirement coverage is based on model element coverage. The requirement coverage is calculated during test case execution if the tags ComputeModelCoverage and ComputeRequirementCoverage both are set. For the test architectures of this model the tag CoverageKind must be set to SUT_hierarchical to calculate model- and requirement coverage data also for the parts of the SUT.
The computation of model element coverage in turn is based on Rhapsody Animation functionality. Because of this the 'Instrumentation Mode' in the 'Settings' dialog of the configuration must be set to 'Animation' to be able to compute model- and requirement coverage information.