Sead
Sead
1)unit-3 pg-47.
3. Explaining coupling and cohesion with detailed examples, and discuss their impact on software
design quality
Coupling:
Coupling refers to the degree of interdependence between software modules. It's about how much
one module relies on another. Lower coupling is generally preferred because it makes the system
more modular and easier to maintain or change.
Example of High Coupling: Imagine you have two classes, Order and Customer. If Order directly
accesses the Customer data fields and the Customer class methods, they are highly coupled. Any c
hange in Customer will require changes in Order.
Example of Low Coupling: Using interfaces or abstract classes can reduce coupling. Instead of O
rder directly using Customer, it might use an interface ICustomer that Customer implements. Now,
Order depends on the abstraction
rather than the implementation, making it less dependent on changes in Customer.
Cohesion:
Cohesion refers to how closely related and focused the responsibilities of a single module are. Hig
h cohesion within a module is preferred because it indicates the module is focused and does one th
ing well.
Example of Low Cohesion: A class Utility that contains unrelated methods like calculateDiscount(
), readFile(), and sendEmail(). These methods do not belong together, and this class has low cohesi
on.
Example of High Cohesion: A class EmailService that contains methods specifically related to e
mail functionalities, such as sendEmail(), validateEmailAddress(), and formatEmail(). This class has
high cohesion because all its methods are related to a single responsibility.
Maintainability: Low coupling and high cohesion make the system easier to understand,
maintain, and extend. Changes in one module have minimal impact on others.
Reusability: High cohesion and low coupling enable the reuse of modules in different syst
ems.
Scalability: Systems with well-designed modules are easier to scale as individual compone
nts can be developed, tested, and deployed independently.
Flexibility: With low coupling, the system can adapt more easily to changes since modules
can be swapped with minimal impact.
In essence, aiming for low coupling and high cohesion can lead to a robust, flexible, and maintaina
ble software system. Balancing these aspects helps create a design that stands the test of time an
d evolving requirements.
9. Discuss the lifecycle of Extreme Programming (XP) and explain its phases. How does XP ensure
continuous improvement throughout the project lifecycle?
Extreme Programming (XP) is a software development methodology that emphasizes customer sati
sfaction, teamwork, and continuous improvement. XP promotes frequent releases in short develop
ment cycles to improve productivity and introduce checkpoints where new customer requirements
can be adopted.
Phases of XP
1. Planning:
Iteration Planning: Break down releases into iterations, each typically lasting one
to three weeks.
2. Design:
Simple Design: Create a simple design that fulfills the current requirements.
3. Coding:
Test-Driven Development (TDD): Write tests before writing code to ensure functi
onality.
Collective Code Ownership: Anyone can modify any part of the code to enhance
flexibility and collaboration.
4. Testing:
Automated Testing: Use automated tests to verify functionality and catch bugs e
arly.
5. Release:
Frequent Releases: Deliver software frequently to get feedback from users and st
akeholders.
1. Frequent Feedback:
Frequent Releases: Regular releases allow for continuous feedback and improve
ments.
2. Iterative Development:
Short Iterations: Regular short iterations help adapt to changes and improve incr
ementally.
3. Refactoring:
Advantages of XP
1. Customer Satisfaction: Frequent releases and constant collaboration with customers ens
ure that their needs are met.
2. Flexibility: The ability to adapt to changing requirements makes XP suitable for dynamic e
nvironments.
3. Improved Quality: Emphasis on testing, refactoring, and pair programming improves cod
e quality.
4. Team Collaboration: Practices like pair programming and collective code ownership enha
nce team collaboration and knowledge sharing.
Challenges of XP
1. Discipline Required: XP requires a high level of discipline to maintain practices like TDD a
nd continuous integration.
3. Pair Programming: Not all developers are comfortable with pair programming, and it can
be seen as less efficient initially.
XP's focus on continuous improvement, customer collaboration, and maintaining high quality make
s it a robust methodology for developing adaptable, high-quality software. 🚀
2marks
You
13. What does Feature-Driven Development (FDD) focus on? 14. State the goal of Lean Production
in software development 8. Differentiate between verification and validation Define the term "User
Interface (UI)" (it is a 2mark question)
Copilot
Feature-Driven Development (FDD) focuses on building and delivering tangible, user-valued feature
s. It emphasizes an iterative process where features are planned, designed, built, and tested in sho
rt cycles, ensuring continuous progress and frequent delivery of working software.
The goal of Lean Production in software development is to maximize value while minimizing waste.
It aims to enhance efficiency, improve quality, and deliver what the customer needs by continuousl
y improving processes and eliminating activities that do not add value.
Verification: Ensures that the product is built correctly according to specifications and desi
gn documents. It involves reviews, inspections, and static analysis.
Validation: Ensures that the final product meets the user's needs and requirements. It inv
olves dynamic testing, including functional and user acceptance tests.
User Interface (UI) refers to the visual and interactive components of a software application that us
ers interact with. It includes elements like buttons, menus, and icons designed to facilitate user int
eraction and enhance the overall user experience.
Hope this helps! 🚀