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

SER516 Lecture 21a

SER516 Lecture 21a

Software Agility
Dependency Metrics III
(202104)

Javier Gonzalez-Sanchez
PRO

February 26, 2019
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

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

    View Slide

  2. jgs
    Previously…
    Structural Quality

    View Slide

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

    View Slide

  4. jgs
    516 00010000
    Stable Abstraction Principle
    More stable a package is,
    the more abstract it should be.

    View Slide

  5. jgs
    516 00010000
    Stable Abstraction Principle
    Abstract
    concrete
    Stable
    Hard to Change
    Only incoming dependencies
    Unstable
    Changeable
    Only outgoing dependencies

    View Slide

  6. jgs
    516 00010000
    Question

    View Slide

  7. jgs
    516 00010000
    Question
    A)
    B)

    View Slide

  8. jgs
    Stable Dependency Principle

    View Slide

  9. jgs
    516 00010000
    Stable Dependency Principle
    § Every dependency between modules should terminate on a module whose
    Instability metric is less than or equal to the depending
    module's Instability metric.
    § Every dependency between modules should terminate on a module whose
    Abstractness metric is greater than or equal to the depending
    module's Abstractness metric.

    View Slide

  10. jgs
    516 00010000
    Question 3 (again)
    A)
    B)

    View Slide

  11. jgs
    516 00010000
    SAP + SDP
    § Distance: how far a package is away from
    the Main Sequence
    § D = A + I – 1
    § Values -1 to 1
    § Absolute Distance |D|

    View Slide

  12. jgs
    516 00010000
    Question
    project3.common.model
    project3.client.UI
    project3.server.controller

    View Slide

  13. jgs
    516 00010000
    Question

    View Slide

  14. jgs
    516 00010000
    Question
    public class Foo {
    Bar b= new Bar(new Car());
    public Foo (Car c) {
    c.doIt(b);
    }
    public void m (Delta d) {
    d.action(b);
    }
    }
    public class System {
    public ... main ( ...) {
    Foo f = new Foo();
    //...
    }
    }

    View Slide

  15. jgs
    516 00010000
    Question
    public class Foo {
    Bar b= new Bar(new Car());
    public Foo (Car c) {
    c.doIt(b);
    }
    public void m (Delta d) {
    d.action(b);
    }
    }
    public class System {
    public ... main ( ...) {
    Foo f = new Foo();
    //...
    }
    }
    • Tangled:
    • ISystem
    =
    • IFoo
    =
    • IBar
    • Afoo
    • Any candidate for “painful”
    zone:

    View Slide

  16. jgs
    516 00010000
    Question
    A:0
    Ca:1
    Ce:4
    I:4/5=0.8
    D:-0.2
    A:0
    Ca:2
    Ce:3
    I:3/5=0.6
    D:-0.4
    A:0
    Ca:1
    Ce:3
    I:3/4=0.75
    D:-0.25

    View Slide

  17. jgs
    516 00010000
    Example

    View Slide

  18. jgs
    516 00010000
    Reference
    § Agile Software Development: Principles, Patterns, and Practices. Robert C.
    Martin. Prentice Hall. 2006.
    Chapter 30.

    View Slide

  19. 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