← All CPSA Flashcard Decks

Software Design Principles Flashcards

7 cards from real CPSA practice questions. Tap to flip, then mark Knew It or Still Learning — missed cards come back until you master them.

Read the first 7 Software Design Principles flashcards as text
  1. Which design principle is MOST directly related to the concept of an 'anti-corruption layer' in domain-driven design?

    Answer: Separation of Concerns

    An anti-corruption layer separates different domain models or contexts, directly embodying Separation of Concerns by isolating external system concerns from internal domain logic.

  2. When evaluating software design, 'afferent coupling' (Ca) measures:

    Answer: The number of packages that depend on a given package

    Afferent coupling (Ca) counts the number of external packages that depend on a given package, indicating how responsible that package is to others.

  3. A module has high efferent coupling (Ce). What risk does this MOST indicate?

    Answer: This module is unstable because changes in dependencies can force changes here

    High efferent coupling means a module depends on many others; if any of those dependencies change, this module may also need to change, making it unstable.

  4. Which metric is computed as I = Ce / (Ca + Ce) and indicates the instability of a software package?

    Answer: Instability (I)

    Robert Martin's Instability metric I = Ce / (Ca + Ce) ranges from 0 (maximally stable) to 1 (maximally unstable), measuring a package's resilience to change.

  5. What does the 'Stable Dependencies Principle' prescribe about the direction of dependency between packages?

    Answer: Packages should depend in the direction of stability

    The Stable Dependencies Principle states that a package should only depend on packages that are more stable than itself, ensuring stable packages are not forced to change due to unstable dependents.

  6. Which design approach BEST supports achieving 'testability' as a quality attribute in a system?

    Answer: Designing with clear interfaces and injected dependencies

    Clear interfaces and dependency injection allow dependencies to be replaced with test doubles (mocks/stubs), making units independently testable.

  7. In software architecture, 'conceptual integrity' (as described by Fred Brooks) is BEST achieved by:

    Answer: Ensuring a unified, consistent design vision guides the entire system

    Brooks argued that conceptual integrity — a single, coherent design vision — is the most important factor in system design quality, best achieved through a consistent governing architecture.