agile code quality metrics

Post on 22-Nov-2014

8.264 Views

Category:

Education

0 Downloads

Preview:

Click to see full reader

DESCRIPTION

A few KPIs for static code analysis for agile teams

TRANSCRIPT

Agile Code Quality Metrics

Gil Nahmias, CSP

Summary for Experts

Metrics–WTF/Minute– Abstractness vs.

Instability– Cyclomatic complexity– Test cases/Class– Defect Density– Fan in, Fan out– Code coverage, Test

coverage

Tools- ‘Metrics’

eclipse plugin- Ndepend- SourceMonitor- Klocwork

“Metrics are a carving knife when what you really need is a scalpel. Metrics can tell you something is wrong, but they can't give you much guidance about the precise cause.

disclaimer

In the case of clean code, the cause is discipline and professionalism”...”Fixing that problem is a matter of instilling pride of workmanship into the team”

-- Uncle Bob

Note before we start

What are we trying to understand

What we actually measure How does it

make people behave

Note before we start

What are we trying to understand

What we actually measure How does it

make people behave

Software Quality

# of bugs

Not record bugsHidden bugs, long stabilization, poor quality

Note before we start

What are we trying to understand

What we actually measure How does it

make people behave

Software Quality

Escaping Defects

Hidden bugs, long stabilization, poor quality

WTF/Minute – in code review

osnews.com/

comics

Abstractness vs. instability

blog.troytuttle.co

m

Software quality

Defect Density: number of defects per lines of code

Unit test density: number of unit test cases per feature or class.

+ve (actual = expected) -ve (actual != expected) stress

integration

MINIMUM

4

completeness

Code coverage: percentage of automatically tested code

Test coverage: percentage of automatically tested business scenarios

Code

Tests

Business

complexity

Fan-in: per type is the number of types that depends directly on it. [a.k.a. Afferent Coupling]

Fan-out: per type is the number of types it directly depends on.  [a.k.a. Efferent Coupling]

Cyclomatic complexity: number of decisions that can be taken in a procedure [can be measured per class/feature]

contact me for more

gil@agilesparks.com

@gilnahmias

myagile.co.il

top related