Skip to main content

Overview

The macro computes bidirectional link coverage: it can measure forward links (source items linking to targets via a role) or backward links (source items with incoming links from targets). Coverage is expressed as a percentage and used to identify traceability gaps in automotive safety workflows.

Key Use Cases

  • Verification Coverage: Measure percentage of system requirements verified by test cases (sysReq ← verifies ← testCase)
  • Requirement Refinement: Track percentage of customer requirements refined into system requirements (customerReq → refines → sysReq)
  • Risk Control Traceability: Validate that failure modes are linked to mitigation actions
  • Safety Goal Allocation: Check that hazards are linked to derived safety goals
  • Validation Coverage: Monitor percentage of requirements validated by validation test cases

Macro Signature

#set($result = $nxLinkCoverage($sourceItems, $targetType, $linkRole, $direction))

Parameters

NameTypeDescription
$sourceItemsCollectionCollection of work items to evaluate for link coverage (e.g., $sysReqList)
$targetTypeStringWork item type filter for target items (e.g., "testCase", "desReq", "riskControl")
$linkRoleStringLink role name defining the relationship (e.g., "verifies", "refines", "mitigates")
$directionStringLink traversal direction: "forward" (source links to target), "backward" (target links to source)

Return Value

The macro returns a map object with the following properties:
PropertyTypeDescription
coveredIntegerCount of source items that have at least one link matching the criteria
totalIntegerTotal count of source items evaluated
coverageFloatCoverage percentage (0–100): (covered / total) * 100
uncoveredIntegerCount of items without matching links: total - covered
gapQueryStringLucene query string identifying items without links (for drill-down)

Output Variables

When invoked, nxLinkCoverage also sets global Velocity variables for convenience:
VariableTypeDescription
$nxLinkCoveredIntegerNumber of items with links
$nxLinkTotalIntegerTotal items evaluated
$nxLinkCoverageFloatCoverage percentage
$nxLinkUncoveredIntegerNumber of items without links
$nxLinkGapQueryStringGap query for missing links
Link RoleDirectionSource TypeTarget TypePurpose
verifiesbackwardtestCasesysReq / desReqTest case verifies requirement (V-model)
validatesbackwardtestCasecustomerReq / userNeedTest case validates requirement
refinesforwardsysReq / desReqparentTypeRequirement refines higher-level requirement
mitigatesbackwardriskControlfailureModeRisk control mitigates failure mode
assessesforwardfailureModecharacteristicFailure mode assesses characteristic
allocatesforwardfunctionsystemElementFunction allocated to system element

Example: System Verification Coverage

Calculate what percentage of system requirements have verification test cases:
#set($sysReqList = $helper.queryWorkItems("type:sysReq"))
#set($result = $nxLinkCoverage($sysReqList, "testCase", "verifies", "backward"))
#set($percent = $result.coverage)
#set($gapQuery = $result.gapQuery)

System Verification Coverage: $percent% ($result.covered of $result.total)
Unverified: $result.uncovered items

[View Gap] ← query: $gapQuery

Example: Requirement Refinement Coverage

Track percentage of customer requirements decomposed into system requirements:
#set($custReqList = $helper.queryWorkItems("type:customerRequirement"))
#set($result = $nxLinkCoverage($custReqList, "sysReq", "refines", "backward"))

Customer Requirements Refined: $result.coverage% ($result.covered / $result.total)

Example: Risk Control Mitigation Coverage

Validate that all failure modes have linked risk controls:
#set($fmList = $helper.queryWorkItems("type:failureMode"))
#set($result = $nxLinkCoverage($fmList, "riskControl", "mitigates", "backward"))

#if($result.coverage < 100)
  ⚠️ $result.uncovered failure modes without risk controls
  Gap query: $result.gapQuery
#end

Forward Direction

