Definition

Requirements and Defects are two concepts commonly related to Tests.

A Requirement represents a singular documented physical and functional need that a particular product or process must be able to perform. It is also an important input into the verification process, since a test should trace back to a specific requirement, showing what elements and functions are necessary for the particular project. Most of the time, Requirements are the only coverable/testable entities.

A Defect represents a condition in a software product which does not meet a software requirement (as stated in the requirement specifications) or end-user expectations (which may not be specified but are reasonable). It can be displayed as an error, flaw, failure, or fault in a computer program or system that produces an incorrect or unexpected result, or causes it to behave in unintended ways.

These two concepts can be mapped to different issue types in organizations.

Both Requirement and Defect issue types in your Jira instance (as well as any other issue type) can be configured in the Xray project settings as coverable/testable entities. When an issue type is configured to be coverable/testable, Xray provides specific web panels and reports to display the coverage of issues as well as their latest status regarding testing. 

Defect issues types can also be mapped in the Xray project settings as Defects. With this configuration, Xray sets the default issue type when creating defects from testing, as well as providing reports specific to defects.


Please note

Both the Test Coverage and Defects can be configured for each project independently. Go to Project Settings > Xray settings.


A typical Jira configuration can have the following issue types configured for Test Coverage or mapped as Defects.

requirements_and_defects

Often, a Defect issue type is also configured as a testable entity. To ascertain that a Defect does not occur again, it can be considered for testing. Xray allows the same issue type to be mapped as being Coverable and as a Defect. A Defect can then be associated with Test issues and be considered for Test Coverage charts. 


Please note

The same issue type in a given project can be configured for Test Coverage and also be a Defect.


Requirements and Defect issues can be associated with Tests and Test Set issues within the Jira default linking mechanism. There are specific issue link types for associating these issue types:

  • Requirement R "is tested by" test T (or test set TS)
  • Test T (or test set TS) "tests" requirement R
  • Defect D "is created by" test T
  • Defect D "is tested by" test T (or test set TS)
  • Test T "created" defect D
  • Test T (or test set TS) "tests" defect D

xray_issue_linking

Customizing the "Tests" Issue Link Type: During the installation of Xray, the Issue Link Type "Tests" that is used in the association between Tests/Test Sets and Coverable (e.g., requirements) entities is automatically created. You can customize the default name, outward and inward description of this Issue Link Type, but after that, you need to disable and then enable the add-on in the Manage add-ons page.

By default, the issue link "Test" has "tests" and "tested by" as outward and inward descriptions, respectively.

If you decide to downgrade to a version <= 3.0.x, make sure you restore the default Issue Link Type names and descriptions; otherwise, Xray will create new Issue Link Types.

Sub-Requirements

A requirement can be associated with sub-requirements, resulting in a hierarchy of requirement issues. "Epic" requirements can thus be decomposed into smaller requirements, each associated with specific tests. This decomposition of requirements facilitates the management of epic requirements and makes their coverage analysis easier.

The requirement > sub-requirement (i.e., parent > child) relation can be defined in the "Issue Type Mapping" configuration section of Xray. Sub-Requirements can be associated with requirements using the Jira linking mechanism or using "Sub-Task" requirement issues.

Below are the different ways Xray considers issues as sub-requirements of a given "requirement". 

xray_subrequirements


Xray also allows to have more than 2 levels of requirements, to achieve it you must define a custom issue link and use it to define the issue links relations between requirements.

Multi_level_requirement


For more information on Coverage Status, please go to the Coverage Analysis page.


Associating a Requirement with a Test

There are several ways to associate a Requirement issue with a Test issue.

From the Requirement issue view screen

Step 1: Open the Requirement you wish to associate a Test with. In the given example, Story issue types are mapped as Requirements.

Step 2: Click on Link issue button. The Link section will appear.

Step 3: On the field of the middle, select the is tested by option.

Step 4: In order to select the Tests or Test Sets to be associated, you can:

- Input the desired Test/Test Set Issue Key on the Issue field
- Click on the Down Arrow on the Issue field and select the Test from its Issue list
- Click on the search for an issue link to use the Find Jira issues browser

Step 5: Click Link.


From the Test issue view screen

Step 1: Open the Test you wish to associate a Requirement with.

Step 2: Click on Link issue. The Link section will appear.

Step 3: On the field of the middle, select tests option.

Step 4: In order to select the Requirements to be associated, you can:

- Input the desired Requirement Issue Key on the Issue field
- Click on the Down Arrow on the Issue field and select the Requirement from its Issue list
- Click on the search for an issue link to use the Find Jira issues browser

Step 5: Click Link.


From the Test Set issue view screen

Step 1: Open the Test Set you wish to associate a Requirement with.

Step 2: Click on Link issue. The Link section will appear.

Step 3: On the field of the middle, select tests option.

Step 4: In order to select the Requirements to be associated, you can:

- Input the desired Requirement Issue Key on the Issue field
- Click on the Down Arrow on the Issue field and select the Requirement from its Issue list
- Click on the search for an issue link to use the Find Jira issues browser

Step 5: Click Link.


Associating a Defect with a Test

There are two ways to associate a Defect issue with a Test issue.

From the Defect issue view screen

Step 1: Open the Defect you wish to associate a Test with.

Step 2: Click on Link issue. The Link section will appear.

Step 3: On the field of the middle, select either the created by or the tested by option.

Step 4: In order to select the Tests to be associated, you can:

- Input the desired Test Issue Key on the Issue field
- Click on the Down Arrow on the Issue field and select Tests from its Issue list
- Click on the search for an issue link to use the Find Jira issues browser

Step 5: Click Link.


From the Test issue view screen

Step 1: Open the Test you wish to associate a Defect with.

Step 2: Select More > Link. The Link screen will appear.

Step 3: On the This issue field, select either the created or the tests option.

Step 4: In order to select the Defects to be associated, you can:

- Input the desired Defect Issue Key on the Issue field
- Click on the Down Arrow on the Issue field and select Defect from its Issue list
- Click on the search for an issue link to use the Find Jira issues browser

Step 5: Click Link.



  • No labels