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

CSC305 Lecture 07

100

CSC305 Lecture 07

Individual Software Design and Development
Structural Metrics
(202410)

Javier Gonzalez-Sanchez

October 07, 2024
Tweet

Transcript

  1. Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.info o ffi ce: 14 -227

    CSC 305 Individual Software Design and Development Lecture 07. Structural Metrics
  2. Complexity Number Meaning 1-10 Structured and well written code High

    Testability Cost and Effort is less 10-20 Complex Code Medium Testability Cost and effort is Medium 20-40 Very complex Code Low Testability Cost and Effort are high >40 Not at all testable Very high Cost and Effort Cyclomatic Complexity 3
  3. Abstractness of a Package • It is the degree to

    which a cl a ss or p a ck a ge emph a sizes a bstr a ction over concrete implement a tion • It is a v a lue 0 to 1: • For p a ck a ges, It is the r a tio of a bstr a ct cl a sses or interf a ces to the tot a l number of cl a sses within a p a ck a ge. • For cl a sses, It is 0 for a concrete cl a ss a nd 1 for a n interf a ce or a bstr a ct cl a sses 7
  4. Instability • Indic a tes whether: ( a ) the

    item is m a inly used by others (st a ble – h a rd to ch a nge); or (b) it m a inly depends on other items (in-st a ble – ch a nge a ble). • It is a v a lue between 0 a nd 1: • 0 only incoming dependencies to • 1 (only outgoing dependencies). 8
  5. Distance • Dist a nce: how f a r a

    p a ck a ge is a w a y from the M a in Sequence • D = A + I – 1 • V a lues -1 to 1 • Absolute Dist a nce |D| 10
  6. Distance 11 Abstract Concrete Stable Hard to Change Only incoming

    dependencies Unstable Changeable Only outgoing dependencies the m ain sequence Painful Useless 0 1 1 0 Instability Abstractness
  7. Reminder 18 Calculate metrics (A, I) for the kappa version

    of my Paint App https://github.com/CSC3100/App-Paint/tree/main/ src/main/java/javiergs/paint/Kappa
  8. CSC 305 Individual Software Design and Development Javier Gonzalez-Sanchez, Ph.D.

    [email protected] Summer 2024 Copyright. These slides can only be used as study material for the class CSC305 at Cal Poly. They cannot be distributed or used for another purpose.