Example Questions Answers v2
Example Questions Answers v2
Look at the following flow chart and corresponding source code. Use these to answers questions 1 to
3.
Edges? = 11
Nodes = 9
CC = E-N+2
int factorial(int x) { CC = 11-9 + 2 = 4
if (x<0) { // 1
decision node count +1 =
throw new BadArgumentException(); // 2
4
}
if (x==0) {
1,2,9 (-20)
return(1); // 3
x=1, 1,4,5,8,9
}
int result=1; // 4
while (x!=1) { // 5
result=result*x; // 6
result--; // 7
}
return(result); // 8
} // 9
Q1. What is the minimum number of tests required to test every piece of this code?
a) 3 a) 3
b) 4 b) 4
c) 5 c) 5
d) 6
d) 6
e) 7
e) 7
Q2. Given the following test suite
(X=-20)
(X==1)
a) (2),(3)
b) (3),(6,7) B
c) (2),(6,7)
d) (2)
e) (2),(3),(6,7)
a) 1, 28
b) 1,28,29 What is
c) 0,1,28,29 important
d) 0,1,28,29,30 about date?
e) 2014?
0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,21,22,23,24,25,26,27,28
not leap year
c)
Q5. Look at the description of a fire alarm given in Appendix A, which of the following
describes the possible Actors of the system?
read-up no Q7 What messages would Karen (level 1) staff be able to read from the
board at the end of the day (when everyone would have replied).
write-down no
would Karen a) No messages
get a message b) Messages from Alice and Bob only
from Bob? c) Messages from Alice, Bob and Derek only
No.. d) Messages from Alice, Bob, Derek and Karen only
Q7 a) e) Messages from
Q8) b Q8 What messages would Bob be able to read at the end of the day?
a) No messages
So the answer
b) Only his own only
is that
the Bell-L c) Alice and his own messages only
model is no d) His own message’s and Karen and Derek
good for BBQ's e) No messages
a) Everyone only
b) No one only
c) Alice and Bob only
d) Alice, Bob and Derek only
e) Bob only
Q13 Looking at the model of the petri-net shown in Figure 1, showing an email
prepare-email-- act- sending system. What transitions will be enabled if the Send Email transition
ive fires?
Q15 Starting at the state given in Figure 1, what transitions will be enabled after
the following sequence, send Email, prepare Email, send Email, prepare
deadlock Email?
d)
a) Prepare Email, download email only
again, problem
with missing b) Prepare Email only
tokens on RHS c) Prepare Email and send email only
d) Deadlock (no states) only
e) Send email only
a) 1
4
b) 2
look at
c) 3
weighting to
disable send d) 4
e) 5
Q18 What is the maximum number of states that the net can achieve?
a) 1
4 b) 2
c) 4
d) 6
e) Infinite (no max)
Q19 What is wrong with the configuration of the net?
c
a) Nothing
missing
tokens for b) There should be no connection between P3 and send Email
reading email c) There is a token missing from the right hand
d) There should be no token in P1
e) P1 should contain 2 tokens
a) a) Editors of email
people b) Readers of email
ready to write c) Email messages yet to be sent
emails d) Email messages yet to be read
e) None of the above
21 Which of the following are NOT verifiable requirements?
22 Which of the following techniques are suitable for cost estimation of a new project
where comparable software has not been produced, and there are no available experts
in the project application domain?
Expert judgement B
(A)
Parkinson’s law
(B)
Estimation by analogy
(C)
Simulation
(D)
(E) Validation estimation