When direction="forward", the macro evaluates: Example: Customer Requirement → refines → System Requirement
  • For each customerReq in the source collection
  • Check if it has outgoing links with role "refines"
  • Count how many have at least one such link to a sysReq

Backward Direction

When direction="backward", the macro evaluates: Example: System Requirement ← verifies ← Test Case
  • For each sysReq in the source collection
  • Check if it has incoming links with role "verifies"
  • Count how many have at least one such link from a testCase

Coverage Interpretation

Coverage %InterpretationAction
100%All items linked✅ No gaps
90–99%Most items linked⚠️ Investigate remaining gaps
50–89%Partial coverage🔴 Significant traceability work needed
<50%Majority unlinked🔴 Incomplete traceability chain

Gap Query Structure

The gapQuery property contains a Lucene query identifying items without matching links. Typical structure:
type:sysReq AND NOT backlinkedWorkItems:verifies=TA*
This query can be used to:
  • Create a saved collection in Polarion (filtered view of gap items)
  • Navigate to gap items for manual linking
  • Pass to report generators for gap analysis
  • Set as a drill-down link in dashboard widgets

Query Components

ComponentMeaning
type:sysReqFilter to source work item type
NOT backlinkedWorkItems:verifies=TA*Exclude items with backward verifies links from project prefix TA*
NOT linkedWorkItems:refines=TA*Exclude items with forward refines links to project TA*

Integration with Coverage Bars

nxLinkCoverage output is typically rendered using the nxCoverageBar macro:
#set($result = $nxLinkCoverage($sysReqList, "testCase", "verifies", "backward"))
#nxCoverageBar($result.covered, $result.total, "System Verification", $result.gapQuery)
This generates a visual progress bar with:
  • Coverage percentage display
  • Color-coded status (green ≥90%, yellow 50–89%, red <50%)
  • Clickable gap link for drill-down

Performance Considerations

  • Collection Size: Efficiently handles 100+ source items per invocation
  • Link Queries: Polarion’s indexed Lucene queries optimize link traversal
  • Multi-Invocation Dashboards: Safe to call multiple times per page (different roles/types)
  • Batch Operations: For large-scale coverage analysis, combine with topic discovery for semantic grouping
MacroPurpose
nxCoverageBarRender coverage percentage as visual progress bar with gap drill-down
nxOrphanDetectIdentify work items WITHOUT links to specified roles (orphan analysis)
nxAPBucketsClassify FMEA failure modes by Action Priority (H/M/L) distribution
nxRiskMatrixRender 2D risk matrix with severity vs. occurrence bucketing

Common Errors

If $sourceItems is empty or null, coverage will show 0/0 = NaN. Always validate collection before macro invocation:
#if($sourceItems.size() > 0)
  #set($result = $nxLinkCoverage($sourceItems, ...))
#end
Link roles are case-sensitive and must match RTM model definition. Verify in .polarion/nextedy/models/*.yaml before use.
If using backward with a forward-only relationship (or vice versa), coverage will show 0%. Audit the RTM model documentation to confirm link role directionality.
To assess multi-hop traceability (e.g., sysReq → desReq → testCase), invoke nxLinkCoverage twice:
#set($r1 = $nxLinkCoverage($sysReqList, "desReq", "refines", "backward"))
#set($r2 = $nxLinkCoverage($desReqList, "testCase", "verifies", "backward"))

Standards Compliance

nxLinkCoverage supports ISO 26262 and AIAG-VDA FMEA traceability verification:
  • ISO 26262 Part 4: Verification coverage (requirements to test cases)
  • ISO 26262 Part 8: Bidirectional traceability matrix validation
  • AIAG-VDA FMEA: Risk control mitigation linkage completeness
  • IATF 16949: Requirement decomposition chain continuity

Architecture Diagram

diagram

Version Info

  • Available Since: Nextedy Solutions v1.0
  • Last Updated: 2026 Q1
  • Tested With: Polarion 22.2+, Nextedy Risksheet/Powersheet v3.5+