F5 - Maintainability Flashcards

1
Q

Define coupling and cohesion in software design and explain their impact on maintainability

A

Coupling refers to the degree of interdependence between modules, while cohesion relates to the internal structure of modules.

High coupling and low cohesion can negatively impact maintainability by increasing the likelihood of ripple effects, making systems harder to compose, reducing reusability, and increasing effort in testing.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is the purpose of the Law of Demeter in software design?

A

The Law of Demeter states that objects should only communicate with objects in their immediate environment, promoting loose coupling between objects and improving code maintainability by preventing excessive dependencies

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Explain the Single Responsibility Principle (SRP) and its relevance to maintainable software design

A

SRP states that a class should have only one reason to change. This principle helps maintainability by ensuring that each class focuses on a single responsibility, making it easier to understand, modify, and maintain.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How does the Open-Closed Principle (OCP) contribute to maintainable software design?

A

OCP states that components should be open for extension but closed for modification. By allowing existing behavior to remain untouched while permitting extension through inheritance and polymorphism, OCP helps maintainability by preventing unnecessary changes to existing code

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

Explain the purpose of the Liskov Substitution Principle (LSP) and its impact on maintainability

A

LSP states that subclasses should be substitutable for their base classes without altering the correctness of the program. This principle promotes maintainability by facilitating code reuse and polymorphic behavior without introducing unexpected side effects

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the Interface Segregation Principle (ISP) and how does it influence maintainable software design?

A

ISP states that clients should not be forced to depend on interfaces they don’t use. By separating large interfaces into smaller, more specific ones, ISP minimizes coupling and dependencies, thus promoting a more modular and maintainable design.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Explain the Dependency Inversion Principle (DIP) and its relevance to maintainable software design.

A

DIP states that high-level modules should not depend on low-level modules; both should depend on abstractions. This principle promotes maintainability by promoting loose coupling and facilitating the replacement of components without affecting the overall system’s behavior

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Describe the Reuse/Release Equivalence Principle (REP) and its impact on maintainable software design

A

REP states that the granule of reuse should be the granule of release, advocating for components to be neither too big nor too small. By ensuring that components are released and reused at an appropriate granularity, REP contributes to maintainable software design.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q
A
How well did you know this?
1
Not at all
2
3
4
5
Perfectly