0% found this document useful (0 votes)
45 views

Example Questions Answers v2

Uploaded by

flannerywangliu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views

Example Questions Answers v2

Uploaded by

flannerywangliu
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 9

Practise questions

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)

Which nodes are not covered by this suite?

a) (2),(3)
b) (3),(6,7) B
c) (2),(6,7)
d) (2)
e) (2),(3),(6,7)

Q3 Which of the following is untrue about blackbox testing?

a) It often uses testing partitions to determine appropriate test coverage.


b) Each path in program is guaranteed to be executed at least once B untrue
c) The source code is not known by the tester because to do B
d) Test data values are often set to the edge of partition boundaries you need the
source
e) The tests are according to the system specification
code
Q4 Look at the following fragment specification “The method will accept a date in the
form of 3 variables, a day of month, a month of year and a year. The month is set to
1 for January, 2 for February etc.”. Given that the month=2 and year=2014, which of
the following day settings would test all boundaries for the method.

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?

a) Bank staff, security guards, engineer


b) Smoke sensors, security sensors, heat sensors
c) Bank staff, security guards, security sensors, heat sensors, smoke detectors
d) Bank staff, security guards, security sensors, heat sensors, smoke detectors,
police, fire brigade D
e) Police, fire brigade

Q6 What would be the role of the use case “Fire confirmed”


The bank specified that a fire should be
called
“confirmed” if either two sensors detect
smoke or heat, or else any fire alarm
button has been pushed.
a) Included as part of “Detect heat”, “Detect Smoke” use cases
b)
b) Extendedfrom
Extended from “Detect
"Detect heat”,
heat", “Detect
"Detect Smoke”
Smoke" use cases
and included from "Fire button pressed"
B
c) Extended from “Detect heat”, “Detect Smoke”, “Fire button pressed” use cases
d) Included as part of“Detect heat”, “Detect Smoke”, “Fire button pressed” use
cases
e) None of the above

“An organisation is using the Bell–LaPadula security model to control their


communications and controlling all their communications. They have a
bulletin board which all staff can post messages on to. Given that Alice has
top clearance (level 4), Bob has middle clearance (level 2), Karen (level 1) and Derek
has low level clearance (level 0). Bob posts a message inviting all staff to
a BBQ. Answer questions 7 and 8, assuming all staff who receive a message, reply
to it on the bulletin board by the end of the working day.

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

Q9)? C Q9 Assuming everyone wants to go to the BBQ, who will be there?

a) Everyone only
b) No one only
c) Alice and Bob only
d) Alice, Bob and Derek only
e) Bob only

Q10 What is authentication?

a) Checking messages have not been altered


D
b) Keeping messages secret
Also remember c) Keeping messages with a timestamp
the other on d) Verifying the identity of a user of the system
authorization e) Controlling access rights to data
revise all.
services
Q11 Why is partition testing useful?
a) It helps to ensure that all paths are tested.
E b) It covers every single value that a test data item can be
a) path testing c) It helps to uncover incorrect use of comparator operators such as less
b) exhaustive than and less than or equals.
c) boundary d) It helps to stress the system
d) stress test- e) None of the above
ing

Q12 Which of the following is not true about petri-nets?

i) They are deterministic


ii) They can be used to model systems with finite state
i) false iii) Places can fill up, so no more tokens can enter
no, there can me
iv) A transition is always enabled if all its incoming places contain a
multiple transitions
enable token
ii) true a) i) and iii) and iv)
iii) false b) ii) and iv)
no, a place can c) ii) only
have any number d) all of the above
of tokens e) none of the above
iv) false, depends
on weight
answer A

Figure 1 Petri Net

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?

b) a) Prepare Email, download email only


b) Prepare Email only
Notice token(s) c) Prepare Email and send email only
missing from d) Deadlock (no states) only
right hand side
e) Send email and read email only
Q14 Starting at the state given in Figure 1, what transitions will be enabled after
the following sequence, send Email, prepare Email?
e)
send email a) Prepare Email, download email only
only b) Prepare Email only
c) Prepare Email and send email only
d) Deadlock (no states) only
e) Send email only

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

Q16 What do the tokens in P3 represent?

a) Messages written but not sent


b b) Messages sent but not downloaded
c) Messages downloaded but not read
d) Maximum messages that can be sent
e) Sender of email

Q17 What is the maximum number of messages can be transit?

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

Q20 What do tokens in P2 represent?

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?

X1: Product high cohesion


X2: Server response delay has an average of 200ms
X3: Software is easy to use
X4: Software is written in Java

 (A) X1 and X2 X1 and X3


 (B) X1, X2 and X3 E)
 (C) All of the above
 (D) X2 and X4
 (E) X1 and X3

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?

X1 Algorithmic cost modelling


X2: Parkinson’s Law
X3: Pricing to win X1 Not really requires previous
X4 Expert judgement project data
X5 Estimation by analogy X2 Yes
X3 Yes
X4, X5 no
C)
 (A) X1 and X2
 (B) X2 and X5
 (C) X3 and X4
 (D) X2 and X4
 (E) X2 and X3
23 What does the following describe : “The project costs expand to consume whatever
resources are available”?

Expert judgement B
 (A)
Parkinson’s law
 (B)

Estimation by analogy
 (C)
Simulation
 (D)
 (E) Validation estimation

24 Which of the following is a process in the waterfall software lifecycle?

 (A) Risk analysis


 (B) Prototyping
 (C) Iteration
 (D) Integration and system testing D
 (E) Spiralling
Appendix A

Proposed combined security and fire system


An international bank has contracted your company to develop a software system to monitor
and control a fire and security system in its new building. The building is divided into seven
distinct zones and each zone contains several smoke detectors (which detect the presence of
smoke), several heat detectors, fire alarm buttons (which a person can push if they detect a fire)
and security sensors (which detect the presence of people in the zone and can trigger an alarm
when outside normal banking hours or during holidays for example). Through interviews with
bank personnel and an initial proposal, it has been determined that the following factors of the
new system should be taken into account: A password may be entered by bank staff when
entering/leaving a zone outside normal hours which will activate/deactivate the security system
for the zone (i.e., once a zone is deactivated, the police won’t be called if the security sensors
detect movement so that staff can work out-of-hours). Each member of staff is allocated a
number of zones that they are permitted to work in after hours. When a smoke detector detects
smoke, or excess heat it will send a message to the software system to report it. All building
alarms should then be sounded. The fire brigade should be automatically contacted once a fire is
confirmed (since it may be a false alarm). The bank specified that a fire should be called
“confirmed” if either two sensors detect smoke or heat, or else any fire alarm button has been
pushed. To reset the alarm a bank security guard can reset the system and all alarms in the
event of a false alarm after checking the particular zone. To do this function a dual key
mechanism is used, that is two security guards are required to reset the alarm. For some zones
there are sprinkler systems which can be activated automatically or by a security guard if a fire is
confirmed and no one is in that zone
and lock all internal doors to isolate zones and avoid intruders being able to move freely within
the building if movement is detected out-of-hours (you should consider the possibility of BOTH
an intruder being detected and a fire confirmed at the same time; ALL internal doors should
obviously be unlocked in this case.) The security guard can periodically test the system so that
any malfunctions can be rectified.

You might also like