Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                

TM354-Final-Other-Fall21-22

Download as pdf or txt
Download as pdf or txt
You are on page 1of 8

Faculty of Computer Studies

TM354
Software Engineering
Final Examination (Ver B – Other) [Answer KEY]
Fall 2021-2022

Exam Date: January 12, 2022

Number of Exam Pages: (8) Time Allowed: 2 Hours


(including this cover sheet)

Instructions:

1. This exam has 3 parts, where you have to answer all the questions
in each part. The total mark of the exam is 100.
a. Multiple Choice questions (10 Marks)
b. Short Answer questions (30 Marks)
c. Problem Solving questions (60 Marks)

2. Write your Name, University ID, and answers on the “Answer


Booklet”. Answers on the exam question paper will not be graded.

3. The use of electronic devices is not allowed.

TM354_Final Exam_Fall 2021-2022 – Ver B [Answer Key] Page 1


Part I – Multiple Choice Questions 10 Marks
Answer all the following multiple choice questions. Each question is worth 2 Marks.

1. A person who understands the relevant part of the application domain rather than
the technology used to automate it is known as:
a. Programmer b. Test Expert c. Domain Expert d. Engineer

2. The test which tests that the system can operate reliably at the limits of each of
its resource is known as:
a. Unit test b. Stress test c. Restart test d. Acceptance test

3. Who normally starts the prototyping process:


a. Intended users b. Developers c. Testers d. Customers

4. Which software quality factor is associated with the definition “How easily the
system can be changed while in service”:
a. Maintainability b. Efficiency c. Testability d. Flexibility

5. Assessing risks and taking steps to reduce them are important activities in
software development known as Risk __________:
a. Management b. Testing c. Design d. Analysis

Part II – Short Answer Questions 30 Marks


Answer all the following short answer questions. Each question is worth 6 Marks.

1. Explain why “low coupling” and “high cohesion” are competing and what
approach should a developer adopt.

TM354_Final Exam_Fall 2021-2022 – Ver B [Answer Key] Page 2


2. Discuss why “Requirements “Documentation” is important and an essential part
of the requirements engineering process.

3. Explain why the initially identified classes when building a Class Diagram should
undergo a filtering process (make sure to state 2 ideas).

4. Explain the difference between an interface and a class with the help of a simple
theoretical example (no need to write any programming code). Also provide the
class diagram representation of a “realisation” between a class and an interface.

TM354_Final Exam_Fall 2021-2022 – Ver B [Answer Key] Page 3


5. Discuss 3 reasons why reuse is desirable.

Part III – Problem Solving Questions 60 Marks


Answer all the following problem solving questions. Each question is worth 20 Marks.

1. Consider the following scenario for a customer creating a membership at a resort:

 The applicant would check the available membership offers using the user
interface.
 The system would search for the available offers and present them.
 The applicant would select one of the offers.
 The system would update the number of members per offer.
 The system would update the members with the information of the new
applicant.

a- Draw a sequence diagram for the above scenario with a minimum of 4 objects
and 6 message calls

b- Draw another (conditional) sequence diagram for implementing the below


exception:
If the member has a coupon, he can use it to receive a discount on the
membership.

TM354_Final Exam_Fall 2021-2022 – Ver B [Answer Key] Page 4


TM354_Final Exam_Fall 2021-2022 – Ver B [Answer Key] Page 5
2. Draw a statechart diagram based on the following hints:

‐ A power generation system can be either Off (if the time of the day is between
midnight and 6:00am) or On (if the time of the day is between 6:00am and noon,
or between 4:00pm and midnight) or Standby (if the time of the day is between
noon and 4:00pm).

‐ A system that is On can be FullyActive (if the load high) or PartiallyActive (if the
load is low).

Note: Use your judgement for how to represent the initial state, final state, and the
five states mentioned above and provide clear representation of the transitions (a
minimum of 5) between the states along with the events and actions. Also make
sure to use guards (at least once) when necessary.

TM354_Final Exam_Fall 2021-2022 – Ver B [Answer Key] Page 6


TM354_Final Exam_Fall 2021-2022 – Ver B [Answer Key] Page 7
3. Consider the following code:
public class InfoFinder {
private int[] values;
public InfoFinder(int[] theValues) {
values = theValues;
}
public int FindMaxOdd() {
int max = Integer.MIN_VALUE;
for (int i = 0; i < values.length; i++) {
if ((values[i] > max) && (values[i] % 2 == 1))
max = values[i];
}
return max;
}
public double AverageOfValid() {
int sum = 0;
int count = 0;
for (int i = 0; i < values.length; i++) {
if (values[i] > 0) {
sum += values[i];
count++;
}
}
try {
return ((double)sum / count);
}
catch (ArithmeticException ex) {
System.out.println("Possible division by 0\n" + ex.getMessage());
return -1;
}
}
}

Calculate the following metrics (IMPORTANT: show how each value was calculated):
a- The Cyclomatic Complexity of the InfoFinder constructor method
b- The Cyclomatic Complexity of the FindMaxOdd method
c- The Cyclomatic Complexity of the AverageOfValid method
d- The WMPC (Weighted-methods-per-class) of the InfoFinder class
e- The CBO (Coupling-between-objects) of the InfoFinder class

End of Answer Key

TM354_Final Exam_Fall 2021-2022 – Ver B [Answer Key] Page 8

You might also like