here - Computer Engineering Department

Eastern Mediterranean University - Computer Engineering Department
Software Engineering Program
CMSE-201 Fundamentals of Software Engineering - Final Exam
Instructor: Assoc. Prof. Dr. Alexander G. Chefranov
Student ID_______________ Student Name________________________________________
Duration: 110 Minutes
Open book, open notes
January 15, 2016
Q1) (20 points) What types of testing do you know? What is the difference between unit and system
testing? What test plan is? How test plan is designed? For a unit calculating the distance between two
points (x1,y1) and (x2,y2) on the plane (X,Y),
- specify formally how calculate the distance,
- specify interface,
- write C-code ,
- design a test plan.
Types of testing: unit, system acceptance
Difference between unit and system testing is that a unit is tested independently according to its
specification, whereas the system is tested after integration and shall meet system requirements
specification
Test plan is a set of tests to be conducted to show that the software meets respective requirements
specification
Test plan is designed based on the software requirements specification
Dist(x1,y1,x2,y2)=sqrt((x2-x1)**2+(y2-y1)**2)
Interface: dist(x1,y1,x2,y2: float): float;
float function dist(x1 float, y1 float, x2 float, y2 float){
Return sqrt((x2-x1)*(x2-x1)+(y2-y1)*(y2-y1));
}
Test plan: Check that distance between
1. (0,0) and (1,1) is sqrt(2)
2. (1,1) and (0,0) is sqrt(2)
3. (0.5,1.2) and (2.5, 4.2) is sqrt(13)
1
Q2) (20 points). Draw a state-chart diagram describing a washing machine operation having the
following options: time: standard, eco; rotation speed: standard, low, high; temperature: 40, 60, 90.
Make other reasonable assumptions if necessary, and document them. Enlist signals and their meaning.
Enlist states and related with them activities.
Power off
waıt
Temp set
Power on
Finished
Waıt for
optıon
Operating
Set temp
Start
Time set
Waıt for
temperature
Set tıme
Set speed
Waıt for
speed
Waıt for
time
Signal
Signal meaning
State
State meaning
Power off
Switch off power pressed
Wait
Initial state, waits for Power on
Power on
Switch on power pressed
Wait for option
Waits for an option is selected
Finished
Operation finished
Operating
Washing is going on
Start
Start button pressed
Wait for speed
Waits for the speed, standard, low, or
high, is selected
Set temp
Set temperature button pressed
Wait for time
Waits for the time, standard, or eco, is
selected
Set time
Set time button pressed
Wait for temperature Waits for the temperature, 40, 60, or
90, is selected
Set speed
Set speed button pressed
Temp set
Temperature (40, 60, or 90) is set
Time set
Time (standard, or eco) is set
Speed set
Speed (standard, low, or high) is set
2
Q3) (20 points) Explain what does the code below represent? What is its purpose as a whole? How it
can be classified? For each line of the code, in the right column, specify its aim
1.
2.
3.
4.
5.
6.
7.
8.
9.
10.
11.
12.
13.
14.
15.
16.
class Transponder extends Thread {
Position currentPosition ;
Coords c1, c2 ;
Satellite sat1, sat2 ;
Navigator theNavigator ;
Transponder Class header , child of Thread
Object currentPosition is declared
Objects c1,c2 are declared
Objects sat1, sat2 are declared
Object theNavigator is declared
public Position givePosition ()
{
return currentPosition ;
}
Public method givePosition is introduced
Start brace
Result is returned
End of givePosition
public void run ()
{
while (true)
{
c1 = sat1.position ()
Autorunning method is introduced
Start brace
Infinite loop
Loop starts
Get position of sat1 in c1
;
17.
c2 = sat2.position ()
Get position of sat2 in c2
;
18.
19.
20.
21.
22.
23.
currentPosition =
theNavigator.compute (c1, c2) ;
}
}
} //Transponder
Use compute method of theNavigator to calculate the
currentPosition
Loop ends
End of run
End of Transponder class definition
The code represents the declaration of the Transponder class. The purpose of this code is to provide
current position of an aircraft by its calculation using position data from two satellites. The Transponder
class may be classified as an Active Object since it periodically updates its state variable currentPosition
3
Q4) (20 points). What software architecture is? When architectural design shall be stopped? Can
architecture affect functional system features? Explain your answer. Can architecture affect nonfunctional system features? Explain your answer.
Software architecture is the representation of a system as a set of interacting subsystems.
Architectural design shall stop when decomposition of the system comes to the units which time
complexity estimated as on average 7-10 work days
Architecture can’t affect functional system features. System may have any architecture but shall meet
functional requirements.
Architecture may affect non-functional characteristics. For example, use of fine-grain distributed
components may decrease performance due to delays via network channels
4
Q5) (20 points). Consider activity network below. Enlist all possible paths from Start to Finish. What a
critical path is? Write out the critical path and its length. Given three programmers, Alice, Bob, Hasan,
build a schedule (Gantt chart) for them to implement the activities using concurrency as much as
possible.
8 day s
1 4 /7 /0 3
15 da y s
M1
T3
T9
T1
5 day s
4 /8/03
T6
M4
2 5 /7 /0 3
4 /7 /0 3
start
15 da y s
M3
2 5 /8/03
M6
7 day s
2 0 day s
15 day s
T7
T2
25 /7 /0 3
10 da y s
M2
T4
T 11
10 day s
T5
5 /9/03
11 /8/03
M7
T 10
1 8 /7 /0 3
M8
15 da y s
10 da ys
T 12
M5
2 5 day s
Finish
T8
19 /9/03
Paths
Length
1.
T1, T3, T9, T11, T12
8+15+15+7+10=55
2.
T1, T6, T9, T11, T12
8+5+15+7+10=45
3.
T1,T7,T10
8+20+15=43
4.
T2, T6, T9, T11, T12
15+5+15+7+10=52
5.
T2, T5, T10
15+10+15=40
6.
T4, T5, T10
10+10+15=35
7.
T4, T8
10+25=35
Path1 as having the maximal length 55 is the critical path
5
Alice
Bob
Hasan
T1 8 days
T2 15 days
T4 10 days
T3 15 days
T9 15 days
T6 6 days
T7 20 days
T11 7 days
T12 10 days
T8 25 days
T5 10 days
T10 15 days
Time for the project completion according to the schedule is 55 that is equal to the critical path length. Alice and
Hasan are loaded all 55 days, whereas Bob is loaded first 46 days and then is idle.
6