Jump to Menu

How to Create Test Cases for SysML Requirement?

Requirement diagram is a useful tool for recording, describing and organization both functional and non-functional requirements of a system. In addition, you can describe how the requirements will be verified with test cases. In this tutorial, we will create a requirement, and then add test cases for validation. Finally, we will walk you through the steps required to produce a report of requirements.

Compatible edition(s): Enterprise, Professional

  • February 16, 2016
  • Views: 48,799
  • PDF

Creating a simple SysML requirement diagram

  1. Select Project > New from the application toolbar.
  2. In the New Project window, enter Tutorial as Name.
    New project
  3. Click Create Blank Project.
  4. Create a SysML requirement diagram first. You can create a requirement diagram by selecting Diagram > New from the application toolbar. Select Requirement Diagram in the New Diagram window and then click Next. Click OK again to create the diagram.
    New requirement diagram
  5. Click a requirement Support registration.
    Requirement shape created

Creating test cases

Let's create some test cases for the requirement Support registration.
  1. Move your mouse pointer over the requirement.
  2. Press on the Resource Catalog icon and drag it out.
    Using Resource Catalog
  3. Release the mouse button. Select Verify <- Test Case from Resource Catalog.
    Create test case
  4. Name the test case as Test Age Input
    Test case created
  5. In addition to having a named test case shape, you can define the steps to test as well. Open the specification by right clicking on test case Test Age Input and selecting Open Specification... from the popup menu.
  6. Open the tab Test Plans. There are three columns. The Steps column defines a set of steps to test the requirement in a more general angle. The Procedures column defines also the steps, but in a more concrete manner by providing also test data. The Expected Results column is the result expected to achieve by walking through the defined procedures.
    Test Plan
  7. Enter the steps as shown below:
    Step Procedure Expected Result
    Enter user information Enter:
    - User name: john
    - Age: 20
    Entered data appear in form
    Submit the form Click the submit button Prompt: Application is submitted

    The screen should look like this:
    Steps entered
  8. Click OK to confirm.
  9. Create another test case to test invalid age input. Repeat the previous steps to create test case Test Invalid Age Input from requirement Registration Form.
    Another test case created
  10. Enter the test plan as shown below:
    Step Procedure Expected Result
    Enter user information Enter:
    - User name: john
    - Age: -1
    Entered data appear in form
    Submit the form Click the submit button Prompt: Invalid age. Please re-enter.

    The screen should look like this:
    Steps entered

Producing a document of requirements and test cases

In this section you are going to produce a Word document that contains the details of requirements and test cases.
  1. Select Tools > Doc. Composer from the application toolbar.
  2. Select Build Doc from Scratch.
    Select Build Doc from Scratch
  3. Find the requirement diagram in Diagram Navigator. Press on the diagram and drag it onto the document.
    Drag requirement diagram to document
    Your document should look like this:
    Document
  4. Press on the requirement Support registration in Diagram Navigator and then drag it onto the document.
    Drag requirement to document
    Your document should look like this:
    Basic requirement info in document
  5. Select the two test cases in Diagram Navigator.
    Multiple select test cases
  6. Select the Details template under the Template pane and then drag it onto the document.
    Drag the Details template to document
    Finally, your document should look like this:
    Final document
  7. Click on Export > Word Document... at the top right of Doc. Composer.
    To export Word document
  8. In the Export Word Doc. window, provide the output path of the .docx file to be exported and then click Export at bottom right.
    Export Word Doc window
    Open the Word file. You can obtain a detailed requirement specification with test cases defined, like this:
    Exported Word document
  9. Save the project. This is the end of the tutorial.


Turn every software project into a successful one.

We use cookies to offer you a better experience. By visiting our website, you agree to the use of cookies as described in our Cookie Policy.

OK