Upgrade to Pro — share decks privately, control downloads, hide ads and more …

SER516 Lecture 19a

SER516 Lecture 19a

Software Agility
Structural Metrics I
(202103)

Javier Gonzalez-Sanchez
PRO

February 23, 2019
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    SER 516
    Software Agility
    Lecture 19: Dependency Principles
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    javiergs.engineering.asu.edu | javiergs.com
    PERALTA 230U
    Office Hours: By appointment

    View Slide

  2. jgs
    516 00010000
    Assignment 05
    § Third Sprint
    Sprint Backlog
    Burndown Chart
    Retrospective
    Review
    Product – Source Code – Clean Source Code
    Product – Class Diagram– Clean Design
    Due date Assignment 5.3 – March 30

    View Slide

  3. jgs
    Previously

    View Slide

  4. jgs
    516 00010000
    Clean?

    View Slide

  5. jgs
    516 00010000
    Class Diagram?

    View Slide

  6. jgs
    516 00010000

    View Slide

  7. jgs
    516 00010000

    View Slide

  8. jgs
    516 00010000
    Team 7

    View Slide

  9. jgs
    516 00010000
    Team 7

    View Slide

  10. jgs
    516 00010000
    Team 7

    View Slide

  11. jgs
    516 00010000

    View Slide

  12. jgs
    516 00010000

    View Slide

  13. jgs
    Dependency Metrics
    Structural Quality

    View Slide

  14. jgs
    516 00010000
    Question 1
    A) B)

    View Slide

  15. jgs
    516 00010000
    Question 2
    Problem?
    Solution?

    View Slide

  16. jgs
    516 00010000
    Question 3
    A)
    B)

    View Slide

  17. jgs
    516 00010000
    What could be measured or analyzed?
    A bad design smells.
    Robert C. Martin describes the following odors (among others):
    1. Rigidity – The system is hard to change because every change forces
    many other changes.
    2. Fragility – Changes cause the system to break in conceptually unrelated
    places.
    3. Immobility – It’s hard to disentangle the system into reusable
    components.
    4. Viscosity – Doing things right is harder than doing things wrong.
    5. Opacity – It is hard to read and understand. It does not express its intent
    well.

    View Slide

  18. jgs
    516 00010000
    Goal
    § Measuring Quality
    § Dependency Analysis
    § Detect “potential” design flaws

    View Slide

  19. jgs
    516 00010000
    Principles
    1. Acyclic Dependency Principle (ADP)
    2. Stable Dependency Principle (SDP)
    3. Stable Abstraction Principle (SAP)

    View Slide

  20. jgs
    Acyclic Dependency Principle

    View Slide

  21. jgs
    516 00010000
    Problem Definition
    § Cycled components can only be used together: they can only be tested,
    reused, deployed and understood together.
    § Every node on a cycle depends on any other.

    View Slide

  22. jgs
    516 00010000
    Acyclic Dependencies Principle
    § Avoid dependency cycles
    § Tangle. A subgraph with at least two nodes, where each node is reachable
    from each other.
    § Tangled metric. values greater zero indicate cyclic dependencies.

    View Slide

  23. jgs
    Stable Abstraction Principle

    View Slide

  24. jgs
    516 00010000
    Abstractness of a Package
    § Express the portion of contained abstract types.
    § It is a value 0 to 1:
    0 (only concrete classes) to
    1 (only interfaces and abstract classes)

    View Slide

  25. jgs
    516 00010000
    Instability of a Package
    § Indicates whether the package is mainly used by other artifacts (stable –
    hard to change) or
    if it mainly depends on other artifacts (instable – changeable).
    § It is a value 0 to 1:
    0 only incoming dependencies to
    1 (only outgoing dependencies)

    View Slide

  26. jgs
    516 00010000
    Instability of a Package
    § Indicates whether the package is mainly used by other artifacts (stable –
    hard to change) or
    if it mainly depends on other artifacts (instable – changeable).
    § It is a value 0 to 1:
    0 only incoming dependencies to
    1 (only outgoing dependencies)

    View Slide

  27. jgs
    516 00010000
    • Instability = Cout
    (Cin + Cout)
    Stable Abstraction Principle
    IC
    = ?, A= ?
    IX
    = ?, A= ?
    IA
    = ?, A= ?

    View Slide

  28. jgs
    To be continued…

    View Slide

  29. jgs
    SER 516 Software Agility
    Javier Gonzalez-Sanchez
    [email protected]
    Spring 2021
    Disclaimer. These slides can only be used as study material for the class SER516 at ASU. They cannot be distributed or used for another purpose.

    View Slide