CS 308
SOFTWARE ENGINEERING
Midterm Exam
Monday, November 27, 2023 17:00 - 19:00
PLEASE NOTE:
PROVIDE ONLY THE REQUESTED INFORMATION AND NOTHING MORE.
UNREADABLE, UNINTELLIGIBLE AND IRRELEVANT ANSWERS WILL NOT BE
CONSIDERED. PLEASE ANSWER EVERY QUESTION ON THE SPACES
PROVIDED. DO NOT FORGET TO FILL IN YOUR ID-NAME AND SIGNATURE IN
EVERY PAGE (INCLUDING THIS PAGE).
THIS EXAMINATION CONTAINS 5 QUESTIONS AND 10 PAGES.
ID-NAME:
SIGNATURE:
Question Maximum Points
Points Received
1 15
2 15
3 25
4 30
5 15
Total 100
pg. 1
Student ID, Name and Signature:
1) Describe the following terms with a sentence or two
a. Technical Debt
b. Refactoring
c. Pair programming
d. Burndown chart
e. Coding smell (bad smell)
pg. 2
Student ID, Name and Signature:
2) Investigate the following sequence diagram that depicts a user withdrawing money from an
ATM. “exception” stereotype is used to represent exceptional situations that wouldn’t be
present in a regular flow.
Provide a possible use case scenario (to the next page) that exactly represents the diagram above.
pg. 3
Student ID, Name and Signature:
pg. 4
Student ID, Name and Signature:
3) Examine the following code and answer the questions
01 class Bird {
02 public void fly(){}
03 public void eat(){}
04 }
05 class Crow extends Bird {}
06 class Ostrich extends Bird{
07 fly(){
08 throw new UnsupportedOperationException();
09 }
10 }
11
12 public BirdTest{
13 public static void main(String[] args){
14 List<Bird> birdList = new ArrayList<Bird>();
15 [Link](new Bird());
16 [Link](new Crow());
17 [Link](new Ostrich());
18 letTheBirdsFly ( birdList );
19 }
20 static void letTheBirdsFly ( List<Bird> birdList ){
21 for ( Bird b : birdList ) {
22 [Link]();
23 }
24 }
25 }
a. Briefly explain Liskov’s substitution principle
b. How does the code above violate Liskov’s substitution principle?
c. Keeping in mind that you are asked not to ignore/violate the domain fact that “Ostrich is
a bird”; provide the UML class diagram of a design that fixes the related flaw on the
design above and re-write the BirdTest accordingly.
pg. 5
Student ID, Name and Signature:
pg. 6
Student ID, Name and Signature:
4) A developer is trying populate a GUI window menu from a file that contains a menu hierarchy.
The menu may contain three different types of items as explained below:
• Plain text items: These are menu items that only contain a text label. When clicked on,
this item performs a programmable simple action such as popping up a new input
window.
• Selectable items: Selectable items changes their label when clicked by the user. Each
selectable item is independent from the rest of the menu items, their selection does not
affect other items.
• Nested menu items: Nested menu items can be in plain text or in selectable format.
When clicked, it behaves in a different way than both the other item types and pops out
a submenu defined in the hierarchy file. The orientation of the submenu display is also
indicated in the hierarchy file.
A sample menu and its related hierarchy file is provided below (indentation defines the
hierarchy levels):
- MenuBars
- JMenu 1 [below]
- JMenuItem 1
- JMenuItem 2
- JMenuItem 3
- JMenu sub menu [right]
- JMenuItem 4
- JMenuItem 5
- JMenuItem 6
- JCheckBoxMenuItem 1 [selectable]
- JCheckBoxMenuItem 2 [selectable]
- JCheckBoxMenuItem 3 [selectable]
- JMenu 2
- JMenu 3
Assuming the orientation of the menu bars are done automatically (horizontal for the first level,
vertical for the rest), you are asked to provide an object oriented design that can handle the
menu hierarchy defined above.
a. State the design pattern(s) that would be useful in your design
b. Provide a UML class diagram in full (including properties, functions, relations, etc.) to
support the functionality defined above.
c. Imagine you are asked to support grouping items in the menu. A group of items can
contain any kind of menu item but the group itself is not a new item type (it is not plain
text, clickable or nested). Modify your design and provide a new class diagram.
pg. 7
Student ID, Name and Signature:
pg. 8
Student ID, Name and Signature:
pg. 9
Student ID, Name and Signature:
5) Compare the following classical and agile techniques by providing a single pair of advantage-
disadvantage for each of them. Try (not mandatory) to cross-relate the advantage-disadvantage
pairs for each compared technique
Effort Estimation:
Advantage Disadvantage
Expert
judgement
Planning poker
Effort Modeling:
Advantage Disadvantage
Function points
Story points
Effort Monitoring:
Advantage Disadvantage
Progress
Percentage/
Milestone
Tracking
Velocity Charts
pg. 10