samedi 25 juillet 2015

statement and branch coverage

Hello everyone in these days i am preparing ISTQB exam and i am stuck with one of the questions.

mock exam QUESTION 16

IF A > B THEN C = A – B ELSE C = A + B ENDIF Read D IF C = D Then Print “Error” ENDIF 

How many statement and decision(branch) coverage?

I solved as 3 branches ( 1. if A>B is true 2.if A>B is false 3. if C=D is true )and 3 statements ( C=A+B ,C=A-B and Error).

However answer says that 2 statement coverage and 2 branch coverage. Could someone please explain me.

Aucun commentaire:

Enregistrer un commentaire