You are on page 1of 3

DEPARTMENT: Department of Software Engineering

Assignment 2 Course Instructor: Muhammad Marouf


Subject: Software Re-engineering_ Max. Marks 10

Question 1:
Certainly! Program comprehension and code smell are important aspects of software re-
engineering. Here are some scenarios that involve these concepts:

Scenario 1:

You join a software development team that is maintaining a legacy system. The system has
been in production for several years, and the original developers have moved on. The
codebase is large and complex.

Your task is to understand a critical module of the system that has limited documentation.
The code is poorly structured, and there are minimal comments. The module is responsible
for handling user authentication, and any changes to it must be done carefully to avoid
security vulnerabilities.

1. How would you approach understanding the existing code without sufficient
documentation?

2. What strategies would you employ to identify the key components and functionalities
within the module?

3. How do you ensure that you grasp the security implications of any changes you make to
the authentication module?

Scenario 2:

You are assigned to perform a code review on a recently developed feature by another team.
The feature works as intended, but you notice several code smells during the review.

1. Long Method: The main function handling the feature is excessively long.

2. Duplicated Code: Similar code segments are found in multiple places.

3. Primitive Obsession: The code uses primitive data types where objects or custom types
would be more appropriate.
4. Feature Envy: Methods in one class excessively use methods or fields of another class.

Task:

Your task is to provide feedback to the development team and suggest improvements. The
goal is to enhance maintainability, readability, and reduce the likelihood of bugs in the future.

Questions:

1. How do you communicate the identified code smells to the development team in a
constructive manner?

2. What refactoring techniques would you recommend to address each specific code smell?

3. How can you ensure that the refactoring process does not introduce new bugs or
regressions?

Scenario 3:

You work for a company that has been using a monolithic architecture for its e-commerce
platform for many years. Due to increasing scalability and maintainability concerns, the
decision is made to migrate to a micro services architecture.

1. The existing monolithic codebase is tightly integrated, making it challenging to separate


services.

2. The team is concerned about potential downtime during the migration.

3. The new micro services architecture needs to be well-documented to facilitate future


development and maintenance.

Tasks:

1. Develop a plan for migrating from a monolithic to a micro services architecture.

2. Address the concerns of potential downtime and communicate the plan to stakeholders.

3. Outline strategies for documenting the new micro services architecture to ensure easy
comprehension by the development team.

Considerations:
1. How do you prioritize which parts of the monolith to migrate first?

2. What strategies can be employed to minimize downtime during the migration process?

3. How would you ensure that the new micro services architecture is well-documented for
future reference?

You might also like