CS FundamentalsVery hardProduct-company placement · ISTQB-style
An ATM state machine: inserting a card leads to '1st try'. A correct PIN in any try state leads to 'Access'; a wrong PIN moves 1st → 2nd → 3rd try, and a wrong PIN in the 3rd try leads to 'Locked'. Each test starts with card insertion and ends in Access or Locked. What is the minimum number of tests that covers every valid transition (0-switch coverage)?
- A. 3
- B. 7
- C. 6
- D. 4
Correct answer: D. 4
There are 7 transitions, but three of them go to Access (from each try) and one to Locked, and every test ends after reaching one of these. So at least 4 tests are needed, and these 4 suffice: right first time; wrong then right; wrong twice then right; wrong three times.
Practise more Software Engineering, Git and Cloud Basics questionsSoftware Engineering, Git and Cloud Basics: notes and key points
More Software Engineering, Git and Cloud Basics questions
- A price field accepts amounts from ₹0.01 to ₹999.99, with exactly two decimal places. Which pair of values are the invalid boundary values…
- For the function below, what are its cyclomatic complexity and the number of times a[j] > a[j + 1] is evaluated for the input [2, 1, 3, 4…
- Assertion (A): A suite with 100% branch coverage can still miss a defect where a required check was never coded. Reason (R): White-box…
- How many of these are static testing activities: (1) a peer code review, (2) running a linter such as ESLint, (3) executing unit tests…
- Assertion (A): A Fagan inspection is more formal than a walkthrough. Reason (R): An inspection is led by a trained moderator, follows…
- An integer quantity field accepts 1 to 100. The discount is 0% for 1-10, 10% for 11-50 and 20% for 51-100. Using two-value boundary value…