Designing Source, Bug and Quality Traceability
This lesson follows the chain from requirement to production, and explains how each link is created.
Learning outcomes
After completing this lesson, you will be able to:
- List the links in a traceability chain.
- Explain how a branch policy enforces source traceability.
- Describe how bugs are traced to builds and fixes.
- Explain how test cases give requirement coverage.
Why traceability is needed
Three questions arise regularly in any delivery organization. An auditor asks which approved requirement caused a production change. An operator asks what changed in the release that started an incident. A product manager asks whether a bug is fixed, and where the fix is deployed. Traceability answers all of them, provided that the links were made at the time of the work. Reconstructing them later from memory is slow and unreliable, so the aim is for links to be created automatically, as a side effect of normal work.
A full chain has the following links. Each one depends on a practice or a setting.
| Link | How it is created |
|---|---|
| Requirement to work item | A parent link from a Feature to a User Story, or an issue in a project |
| Work item to code | A branch, commit or pull request linked with #123 or AB#123 |
| Code to build | A pipeline records the commit that it built |
| Build to test results | A pipeline publishes results for the run |
| Build to artifact | An artifact belongs to the run that produced it |
| Artifact to deployment | An environment records each deployment and its commits and work items |
The traceability chain
Source traceability
Source traceability connects work to code. In Azure Repos, the Check for linked work items branch policy makes a pull request fail unless a work item is linked, either as a required or an optional check. This turns a good habit into a rule. Azure Boards then shows the commits and pull requests on the work item.
Commit messages are also part of source traceability, because they outlive every tool. A message that explains why a change was made, and includes the work item number, stays useful after a migration between platforms. git blame and git log --follow trace a specific line or file back to the commit that changed it, and through that commit to the work item.
In GitHub, a pull request that references an issue with a closing keyword appears on the issue, and the commit history of a pull request is preserved in the repository. Squash merges produce one commit on main, whose message usually includes the pull request number, so the link survives even though individual commits do not appear on main.
Keeping the link to code
Bug traceability
Bug traceability connects a defect with its cause, its fix and its release. In Azure Boards, a Bug work item can be linked to the test case that found it, to the build where it was found, and to the pull request that fixed it. The Found in Build and Integrated in Build fields record where the defect appeared and where the fix first arrived, and pipelines can update the second field automatically.
This is the information an operator needs during an incident. If production runs build 1042 and the fix was integrated in build 1050, the fix is not deployed. The environment view in Azure Pipelines shows which run is deployed, and it lists the commits and work items included in each deployment, so that the comparison takes moments.
Tracing a bug
Quality traceability
Quality traceability connects requirements with evidence that they work. In Azure Test Plans, a test case can be linked to a requirement, with a Tests relationship. Test plans and suites group test cases, and a requirement-based suite is created directly from a requirement. When automated tests are associated with test cases, or test results are mapped to requirements, the Requirements quality widget and the Stories section of the Tests tab can show which requirements have passing tests.
For a YAML pipeline, an automated test can be linked to a requirement from the Tests tab of a pipeline run. The important idea for the exam is the outcome: a release can report that a stated requirement was tested, and the result of that test.
Evidence that requirements work
Traceability in deployments
In Azure Pipelines, a deployment job targeting an environment records a deployment history for that environment. Each entry shows the run, the commits and the work items, and it allows a comparison of what changed since the last deployment. GitHub records deployments against environments in a similar way, with the commit and the workflow run. For artifacts, GitHub artifact attestations can cryptographically link a build output with the workflow that produced it, which gives traceability that a consumer can verify.
The following diagram shows the chain from work item to deployment.

Deployments as evidence
Answering an auditor
A financial services company uses Azure Repos, Azure Boards and Azure Pipelines. An auditor must be able to confirm, for any production deployment, the approved work item and the test results behind each change. Some pull requests currently complete with no linked work item. What should you configure?
The gap is the link between code and work, so a required Check for linked work items branch policy on main closes it, because a pull request can no longer complete without a link. The pipeline must also publish test results, and production deployments should use a deployment job with an environment, so that the environment history lists the commits and work items for each deployment.
A wiki page recording each release would rely on people, and a commit message convention without enforcement leaves the same gap. An approval on the environment proves that someone approved a deployment, but does not by itself link each change with a work item.
Production runs build 300, and a bug's Integrated in Build field shows build 310. Is the fix in production?
Show answer
No. The fix first arrived in build 310, so a build earlier than that cannot contain it.
Exam Tips
Remember for the exam
- Create links automatically at the time of the work.
- The Check for linked work items policy enforces the link between code and work.
- Found in Build and Integrated in Build show where a bug appeared and where the fix arrived.
- Environments list the commits and work items of each deployment.
- Azure Test Plans links test cases to requirements for quality traceability.