Help Center/ CodeArts TestPlan/ Best Practices/ Designing a Test Based on Requirements
Updated on 2024-11-13 GMT+08:00

Designing a Test Based on Requirements

Overview

The test design feature in the CodeArts TestPlan provides multi-dimensional test strategies and design templates. Based on different design inputs, there are two processes to generate the test scheme and test cases: requirement > scenario > test point > test case, and feature > scenario > test point > test case. The feature utilizes mind maps and heuristic testing to encourage testers to visually represent their test models. It also improves test design efficiency, optimizes test completeness, and helps testers reduce product test omissions during execution.

This function enables you to combine factors using multiple modes and algorithms, and generate test cases in batches from the resulting combinations. In addition, you can reference action and data factors to efficiently generate test cases in batches, freeing yourself from repeated writing of test cases of a test point. The test cases generated in this way are clear and unified in structure.

This section describes how to generate a single test case based on the requirement, and how to generate test cases in batches by using test factors.

Prerequisite

  1. You have created a project. This section uses a Scrum project as an example.
  2. You have created a requirement work item.

Generating a Test Case Based on Requirements

  1. Log in to the CodeArts homepage, search for your target project, and click the project name to access the project.
  2. In the navigation pane, choose Testing > Testing Design.
  3. Click Requirements on the left, select a requirement, and click Create in the upper left corner.

  4. The mind map page is displayed. Right-click the root node, and choose Add Subnode(Ins) from the shortcut menu. Change the subnode name to Mobile Testing.
  5. On the toolbar above the mind map, click to tag the node as a scenario. If is displayed next to the selected node, the scenario is added successfully.

  6. Right-click the Mobile Testing scenario node, add a subnode, and change the subnode name to Test the camera function of the mobile phone. On the toolbar above the mind map, click to tag the node as a test point. If is displayed next to the selected node, the test point is added successfully.

  7. Add a prerequisite subnode and a test step subnode to the Test the camera function of the mobile phone node, and then add an expected result subnode to the test step. Example:

    • Prerequisite: The mobile phone provides a personalized photographing mode
    • Step: Set the resolution to 800,000 pixels, and the mode to auto flash, auto ISO exposure, and motion
    • Expected result: Successful

  8. Right-click the Test the camera function of the mobile phone. node and choose Generate Case from the shortcut menu to create a draft case. If is displayed on the node, the operation is successful. In this case, a draft case is generated. Click . The case details are displayed on the right of the page.
  9. Right-click the node for which a case has been generated and choose Archive Case from the shortcut menu. The Archive Case window is displayed.
  10. On the left, select the test cases to be archived. On the right of the page, set Version, Case Library/Test Plan where the test case is to be stored, and Execution Mode, select a feature, and click Confirm. (The requirement selected during mind map creation is associated to this test case by default if you have subscribed to CodeArts Req.) If is displayed in the node, the operation is successful. You can find the test case on the Testing Case page. Click . The test case details page is displayed.

Generating Combinatorial Cases in Test Factor Center

To use the Test Factor Center function, create a factor library first. A project can have only one factor library. Go to the Testing Design page, and click Test Factor Center to access the factor library. You can create a test factor library either by creating new factors or importing existing ones.

Creating new factors

  1. Click the root directory in the factor library tree (create one if there is no library available), click , choose Create Directory, and enter a library name.
  2. Click the directory and click Create Factor.
  3. Enter a factor name, set Factor Type to Data Factor, click Add, set valid values and invalid values for the factor, and click Confirm.

    Configuration Item

    Mandatory

    Description

    Factor Name

    Yes

    Name of a data factor (1–500 characters).

    Factor Type

    Yes

    Default type: Data Factor.

    Factor Description

    No

    Brief description of a data factor. Max. 500 characters.

    Data Type

    Yes

    Default type: String.

    Valid Value

    No

    Elements of a data factor. Click Add to add more valid values.

    Invalid Value

    No

    Elements not supported by a data factor. Click Add to add more invalid values.

    Remarks

    No

    Max. 500 characters.

    For example, to test the camera function of a mobile phone, create data factors Pixels, Flash mode, ISO, and Scene mode, as shown in the following figures.

  4. To create an action factor, configure the following information and click Confirm.

    Configuration Item

    Mandatory

    Description

    Factor Name

    Yes

    Name of an action factor (1–500 characters).

    Factor Type

    Yes

    Select Action Factor.

    Factor Description

    No

    Brief description of a data factor. Max. 500 characters.

    Prerequisite

    Yes

    Enter the prerequisites of an action factor. Max. 2,000 characters.

    Test Steps

    Yes

    Enter the step description and expected result. In the Step Description column, use ${Data Factor} to invoke data factors. Click + in the Operation column to add a test step.

    Remarks

    No

    Max. 500 characters.

    For example, to test the camera function of a mobile phone, the action factor Take a photo may be set as shown in the figure below.

Importing existing factors

  1. Go to the test factor center, select a directory, and click Import.
  2. Click Download Template, edit the downloaded file on the local PC, and upload the file.

    After the file is imported, directories and factor data configured in it are displayed in the factor library.

Generating cases in batches using test factors

  1. In the requirement tree, click a requirement, and click a mind map.
  2. Right-click a test point to be associated with the factor library, and choose Associate Factor Library from the shortcut menu.
  3. Select the target factor library directory, select useful factors, and click Confirm.

  4. Right-click the test point and choose Generate Combinatorial Case from the shortcut menu.
  5. Click Data Factor and select a combinatorial algorithm.
  6. Click Preview Combination to see the combinations. The following figure shows the combinations generated using the PairWise algorithm.

  7. Select combinations and click Next.

  8. The Configure Test Case page is displayed. Check the prerequisites, steps, and expected results of the action factor. Edit the information as required. Click Confirm to generate combinatorial cases.
  9. Click the case icon in the test point.
  10. Select cases and click Archive Cases.
  11. On the left, select the test cases to be archived. On the right of the page, set Version, Case Library/Test Plan where the test case is to be stored, and Execution Mode, select a feature, and click Confirm. (The requirement selected during mind map creation is associated to this test case by default if you have subscribed to CodeArts Req.)
  12. Click in the upper left corner of the page. Choose Testing > Testing Case to check the archived cases in the case list.