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

CSC309 Lecture 03

CSC309 Lecture 03

Software Engineering II
Software Metrics: Structural Quality
(202301)

Javier Gonzalez-Sanchez

January 16, 2023
Tweet

More Decks by Javier Gonzalez-Sanchez

Other Decks in Programming

Transcript

  1. jgs
    CSC 309
    Software Engineering II
    Lecture 03:
    Software Metrics: Structural Quality
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    www.javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View full-size slide

  2. jgs
    Previously …

    View full-size slide

  3. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 3
    code
    Key Ideas CSC 309
    idea
    requirements
    architecture
    design
    quality measure

    View full-size slide

  4. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 4
    Metrics
    Size
    LOC
    eLOC
    lLOC
    Understandability
    Comments
    Whitespaces
    Complexity
    Average, Max, Min LOC
    Cyclomatic Complexity
    Software Metrics

    View full-size slide

  5. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 5
    Example

    View full-size slide

  6. jgs
    Structural Metrics

    View full-size slide

  7. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 7
    Example A

    View full-size slide

  8. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 8
    Example B

    View full-size slide

  9. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 9
    Example C
    A)
    B)

    View full-size slide

  10. jgs
    Abstractness

    View full-size slide

  11. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 11
    § 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)
    Abstractness of a Package

    View full-size slide

  12. jgs
    Instability

    View full-size slide

  13. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 13
    § Indicates whether
    (a) the item is mainly used by others (stable – hard to change); or
    (b) it mainly depends on other items (instable – changeable).
    § It is a value between 0 and 1:
    0 only incoming dependencies to
    1 (only outgoing dependencies)
    Instability

    View full-size slide

  14. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 15
    § Distance: how far a package is away from
    the Main Sequence
    § D = A + I – 1
    § Values -1 to 1
    § Absolute Distance |D|
    Distance

    View full-size slide

  15. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 16
    Stable Abstraction Principle
    Abstract
    concrete
    Stable
    Hard to Change
    Only incoming dependencies
    Unstable
    Changeable
    Only outgoing dependencies

    View full-size slide

  16. jgs
    Test Yourselves

    View full-size slide

  17. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 18
    Question
    project3.common.model
    project3.client.UI
    project3.server.controller

    View full-size slide

  18. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 19
    Question

    View full-size slide

  19. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 20
    Questions

    View full-size slide

  20. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 21
    Office Hours
    Tuesday and Thursday 3 - 5 pm
    But an appointment required
    Sent me an email – [email protected]

    View full-size slide

  21. jgs
    CSC 309
    Software Engineering II
    Lab 03:
    Structural Metrics
    Dr. Javier Gonzalez-Sanchez
    [email protected]
    www.javiergs.com
    Building 14 -227
    Office Hours: By appointment

    View full-size slide

  22. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 24
    Think about this
    Calculate metrics for your final
    project in CSC 308

    View full-size slide

  23. jgs
    Javier Gonzalez-Sanchez | CSC 309 | Winter 2023 | 25
    Let’s Work

    View full-size slide

  24. jgs
    CSC 309 Software Engineering II
    Javier Gonzalez-Sanchez, Ph.D.
    [email protected]
    Winter 2023
    Copyright. These slides can only be used as study material for the class CSC308 at Cal Poly.
    They cannot be distributed or used for another purpose.

    View full-size slide