CTAL-TTA_001 · Question #31
Which specification-based technique could be used to enhance coverage for this code fragment? 1 credit [K2]
The correct answer is A. Boundary value analysis. Boundary value analysis (A) targets the edges of input ranges - the values just below, at, and just above boundaries - which is exactly where code fragments with conditional logic are most likely to fail, making it the go-to technique for improving specification-based coverage…
Question
Which specification-based technique could be used to enhance coverage for this code fragment? 1 credit [K2]
Options
- ABoundary value analysis
- BExploratory testing
- CState transition testing
- DUse case testing
How the community answered
(53 responses)- A87% (46)
- B4% (2)
- C8% (4)
- D2% (1)
Explanation
Boundary value analysis (A) targets the edges of input ranges - the values just below, at, and just above boundaries - which is exactly where code fragments with conditional logic are most likely to fail, making it the go-to technique for improving specification-based coverage of numeric or range-based conditions.
Why the distractors are wrong:
- B (Exploratory testing) is experience-based, not specification-based - testers design tests on the fly rather than from a spec, so it doesn't fit the "specification-based" constraint in the question.
- C (State transition testing) applies when a system moves through discrete states based on events/conditions; it's overkill and inappropriate for a simple code fragment without state machine behavior.
- D (Use case testing) derives tests from user scenarios and workflows, not from input ranges or conditions in a code fragment.
Memory tip: BVA = "Bugs live at the borders." Whenever you see a code fragment with <, <=, >, >=, or range checks, think BVA first - it's the specification-based technique purpose-built for those boundaries.
Topics
Community Discussion
No community discussion yet for this question.