Slide 1

Slide 1 text

jgs CSC 309 Software Engineering II Lecture 02: Software Metrics: Structural Quality Dr. Javier Gonzalez-Sanchez [email protected] www.javiergs.com Building 14 -227

Slide 2

Slide 2 text

jgs Previously …

Slide 3

Slide 3 text

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

Slide 4

Slide 4 text

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

Slide 5

Slide 5 text

jgs Structural Metrics

Slide 6

Slide 6 text

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

Slide 7

Slide 7 text

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

Slide 8

Slide 8 text

jgs Abstractness

Slide 9

Slide 9 text

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

Slide 10

Slide 10 text

jgs Instability

Slide 11

Slide 11 text

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

Slide 12

Slide 12 text

jgs Distance

Slide 13

Slide 13 text

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

Slide 14

Slide 14 text

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

Slide 15

Slide 15 text

jgs Test Yourselves

Slide 16

Slide 16 text

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

Slide 17

Slide 17 text

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

Slide 18

Slide 18 text

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

Slide 19

Slide 19 text

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]

Slide 20

Slide 20 text

jgs

Slide 21

Slide 21 text

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

Slide 22

Slide 22 text

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

Slide 23

Slide 23 text

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

Slide 24

Slide 24 text

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.