CAST - Test Design and Techniques Questions and Answers 1 — Questions and Answers
Question 1: A tester is designing test cases for a feature that allows users to book a flight. The business logic for pricing is complex and depends on multiple factors such as travel class (Economy, Business, First), passenger type (Adult, Child, Infant), and whether the booking is refundable (Yes/No). Which black-box test design technique would be most effective for systematically testing these combinations of conditions?
- State Transition Testing
- Boundary Value Analysis
- Decision Table Testing (Correct answer)
- Equivalence Partitioning
Correct answer: Decision Table Testing
Decision Table Testing is the most suitable technique for this scenario because it is designed to handle complex business rules and combinations of input conditions. It provides a systematic way to create test cases for every possible combination of the conditions (Travel Class, Passenger Type, Refundable) and their resulting actions (the price calculation), ensuring comprehensive coverage.
Question 2: A login function has a defined workflow: a user is initially in an 'Unauthenticated' state. If they enter a correct password, they transition to the 'Authenticated' state. If they enter an incorrect password, they remain 'Unauthenticated'. After three incorrect attempts, they transition to a 'Locked' state. Which test design technique is best suited for verifying this functionality?
- State Transition Testing (Correct answer)
- Decision Coverage Testing
- Use Case Testing
- Error Guessing
Correct answer: State Transition Testing
State Transition Testing is ideal for this scenario because the system can be described in a finite number of states ('Unauthenticated', 'Authenticated', 'Locked'), and the tests focus on the events (correct password, incorrect password) that cause transitions between these states.
Question 3: A tester is using a white-box testing technique. They have written test cases that ensure every line of executable code in a function has been run at least once. However, they have not necessarily tested all the possible outcomes of an 'if-else' statement within that function. Which level of coverage has been achieved?
- Path Coverage
- Decision Coverage
- Condition Coverage
- Statement Coverage (Correct answer)
Correct answer: Statement Coverage
Statement Coverage ensures that each executable statement in the source code is executed at least once. This is the level described in the question. It is a less stringent criterion than Decision Coverage, which would require testing both the 'true' and 'false' outcomes of the 'if-else' statement.
Question 4: An input field accepts an integer value representing a discount percentage, which must be between 5 and 25, inclusive. Using the principles of Boundary Value Analysis (BVA), which set of values provides the best test cases for this field?
- 5, 15, 25
- 4, 5, 25, 26 (Correct answer)
- 0, 15, 30
- 4, 5, 6, 24, 25, 26
Correct answer: 4, 5, 25, 26
Boundary Value Analysis focuses on testing the values at the edges of an equivalence partition. For a valid range of 5 to 25, the boundaries are 5 and 25. BVA tests these boundaries directly, as well as the values immediately inside and outside the boundaries. The set {4, 5, 25, 26} tests the lower boundary (5) and its invalid neighbor (4), and the upper boundary (25) and its invalid neighbor (26).
Question 5: Which of the following test design techniques relies most heavily on the tester's experience, intuition, and knowledge of common programming errors?
- Decision Table Testing
- State Transition Testing
- Boundary Value Analysis
- Error Guessing (Correct answer)
Correct answer: Error Guessing
Error Guessing is an experience-based technique where a tester uses their skill, intuition, and experience with similar systems to anticipate where defects might exist. Unlike formal techniques like BVA or Decision Tables, it is not based on a systematic analysis of requirements but on the tester's judgment.
Question 6: A tester is analyzing a requirement for a shipping cost calculator. The rules are: for orders under $50, the shipping is $10. For orders from $50 up to $100 (inclusive), shipping is $5. For orders over $100, shipping is free. Using Equivalence Partitioning, how many valid equivalence classes should be defined for the order amount?
- Two
- Three (Correct answer)
- Four
- Six
Correct answer: Three
Equivalence Partitioning involves dividing input data into partitions where all members are expected to be processed similarly. Based on the rules, there are three distinct partitions for valid order amounts that result in different outcomes: 1) values less than $50, 2) values from $50 to $100, and 3) values greater than $100.
A tester is designing test cases for a feature that allows users to book a flight.
The business logic for pricing is complex and depends on multiple factors such as travel class (Economy, Business, First), passenger type (Adult, Child, Infant), and whether the booking is refundable (Yes/No).
Which black-box test design technique would be most effective for systematically testing these combinations of conditions?