AcceptanceCriterion
An AcceptanceCriterion encodes a Given / When / Then testable condition attached to a UserStory.
The given and when fields are optional; only then is required. Validation evidence is stored in the validations set as immutable ValidationEntry records — see Validations.
The tags field is an unordered set of short label strings for categorisation; tags from parent and child criteria are merged as a union.
The requirement_specification and requirement_group fields provide optional ISO 29148 traceability. When set, requirement_group must be supplied together with requirement_specification; any requirement_group value is accepted with any requirement_specification. On merge, both fields follow standard scalar semantics: a non-None child value overrides the parent; a None child leaves the parent value intact.
The versions field is an optional string, in vers URI specification format, marking the version since which the criterion is active and, optionally, the version until which it was active. It is validated as a well-formed vers range and follows the same scalar merge semantics as requirement_specification/requirement_group. The applies_to_version method reports whether a given version falls inside the range, always returning True when versions is unset.
AcceptanceCriterion
Bases: MergeableModel
A testable condition attached to a UserStory.
Attributes:
| Name | Type | Description |
|---|---|---|
id |
int
|
Integer identifier, unique within the enclosing UserStory. |
given |
str | None
|
Optional description of the initial context or state. |
when |
str | None
|
Optional description of the trigger condition. |
then |
str
|
Mandatory description of the expected outcome. |
active |
bool
|
Whether this criterion is an active requirement.
Set to |
tags |
frozenset[str]
|
An unordered set of short label strings for categorisation. Defaults to an empty set. |
validations |
frozenset[ValidationEntry]
|
Validation records attached to this criterion.
An AC is considered validated when this set is non-empty and every
record has |
versions |
str | None
|
Optional software version range, in |
is_validated
property
Return True when all validations are present and passed.
applies_to_version(version)
Return True when this criterion's versions range contains the given version.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
version
|
str
|
The version string to check, in the native format of the versions range's own scheme. |
required |
Returns:
| Type | Description |
|---|---|
bool
|
True when versions is unset (unconstrained) or contains version. |
RequirementSpecification
Bases: str, Enum
ISO 29148 document type for an AcceptanceCriterion.
RequirementGroup
Bases: str, Enum
Requirement category within a RequirementSpecification.