Skip to content

Latest commit

 

History

History
24 lines (19 loc) · 1.91 KB

File metadata and controls

24 lines (19 loc) · 1.91 KB

Analyze Coupling and Cohesion

Objective: Evaluate the coupling and cohesion of modules or components within the codebase, identifying areas of high coupling or low cohesion that might indicate design flaws.

Instructions:

  1. Analyze module dependencies: Examine how different modules or components in the codebase depend on each other. Tools like dependency graphs can be helpful for visualization.
  2. Evaluate coupling:
    • Identify areas of high coupling: Look for modules that depend heavily on many other modules or have complex, intertwined dependencies.
    • Explain the implications of high coupling: For example, explain how high coupling can make modules harder to understand, test, and maintain independently.
  3. Evaluate cohesion:
    • Identify areas of low cohesion: Look for modules that contain unrelated functionalities or classes that don't seem to belong together logically.
    • Explain the implications of low cohesion: For example, explain how low cohesion can make modules harder to understand and can lead to code that is more difficult to reuse.
  4. Provide concrete examples: Illustrate your findings with specific code examples from the codebase. Show instances of tight coupling, complex dependencies, or modules with low cohesion.
  5. Suggest potential improvements: Where applicable, suggest ways to refactor the code to reduce coupling and improve cohesion, such as:
    • Extracting shared functionality into separate modules.
    • Applying design principles like the Single Responsibility Principle.

Expected Output: A well-structured report that:

  1. Provides an assessment of the codebase's overall coupling and cohesion.
  2. Identifies specific areas of high coupling and low cohesion, supported by code examples.
  3. Explains the potential negative consequences of these design issues.
  4. Suggests actionable steps to improve the codebase's structure.