Code as a Crime Scene @AdamTornhill Understanding Code - - PowerPoint PPT Presentation

code as a crime scene
SMART_READER_LITE
LIVE PREVIEW

Code as a Crime Scene @AdamTornhill Understanding Code - - PowerPoint PPT Presentation

Treat Your Code as a Crime Scene @AdamTornhill Understanding Code @AdamTornhill Cyclomatic Complexity @AdamTornhill Syntactic complexity metrics cannot capture the whole picture of software complexity (Herraiz & Hassan) The use


slide-1
SLIDE 1

@AdamTornhill

Treat Your

Code as a Crime Scene

slide-2
SLIDE 2

Understanding Code

slide-3
SLIDE 3

@AdamTornhill

slide-4
SLIDE 4

Cyclomatic Complexity

@AdamTornhill

slide-5
SLIDE 5

“Syntactic complexity metrics cannot capture the whole picture of software complexity” (Herraiz & Hassan) “The use of metrics to manage software projects has not even reached a state of infancy” (Glass)

@AdamTornhill

slide-6
SLIDE 6

Intuition Doesn’t Scale

slide-7
SLIDE 7

Forensic Psychology

slide-8
SLIDE 8
slide-9
SLIDE 9

G e

  • g

r a p h i c a l

O f f e n d e r

P r

  • fi

l i n g

  • a

2 M i n u t e s

I n t r

  • d

u c t i

  • n
slide-10
SLIDE 10

Profiling the Ripper

slide-11
SLIDE 11

How can we use this in Code?

slide-12
SLIDE 12

A geography of code

Code City, http://www.inf.usi.ch/phd/wettel/codecity.html

@AdamTornhill

slide-13
SLIDE 13

Spatial Movement in Code

[0a05fba] Adam Tornhill 2013-09-17 Added an identity analysis as debug aid
 5 1 README.md
 5 5 src/code_maat/analysis/authors.clj
 3 4 src/code_maat/app/app.clj
 1 1 src/code_maat/core.clj
 18 1 test/code_maat/end_to_end/scenario_tests.clj

Who? When? Where!

@AdamTornhill

slide-14
SLIDE 14

Geographical profiling of Code

@AdamTornhill

slide-15
SLIDE 15

Geographical profiling of Code

Hotspot

@AdamTornhill

slide-16
SLIDE 16

A Case Study

slide-17
SLIDE 17

Hotspot Hotspot

@AdamTornhill

slide-18
SLIDE 18

Hotspots and Defects

7 out of 8 most defect dense parts 4% of the Code, 72% of all defects!

slide-19
SLIDE 19

Improve 4% of your code,

get rid of most defects

@AdamTornhill

slide-20
SLIDE 20

Evolution of a Program

Time

slide-21
SLIDE 21

Complexity Trend

method-to-ir.c

2010 2014 Time Complexity

slide-22
SLIDE 22

Software

slide-23
SLIDE 23

C

  • d

e Doesn’t

L i e?

slide-24
SLIDE 24

FuelInjector.cs

Temporal Coupling

Diagnostics.cs Combustion.cs Commit #1 Commit #2 Commit #3 Time

@AdamTornhill

slide-25
SLIDE 25

?

Logical coupling Physical coupling

@AdamTornhill

slide-26
SLIDE 26

Temporal Coupling

@AdamTornhill

slide-27
SLIDE 27

Conway’s Law

Legacy Code?

and

slide-28
SLIDE 28

@AdamTornhill

slide-29
SLIDE 29

Team #1 Team #2 Team #3

A Perfect World

@AdamTornhill

slide-30
SLIDE 30

Team #2 Team #3 Team #1 Team #4

@AdamTornhill

slide-31
SLIDE 31

Team #1 Team #2 Team #3 Team #4

@AdamTornhill

slide-32
SLIDE 32

Align Your Architecture and Organisation

slide-33
SLIDE 33

Number of Programmers Q u a l i t y

@AdamTornhill

slide-34
SLIDE 34

Idea from: Fractal Figures: Visualizing Development Effort for CVS Entities (D’Ambros, Lanza, & Gall)

Fractal Figures

@AdamTornhill

slide-35
SLIDE 35

Identify Main developers

Main Developer “Knowledge Owner”

@AdamTornhill

slide-36
SLIDE 36

Your map as a Guide

slide-37
SLIDE 37

Team #1 Team #2 Team #3

@AdamTornhill

slide-38
SLIDE 38

The Pareto Principle

slide-39
SLIDE 39

Loss of Knowledge

@AdamTornhill

slide-40
SLIDE 40

Abandoned subsystem

@AdamTornhill

slide-41
SLIDE 41

Code <3 Forensics

@AdamTornhill

slide-42
SLIDE 42

@AdamTornhill adam@adamtornhill.com

Read More www.adamtornhill.com/articles/aspnetclones/killtheclones.html www.adamtornhill.com/articles/socialside/socialsideofcode.htm The Tools as a Service (work in progress) https://codescene.io/

slide-43
SLIDE 43