The Metrics Trap Michael Feathers We all know fold foldl1 (+) - - PowerPoint PPT Presentation

the metrics trap
SMART_READER_LITE
LIVE PREVIEW

The Metrics Trap Michael Feathers We all know fold foldl1 (+) - - PowerPoint PPT Presentation

The Metrics Trap Michael Feathers We all know fold foldl1 (+) [1..5] foldl1 (+) [1..5] 15 We all know Average data Pair = Pair !Int !Double average :: Vector Double -> Double average xs = s / fromIntegral n where Pair n s =


slide-1
SLIDE 1

The Metrics Trap

Michael Feathers

slide-2
SLIDE 2

We all know fold

slide-3
SLIDE 3

foldl1 (+) [1..5]

slide-4
SLIDE 4

foldl1 (+) [1..5] 15

slide-5
SLIDE 5

We all know Average

slide-6
SLIDE 6

data Pair = Pair !Int !Double average :: Vector Double -> Double average xs = s / fromIntegral n where Pair n s = foldl' k (Pair 0 0) xs k (Pair n s) x = Pair (n+1) (s+x)

slide-7
SLIDE 7

data Pair = Pair !Int !Double average :: Vector Double -> Double average xs = s / fromIntegral n where Pair n s = foldl' k (Pair 0 0) xs k (Pair n s) x = Pair (n+1) (s+x)

slide-8
SLIDE 8

Standard ways of reducing information

slide-9
SLIDE 9

(average [1, 1, 1, 1, 1, 1]) == (average [11, -9, 12, -10])

slide-10
SLIDE 10

It turns out that we do this all the time

slide-11
SLIDE 11
slide-12
SLIDE 12
slide-13
SLIDE 13
slide-14
SLIDE 14

Quantitative Bias In every use of units, there’s an assumption

  • f uniformity
slide-15
SLIDE 15

Quantitative Bias In every use of units, there’s an assumption

  • f uniformity

1 can be exchanged for 1

slide-16
SLIDE 16

“We want to establish key metrics and indicators to measure our progress toward the goal.”

slide-17
SLIDE 17

“We want to establish key metrics and indicators to measure our progress toward the goal.”

slide-18
SLIDE 18

But..

slide-19
SLIDE 19
slide-20
SLIDE 20

We don’t have (m)any uniform distributions in software

slide-21
SLIDE 21
slide-22
SLIDE 22
slide-23
SLIDE 23

Distortion via Metrics

slide-24
SLIDE 24

There is no “right” number for method size, class size, amount of complexity, etc

slide-25
SLIDE 25

Why do we persist in our reductionism?

slide-26
SLIDE 26

Maybe it is because we can’t think of anything better

slide-27
SLIDE 27

“We want to establish key metrics and indicators to measure our progress toward the goal.”

slide-28
SLIDE 28
slide-29
SLIDE 29

“Laws” of Metrics

slide-30
SLIDE 30

“Laws” of Metrics

  • 1. Distance Causes Misunderstanding
slide-31
SLIDE 31

“Laws” of Metrics

  • 1. Distance Causes Misunderstanding
  • 2. Highlighting Leads to Focus
slide-32
SLIDE 32

“Laws” of Metrics

  • 1. Distance Causes Misunderstanding
  • 2. Highlighting Leads to Focus
  • 3. Focus Leads to Action
slide-33
SLIDE 33

“Laws” of Metrics

  • 1. Distance Causes Misunderstanding
  • 2. Highlighting Leads to Focus
  • 3. Focus Leads to Action
  • 4. Focus Leads to Side-Effects
slide-34
SLIDE 34

Death of Locality

slide-35
SLIDE 35

Practice Use Qualitative “Measures” when Possible

slide-36
SLIDE 36
slide-37
SLIDE 37

Practice Silent Alarms

slide-38
SLIDE 38

Silent Alarms

Don’t have check-in gates. Let people make mistakes. Investigate the mistakes off-line and see why they

  • happened. Then, intervene
slide-39
SLIDE 39

Practice

Disposable Metrics

slide-40
SLIDE 40

Disposable Metrics

Secondary effects are less likely when metrics come and go. Use them to highlight concerns

slide-41
SLIDE 41

Practice Targeted Metrics

slide-42
SLIDE 42

Targeted Metric - Feature Trend Cards

Hypothesize a couple of features that you will never add to your code. Task them and estimate them

  • periodically. See the debt trend for areas they touch.
slide-43
SLIDE 43

Practice Deluge with Metrics

slide-44
SLIDE 44

Deluge

The more metrics you have, the harder it is to take any one of them too seriously. They become “vital signs” and indicators as we have in medicine.

slide-45
SLIDE 45

Temporal Correlation of Class Changes

slide-46
SLIDE 46
slide-47
SLIDE 47

Active Set of Classes

slide-48
SLIDE 48

Active Set of Classes

slide-49
SLIDE 49

Active Set of Classes

slide-50
SLIDE 50

Vital Signs

slide-51
SLIDE 51

Reduction is the Enemy