+49 (30) 467086-20 service@microtool.de
Products » objectiF RPM » Create and Execute an Extension Function » Extension “Create Test Case For Requirement”

Extension “Create Test Case For Requirement”

Starting with version 5.2.3, you can download the extension function from the Amazon cloud and use it in a project of your choice.

The extension function allows you to automatically create a test case for a requirement. The test case is created when the requirement does not yet have a test case and enters a defined state. A verify relationship between test case and requirement is created and the test case is named Testfall zu {Name der Anforderung}. You can user parameters to determine the composition of the test case’s name, the state of the test case when it is created, and which state change of the requirement triggers execution of the extenstion function.

Tip
Substereotypes of Requirement are only recognized if they do not have their own state machine. By default, no test cases are created for requirements of type Bug, Epic, FeatureRequirement and User Story.

Tip
Make sure that Node.js is enabled for the service in the Service Manager, otherwise the extension function cannot be executed.

In order for the extension function to work correctly, you’ll need to do the following after downloading the function:

Configure the extension function

There are two paramaters that you can adjust for the extension function.

For the first parameter Test Case Prefix (testCasePrefix) specify the composition of the test case’s name. By default, the name of the test case is comprised of Testfall zu + the name of the requirement.

For the second parameter Test Case State (testCaseState) specify which state the test case is created with. Make sure that the state is correctly specified and that it exists in the state machine for test cases. If you leave the parameter undefined or the state is incorrectly given, no test case will be created.

  1. Navigate to the package into which the extension function was imported.
  2. In the context menu of the extension function choose Edit.
  1. Switch to the Parameter tab. Confirm whether you want to use the standard values. 
    The first parameter defines the name of the test case. Here you have different possibilities. You may leave the value as is: Testfall zu [Name of Requirement]. You may change the value: Your value [Name of Requirement]. If nothing is specified, the name of the requirement is used for the name of the test case: [Name of Requirement].
    The second parameter defines the initial state of the test case. The parameter is set to defined by default. Make sure that this state exists for test cases in your project. If you have modified this state machine, you’ll need to enter a different state here.
  1. Close the dialog with OK.

Define package

Packages of type RequirementsDefinition and their substereotypes (Personas, Requirements, Risks, TestCases, UseCases and UseScenarios) offer the possibility to specify a test case package.

  • From the context menu of the desired package, choose the command Edit.
  • Switch to the tab Further Properties and specify for TestCasePackage a package using the  […] button.
Test cases alongside requirements

If you want the test cases to appear alongside requirements, choose the package where the requirements are located.

Test cases in their own package

If you have created a separate package for test cases, then define this package for the requirements package. The package can be located anywhere.

If your requirements are distributed across different packages, but you want to put all test cases in one package, go to the highest common package of requirements and specify there the package for the test cases.

Test cases in various packages

If the requirements are distributed across different packages and you want the test cases to be stored in their own packages, define in each requirement package the desired test case package.

Adjusting state machines

Finally, you’ll need to adjust the state machine for requirements. If you have your own state machines for substereotypes of Requirement in your project, you must add the action there as well if test cases are also to be created for these requirements.

  1. Open the Settings window and from there the state machine …for requirement from the package State machine.
  2. Choose the comman Edit from the context menu of the desired state.
  1. Change to the tab Entry Actions and choose the action Run extension function by clicking the Plus.
  2. Click on the three blue dots and choose “Create Test Case For Requirement“.
  3. Close the dialog with OK.

Running the extension function

Tip
If all test cases for a requirement have been deleted and the requirement has returned to its initial state definition ongoing, the extension function will be executed again through the action and test cases are created.

Deleting the extension function

If you are using the extension function in an action and/or as a command, you must first delete the command and/or the action. Only then can you remove the extension function by choosing the Delete command in the context menu of the function. This deletes the extension function, but not the extension schema, since it may be contained in other extension functions.