4

I am having trouble with this ISTQB practice question. I don't understand how the answer (A) was reached.

Q. 482: Analyze the following highly simplified procedure:

Ask: "What type of ticket do you require, single or return?"
IF the customer wants "return"
    Ask: "What rate, Standard or Cheap-day?"
    IF the customer replies "Cheap-day"
        Say: "That will be "11:20""
    ELSE
        Say: "That will be "19:50""
    ENDIF
ELSE
    Say: "That will be "9:75"
ENDIF

Now decide the minimum number of tests that are needed to ensure that all the questions have been asked, all combinations have occurred and all replies given.

A. 3
B. 4
C. 5
D. 6
1
  • 1
    Edited to make this a valuable question: it is an exact copy of an ISTQB practice question and therefore on-topic but as an un-attributed question needs to be cleaned up. – Kate Paulk Apr 11 '17 at 11:27
6

enter image description here

There are 3 paths to be taken in order to achieve 100% statement coverage.

Your question does not have the best format.

Ask Single or Return
    IF the customer wants RETURN
        Ask Standard or Cheap-day
        IF the customer replies Cheap-day
            Say 11:20
        ELSE
            Say 19:50
        ENDIF
    ELSE
        Say 9:75 // whatever time this is
    ENDIF

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.