Professional Documents
Culture Documents
8444 TrinhQuocTrong baiTN
8444 TrinhQuocTrong baiTN
http://www.win.tue.nl/~clange/empanada/
There are alternative ways of returning the answers to this questionnaire to us:
- Electronically:
o complete the on-line version of this questionnaire. It can be found at: www.win.tue.nl/~clange/empanada/survey
- By Hard-copy
o Print this document and write your answers & comments on it.
p.1/29
p.2/29
About the Questionnaire
The questionnaire contains 10 cases, each with one or two multiple choice questions. Completing each question should take a
few minutes.
In each question you are given a set of UML diagrams and are asked to answer a question about these diagrams.
You should answer each question from the perspective of a person being responsible to implement the system according to the
given UML diagrams.
The purpose of this questionnaire is not to measure your UML skills but to investigate how people interpret UML diagrams and
why they do so.
Instructions
You are not supposed to use a UML book while filling out this questionnaire
There is no time limit on this questionnaire, but it should take you no longer than about 45 minutes to complete.
Read each diagram and code fragment carefully! Some diagrams/fragments look almost the same but are essentially
different.
In addition to selecting one of the answers, please provide a brief motivation of your choice and/or reason why you believe
none of the options is suitable.
This is a multiple-choice test. Please indicate your answer by ticking it like this
a) b) c) d) e)
It might be the case that
- none of the answers a, b, c, d is suitable indicate this by selecting answer e)
- more than one of the answers a, b, c or d is suitable tick all suitable alternatives
Indicate either of these cases and describe the problem you encountered and explain your thoughts / questions / solutions.
Example motivations:
p.3/29
- Message X in the sequence diagram does not correspond to a method of class Y. Dependent on which diagram is
regarded as correct, either answer b) or c) is possible
- The element B is missing in the sequence diagram. The information necessary to answer the question cannot be inferred
from the class diagram without making assumptions.
- I made the following assumption to answer this question: …
p.4/29
Question Q1
a:A c:C d:D
s()
A
B
w()
u() +s()
+u()
+t()
+v()
+r()
t()
x() C
D
r()
+w()
+y()
+x()
Suppose you are software developer and you are given the above UML model. Please indicate on the next two pages how you would
implement
1) Class A
2) Class C
given these two UML diagrams.
p.5/29
Q1.1: Class A
a)□ b) R e) □ no answer is suitable
Class A{ Class A{
…} …}
c)□ d) □
Class A{ Class A{
…} …}
r là hoạt động thuộc class A không thuộc class D nên loại câu a
d.u là gọi từ class C qua class D nên loại câu c
d.y không có quan hệ với class A nên loại câu d
=> câu b là đáp án đúng (vì d.v có quan hệ với class A bởi class D kế thừa class B)
p.6/29
Q1.2: Class C
a) □ b) R e) □ no answer is suitable
Class C{ Class C{
…} …}
c) □ d) □
Class C{ Class C{
…} …}
p.7/29
Question Q2
c : Customer atm : ATM a : Account
Customer
getCardInserted()
Account
requestPIN() +requestPIN()
typePIN() +selectFromMenu() +deposit()
ATM +withdraw()
open()
+getAmount()
acknowledge()
+lock()
+getCardInserted() +validate()
selectFromMenu() +validate() +request()
abort() +typePIN() +initialize()
+select()
+abort()
+acknowledge()
Suppose you are developer in this banking software project. It is your task to implement class ATM. Please indicate on the next page how you
would implement the ATM class given these two UML diagrams? (implementation fragments see next page)
p.8/29
a) R b) □ e) □ no answer is suitable
Class ATM{ Class ATM{
…} …}
c) □ d) □
Class ATM{ Class ATM{
…} …}
Trong hoạt động getCardInserted của class ATM thì gọi đến hoạt động a.open nên loại câu b, c, d
Trong hoạt động acknowledge của class ATM thì gọi đến hoạt động c.seclectFromMenu
=> chọn câu a
p.9/29
Question Q3
Class1
Class2
c3 : Class3 c1 : Class1 c4 : Class4
+method1()
+method3()
method1() +method2()
method7()
method5() Class3
Class4
method6
+method5()
+method7()
+method6()
You have to implement the given scenario; please indicate according to which of the following pseudo-code fragments you would implement
the classes C1, C2, C3, C4:
p.10/29
a) □ b) □ c) □ d) □ e)R no answer
class Class1 { class Class1 { class Class1 { class Class1 { is suitable
method method1(){ method method1(){ method method1(){ method method1(){
dosomething; dosomething; dosomething; dosomething;
c4.method7(); c4.method7(); c4.method7(); c4.method7();
dosomething; dosomething; dosomething; dosomething;
c3.method5(); c3.method5(); c3.method5(); c3.method5();
} } } }
… … … …
} } } }
…
}
Trong class Class3 gọi đến hoạt động c4.method6 nhưng hoạt động methody6 không thuộc class Class4 mà là hoạt dộng riêng của
class Class3 và class Class4 không kế thừa class Class3
=> chọn câu e
p.11/29
Question Q4
c1:Class1 c2:Class2 c3:Class3
Class2
Class1 Class4
generate()
+performAnalysis()
+enterCoordinate() +releaseAll() enterCoordinate()
+validateSum()
+resetValues() +generateElement()
+generate() addElement()
validateSum()
Class3
resetValues()
+addElement()
Suppose you are the developer of this software project. It is your task to implement classes Class2. Please indicate on the next page how you
would implement the classes given these two UML diagrams? (implementation fragments see next page)
p.12/29
a) □ b) R e) □ no answer is suitable
Class Class2{ Class Class2{
…} …}
c) □ d) □
Class Class2{ Class Class2{
…} …}
Trong hoạt động generate của class Class2 thì gọi đến hoạt động c1.enterCoordinate và c3.addElement
Trong hoạt động validateSum của class Class2 (loại câu d) thì gọi đến hoạt động c1.resetValues (loại câu a và c)
=> chọn câu b
p.13/29
Question Q5
: Controller : Gate before : Sensor after : Sensor TrafficLight Controller
Gate
after before
gateClosed()
trainPassed()
open() Sensor
You are asked to implement the system according to the two diagrams above. Indicate in which relative order the methods of the classes
1) Controller and
2) TrafficLight
are called in your implementation. (Hint: the TrafficLight is initially green).
p.14/29
Q5.1: Order in which methods of classes Gate and Controller are called
a) □ b) R e) □ no answer is suitable
Controller Gate Controller Gate
t1 trainApproaching t1 trainApproaching
t2 open t2 close
t3 gateClosed t3 gateClosed
t4 trainPassed t4 trainPassed
t5 close t5 open
c) □ d) □
Controller Gate Controller Gate
t1 trainApproaching t1 trainApproaching
t2 gateClosed t2 close
t3 close t3 gateClosed
t4 trainPassed t4 open
t5 open t5 trainPassed
Có 5 hoạt động xảy ra thì hoạt dộng thứ 1, 3, 4 là của class Controller và 2 hoạt động còn lại là của class Gate
=> chọn câu b
p.15/29
Q5.2: Order in which methods of classes TrafficLight and Controller are called
a) □ b) □ e) R no answer is suitable
Controller TrafficLight Controller TrafficLight
t1 trainApproaching t1 trainApproaching
t2 setRed t2 blink
t3 gateClosed t3 gateClosed
t4 blink t4 setRed
t5 trainPassed t5 trainPassed
t6 setGreen t6 setGreen
c) □ d) £
Controller TrafficLight Controller TrafficLight
t1 trainApproaching t1 trainApproaching
t2 gateClosed t2 blink
t3 setRed t3 setRed
t4 blink t4 gateClosed
t5 trainPassed t5 trainPassed
t6 setGreen t6 setGreen
Trong đề chỉ nói class Controller và class TrafficLight có quan hệ nhưng không cho biết hoạt động của 2 class diễn ra như nào nên
em chọn câu e
p.16/29
Question Q6
: Radio : Controller : Speaker : Display : Phonebook
incomingCall()
ring() Controller
-phonebook : Phonebook Phonebook
Radio
turnLighOn() -speaker : Speaker -records
-controller : Controller
-radio : Radio +retrieveName()
getNumber() +getNumber()
+incomingCall() +insertRecord()
showCallerName() +callerHangUp()
1
retrieveName()
*
callerHangUp()
Speaker Record
stopRing() -volume -name
-ringing : bool -number
showStopMessage() +ring() +getName()
+stopRing() +getNumber()
+setVolume()
You are given these two diagrams as a description of a subsystem of a mobile phone. Use these diagrams as basis for an implementation
of
1) class Display and
2) class Speaker.
Please indicate which methods must be implemented and the classes which have an association relation with Display, respectively
Speaker.
p.17/29
Q6.1: Class Display
a) Display has the methods …
a) □ b) R c) □ d) □ e)□ no answer is
turnLightOn() turnLightOn() showCallerName() turnLightOn() suitable
showCallerName() showCallerName() retrieveName() turnLightOff()
retrieveName() showStopMessage() getNumber() showCallerName()
showStopMessage() showStopMessage()
clearDisplay()
a) □ b) □ c) □ d) □ e)R no answer is
Radio Radio Phonebook Phonebook suitable
Controller Phonebook Controller Controller
Phonebook Controller Display
Record
class Display có 3 hoạt động được gọi duy nhất từ class Controller là turnLightOn, showCallerName, showStopMessage
=> 6.1 a chọn câu b và 6.1 b chọn câu e
p.18/29
Q6.2: Class Speaker
a) Speaker has the methods …
a) □ b) □ c) R d) □ e)□ no answer is
ring() ring() ring() ring() suitable
retrieveName() stopRing() stopRing() setVolume()
showStopMessage() setVolume() playJingle()
a) □ b) □ c) □ d) R e)□ no answer is
Phonebook Display Phonebook Controller suitable
Record Phonebook Controller
Controller
class Speaker có 2 hoạt động được gọi duy nhất từ class Controller là ring và stopRing
p.19/29
Question Q7
: Customer : ATM : Account
insertCard()
create
: WithdrawalSession
lock()
givePIN()
validatePIN()
enterWithdrawalAmount()
open account
checkBalance()
withdrawAmount()
getCash()
endSession()
Customer
1 * 1 *
*
Address ATM WithdrawalSession
1
11 *
Customer Account
*
*
advisor *
Person
1 1
Employee Branch
*
head 1
1 *
Department
The above diagrams describe (part of) a banking system. For each of the two use cases, indicate which classes are involved in its realization.
p.20/29
Q7.1
The following classes collaborate to realize use case “open account”…
a) □ b) R c) □ d) □ e)□ no answer is
Person Address Customer Customer suitable
Customer ATM Employee Account
Department WitdrawalSession Account Employee
Employee Person Branch
WithdrawalSession Customer Address
Account Employee
Branch Account
Branch
Department
Em lụi
Q7.2
The following classes collaborate to realize use case “withdraw amount”…
a) □ b) R c) □ d) □ e)□ no answer is
Custumor Customer ATM WithdrawalSession suitable
Account Account WithdrawalSession Customer
Employee WithdrawalSession ATM
ATM Address
Em lụi
p.21/29
Question Q8
Class2
Class1
c1 : Class1 c2 : Class2 c3 : Class3
+method48()
method48() +method54()
+method29()
method37()
method29()
Class3
method54()
+method18()
+method83()
Suppose you are developer in this software project. It is your task to implement class Class2. Please indicate on the next page how you would
implement the Class2 class given these two UML diagrams? (implementation fragments see next page)
p.22/29
a)□ b) □ e) R no answer is suitable
Class Class2{ Class Class2{
…} …}
c)□ d) □
Class Class2{ Class Class2{
…} …}
Trong class Class2 thì hoạt động method48 được đến trước hoạt động method29 nên loại cả 4 đáp án
=> chọn câu e
p.23/29
Question Q9
:D :B :C
m8() A B
C
m6()
m12() D
+m13()
You are asked to implement the system according to the two diagrams above. Indicate in which logical order the methods of the classes
1) Class B and
2) Class A
are called in your implementation.
p.24/29
Q9.1: Order in which methods of classes C and B are called
a) □ b) R e) □ no answer is suitable
B C B C
t1 m8 t1 m8
t2 m12 t2 m11
t3 m7 t3 m7
t4 m6 t4 m6
t5 m11 t5 m12
c) □ d) □
B C B C
t1 m6 t1 m13
t2 m7 t2 m6
t3 m11 t3 m11
t4 m8 t4 m8
t5 m12 t5 m12
Có 5 hoạt động xảy ra thì hoạt dộng thứ 1, 3, 4 thuộc class B và còn lại là thuộc class C
p.25/29
Q9.2: Order in which methods of classes A and B are called
a) □ b) □ e) R no answer is suitable
B A B A
t1 m8 t1 m8
t2 m2 t2 m1
t3 m7 t3 m7
t4 m1 t4 m2
t5 m6 t5 m6
t6 m3 t6 m3
c) □ d) £
B A B A
t1 m3 t1 m8
t2 m1 t2 m1
t3 m8 t3 m2
t4 m7 t4 m7
t5 m2 t5 m6
t6 m6 t6 m3
Trong đề chỉ nói class A và class B có quan hệ nhưng không cho biết hoạt động của 2 class diễn ra như nào nên em chọn câu e
p.26/29
Question Q10
RoutePlanner
UI RoutePlanner
-position Car
Map -direction
-destination +showRoute() +adjustSpeed()
-route +getSpeed()
+getMapSelection() +showDestination() +changeRoute()
+setSpeed()
+update() +calculateRoute() +clearDisplay() +connectToTrafficInfo()
+update Route() +giveNextDirection()
+detectWrongWay()
GPS Radio
+getActualPosition() +mute()
+getActualDirection() +getTrafficData()
Suppose you are developer of this software project. It is your task to implement class RoutePlanner. Please indicate on the next page how
you would implement the class RoutePlanner given these two UML diagrams? Please indicate which methods (a) must be implemented
and the classes which have an association relation (b) with RoutePlanner.
p.27/29
Q10: Class RoutePlanner
a) RoutePlanner has the methods …
a) □ b) □ c) R d) □ e)□ no answer is
adjustSpeed() calculateRoute() adjustSpeed() adjustSpeed() suitable
changeRoute() updateRoute() changeRoute() enterDestination()
connectToTrafficInfo() detectWrongWay() connectToTrafficInfo() connectToTrafficInfo()
calculateRoute() calculateRoute()
updateRoute() recalculateRoute()
detectWrongWay() detectWrongWay()
p.28/29
Information about your professional background
______ courses
How many years of practical work experience in software engineering / development do you have?
______ years
What is your job description? (e.g. architect, designer, programmer, student, manager...)
________________________________________________.
What is your knowledge in the following fields? Please answer according to this scale:
1 = no knowledge
2 = gained knowledged through academic classes or literature study
3 = applied it in academic context
4 = applied it in one industrial project
5 = applied it in more than one industrial project
Software Inspections 1 2 3 4 5
If you are interested in receiving the results of this research experiment, please enter your email address here:
________________________________
p.29/29