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

SER516 Lecture 23a

SER516 Lecture 23a

Software Agility: Project and Process Management
Structural Quality
(202003)

B546a9b97d993392e4b22b74b99b91fe?s=128

Javier Gonzalez

February 28, 2019
Tweet

Transcript

  1. SER516 Software Agility: Project and Process Management Javier Gonzalez-Sanchez javiergs@asu.edu

    javiergs.engineering.asu.edu Office Hours: By appointment
  2. Structural Quality 18

  3. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 3 Goal

    View Controller Model Client View Controller Model Server
  4. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 4 Checklist

    ü Readability (names, sizes, modularity, etc.) ü Dependency injection (use parameters), ü separation of concerns (patterns), ü Low Coupling (use, has, is, et al)
  5. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 5 Question

    1 A) B)
  6. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 6 Question

    2 Problem? Solution?
  7. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 7 Question

    3 A) B)
  8. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 8 Goal

    § Measuring Quality § Dependency Analysis § Detect “potential” design flaws
  9. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 9 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.
  10. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 10 What

    could be measured or analyzed? Rigidity, Fragility, Immobility, Viscosity, Opacity
  11. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 11 Principles

    1. Acyclic Dependency Principle (ADP) 2. Stable Dependency Principle (SDP) 3. Stable Abstraction Principle (SAP)
  12. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 12 Step

    1. Dependency Graph
  13. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 13 Step

    1. Dependency Graph
  14. Acyclic Dependency Principle

  15. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 15 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.
  16. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 16 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.
  17. Stable Abstraction Principle

  18. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 18 Stable

    Abstraction Principle More stable a package is, the more abstract it should be.
  19. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 19 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)
  20. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 20 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)
  21. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 21 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)
  22. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 22 Stable

    Abstraction Principle Abstract concrete Stable Hard to Change Only incoming dependencies Unstable Changeable Only outgoing dependencies
  23. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 23 •

    Instability = Cout (Cin + Cout) Stable Abstraction Principle IC= ?, A= ? IX= ?, A= ? IA= ?, A= ?
  24. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 24 •

    Instability = Cout (Cin + Cout) Stable Abstraction Principle IC= 1.0, A= ? IX= 0.5, A= ? IA= 0.0, A= ?
  25. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 25 Question

    4
  26. Stable Dependency Principle

  27. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 27 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.
  28. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 28 Question

    3 (again) A) B)
  29. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 29 SAP

    + SDP § Distance: how far a package is away from the Main Sequence § D = A + I – 1 § Values -1 to 1 § Absolute Distance |D|
  30. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 30 Question

    5 project3.common.model project3.client.UI project3.server.controller
  31. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 31 Question

    6
  32. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 32 Question

    7
  33. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 33 Question

    7
  34. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 34 Question

    7
  35. Tool

  36. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 36 Tools

    1. Download and install STAN https://stan4j.com Stand alone or Eclipse plug-in 2. Review your “Robert C. Martin” metrics: Ca, Ce, I, A, D. 3. Review “Violations” report 4. Review “Distance” plot 5. Review Dependency / Composition Graph
  37. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 37 Example

    of Violations Report
  38. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 38 PS

    about LOC per method § around 20 is perfect, § up to 50 is still fine, § up to 100 is critical, § above 150 is really bad, and § more than 250 is !
  39. Javier Gonzalez-Sanchez | SER516 | Spring 2018 | 39 Reference

    § Agile Software Development: Principles, Patterns, and Practices. Robert C. Martin. Prentice Hall. 2006. Chapter 30.
  40. SER516 – Software Agility Javier Gonzalez-Sanchez javiergs@asu.edu Spring 2018 Disclaimer.

    These slides can only be used as study material for the SER516 course at ASU. They cannot be distributed or used for another purpose.