Software Engineering 2022/2023
Final Exam - 120 mins 2ND YEAR - ENSIA
Important notes:
● Lecturers will not answer any query during the exam.
● Be brief when answering the questions.
● Bad or non-clear writing, will not be appreciated and you may be penalized.
Exercise 1 (General Questions : 6.5 points) :
1. [1.5p: 0.5 for each valid reason] Briefly, List 3 reasons why software engineering
principles should be observed and respected when developing a software product.
a. To ensure better collaboration and communication among team members
b. To produce maintainable product that can be extended with minimal costs
c. Improve the reusability of code and components
d. Deliver a reliable product having a high quality and with the least number of
bugs and errors.
e. Company reputation and helps to keep the company running
f. …
OR simple statement : develop high-quality(1) software on time (2) and within
budget (3).
2. [1.5p 0.5 for each valid reason] List 3 brief answers why developing a software
product is a difficult and costly process.
a. Complexity : Software products are inherently complex.
b. Frequent Changes of the requirements
c. Finding talented and skilled employees + High salaries.
d. Managing human resources and collaboration are too difficult.
e. Maintenance is too expensive
f. Technical complexity due integration with other systems, platforms, newer
technologies..
g. …
3. [1p] Identify which phase of software development costs the most amount of money and
resources. List briefly 3 main reasons to justify your answer.
a. Maintenance is the most difficult phase because :
i. The risk to add new functionality to an existing system with real data
ii. Legacy Software, external libraries, OS framework can become outdated
and their newer versions may not be compatible with your software.
iii. Any new feature would require careful testing to avoid impacting real
data.
iv. Human Resources : Maintenance implies dedicating staff to keep
remembering and mastering even outdated technologies
v. …
4. [1p] Explain when to use the Waterfall Software Engineering Process Model.
a. See the lecture slides: slide 36 :
https://docs.google.com/presentation/d/1Zz_OXV4DvPfpPkvZ8l3xMKhbi4BeGQIpGyw3yV
7X-ZU/edit#slide=id.g20f56aaf601_0_312
5. [1.5p: 0.5 for generalization, 1p for the association class] Draw the Class-diagram
for the following statement : “There are two kinds of participants, namely members
and guests. Guests are invited by members at a given date”. Draw only, no need for
explanation.
Exercise 2 (Requirements Engineering : 4 points) :
1. [1p] Two of the Software Engineering principles are listed below. Explain why they
are important for the phase of requirement engineering. One reason at each line. No
paragraphs :
a. Give products to customer early
i. Helps to explore whether the compiled requirements are expressed
correctly
ii. Gather more requirements and refine existing ones.
iii. Get early feedback which is easy to address as opposed to feedback after
final delivery or during maintenance stage.
b. Reduce intellectual distance
i. The business analyst and other team members including UI designers,
developers : need to have the same mindset as the end-user so that they
can infer the requirements in addition to have a better understanding of
the requirements of the end-user.
2. [1p] How to handle the following case (Briefly) ?
Given the following raw conflicting requirements from two users in the same company
for a software product to be developed for this company:
a. The company stamp should be printed automatically on the generated PDF
documents.
b. Staff must print the PDF document and stamp them manually instead, later scan
and send the documents.
Brief answer : Offer a configuration page where software users can choose what
suitable option for them.
Non-accepted solutions : negotiate, meet, talk, convince, ,,, discuss with the users,
customers to resolve such a conflict…
3. [2p] Write ( not just mention) the two major verifiable non-functional requirements
for the following statement : “The baccalaureate system must be accessible via
different devices for a large number of students to view the baccalaureate results
accessing the system at the sa
Need to find some statement that can be verified ( some number, some
metric)...Giving only definition of scalability/portability, accessibility/.. is not
enough and not accepted.
a. The system should be scalable with the ability to handle as much as concurrent
1000 visitors per minute. If there are more users, the system should
automatically deploy other instances of the system to scale horizontally.
b. The system should be accessible and usable from web browsers installed at
desktops, laptops and mobile phones for the most popular resolutions. The
system needs to be usable and accessible by more than 80% of users devices
based on the statistics offered by StatCounter or other reputable source.
Exercise 3 (Design and Architecture : 6 points) :
1. [1p] Draw the use-case diagram for the full system.
(Primary Actors strictly need to be on the left, placing them on the right, you will
be penalized)
(Use case must be inside an oval shape describing a functionality + starts with a
verb).
(Students making a use case for the patients to create a sale order for themselves,
their solutions are accepted too)
2. [2p] Architecture,
a. Suggest the components of the system explaining briefly their objectives +
technological tools used for each component.
i. Sub-System 1: Internal System : Laravel/Django or even a simple
Swing/Tkinter Desktop Application
1. Local DAL Module ( for interaction with the database engine)
2. Business Logic Layer/Module ( for handling all processing and
validation and connecting to other modules)
3. Cashier Module ( UI for the cashier )
4. Medical Results Module ( UI for the nurse and the doctor )
5. Config Module ( UI for the owner to configure the software )
6. JobQueue Module ( A queue for keeping all jobs to be sent to
external systems)
7. API Endpoint (to facilitate communication from the Queue)
ii. Sub-System 2: Python Background or PHP background process can be used.
1. Sync Workers :
iii. Sub-System 3 : Public Web Portal Module ( Any web Technology, even
simple PHP/HTML/CSS)
1. DAL
2. BLL
3. Endpoint : To receive jobs for publishing
4. ViewLayer
b. Draw a conceptual diagram making sure to :
i. Explain briefly what architectural style to be used.
ii. Explain briefly how Cohesion and Coupling are observed.
3. [2p] Draw the class diagram for the offline system showing only classes
relationships and attributes ( when necessary only) ( No need to consider the online
portal). (Staff can be added also and linked to the saleOrder as :
SaleOrder–CreatedBy—>Cashier, SaleOrder–ProcessedBy→Nurse,
SaleOrder–ValidatedBy→Doctor
Exercise 4 (Implementation and Testing : 3.5 points) : (1.5 bonus is given)
1. [1p] For the following code snippet, find the violations against the best practices
of clean code:
- The function should do what its name is supposed to do + It does a query in addition
to a command : it is initializing a session inside the query function.
- Hard-coding plain string value
Non-accepted solutions :
● Naming of the variables
● Lack of comments : no need for comments
● Spacing
● …
2. [1p] For the SOLID principles, Explain the L principles and briefly give an example
why such principle must be respected.
Liskov substitution : an object/subclass can be replaced by a sub type or an overriding
function without the risk of breaking the system. Via keeping the same functionalities
without adding nor removing…
3. [1.5p] Explain how to use the command design pattern to implement the undo
features for the to-do app. Use programming code ( in any programming language you
feel comfortable with) to explain your strategy.
Interface Command {
void execute();
}
Class AddToDo implements Command{
void execute(){
//busines logic to add to DB
Stack stack=Stack.getHistoryStack()
Command v=new RemoveToDo(toDoId);
stack.push(v)
}
}
Class EditToDo implements Command{
String newValue;
void execute(){
currentValue=getToDoCurrentValue….
//busines logic to add to DB
Stack stack=Stack.getHistoryStack(currentValue)
Command v=new EditToDo();
stack.push(v)
}
}
public static void undo(){
Stack stack=Stack.getHistoryStack(currentValue)
Command v=stack.pop();
v.execute()
}
_____________________________________
Another solution though not efficient as it violates the DRY principle:
Interface Command {
void execute();
void undo();
}
Class AddToDo implements Command{
ToDo toDoitem=...
void execute(){
//Busines logic to add to DB
Stack stack=Stack.getHistoryStack()
stack.push(this)
}
void undo(){
//busines logic to add to DB
Stack stack=Stack.getHistoryStack();
Command command=stack.pop();
command.toDoitem.deleteItem() ; // This is a problem as it is better to call
the delete via the Command interface always.
}
}
Bonus of 1.5point is given to students who fully solved this exercise.