agile and cmmi - a potential blend

24
Agile with CMMi - A potent blend… Mosesraj R Collabera Solutions Bangalore 1

Upload: mosesraj-r

Post on 19-Jun-2015

220 views

Category:

Technology


0 download

DESCRIPTION

Presented at Agile in Business conference at Bangalore. This presentation focuses on code metrics that can be used as lead indicators to effectively control and predict the application quality

TRANSCRIPT

Page 1: Agile and CMMI - a potential blend

1

Agile with CMMi - A potent blend…

Mosesraj RCollabera Solutions

Bangalore

Page 2: Agile and CMMI - a potential blend

CMMI & Agile

2

Engineering Practice Requirements

Management

Practice

Requirements

Quantitative

Improvement

y = f(xn)

Level 2/3

Level 4/5

Principles

Practices

Retrosp

ective

Manifesto

SCRUM/XP

Organization focus

Project level focus

Page 3: Agile and CMMI - a potential blend

3

Fundamental challenge - measurability

Pe

op

le

P r o c e s sE n g i n e e r i n g

Page 4: Agile and CMMI - a potential blend

4

Genrich Altshuller scanned 400,000 patent descriptions, and found that only 2% were really new. This means, 98% of all new problems can be solved using previous experience/learning(s).

Page 5: Agile and CMMI - a potential blend

5

JIDOKA

AUTONOMATION

Page 6: Agile and CMMI - a potential blend

6

Requirement changesIss

ues

Defects

Requirementsstructure

Test caseadequacyCode

structure

Arch

itect

ural

Robu

stne

ss

Coup

ling

&

cohe

sion

Structural application profile

“ . . . .Yo u r h a n d s c a n ’ t

h i t w h a t yo u r e ye s

c a n ’ t s e e … . .”

M u h a m m a d A l i

Page 7: Agile and CMMI - a potential blend

7

Requirements

Architecture

Design &

Coding

Unit Testing

System /Functio

nal Testing

Requirements & Architecture

Baseline

Continuous Integration & Iteration Releases

T y p i c a l L i f e c y c l e i n C o l l a b e r a

Page 8: Agile and CMMI - a potential blend

8

Page 9: Agile and CMMI - a potential blend

9

Page 10: Agile and CMMI - a potential blend

10

Can ‘defect prone’ tendency be isolated?

• A study on eclipse (published in PROMISE 2007)– Defects are mapped to less than 15% of files

• Study on Firefox– Security issues are mapped a low % of code

(predominantly java script interpreter)• Publication from CAST– In a US based bank around 30% defects in tests

are attributed to identifiable poor code structures

Page 11: Agile and CMMI - a potential blend

11

Cyclomatic complexity

%Branch Statements

Depth of InheritanceCalls/method

Methods / Class

Class Coupling

Maintainability Index Boolean Expression

complexity

Class Data Abstraction coupling

Class Fan Out Complexity

Npath Complexity

Java NCSS

% comment Lines Density of comment linesPublic undocumented API

Duplicated lines

Duplicated blocks

Number of children

Afferent couplings

Lack of cohesion methods

Package dependencies to cut

Violations

Complexity distribution by method

Complexity distribution by class

File dependencies to cut

The problem of plenty…

Page 12: Agile and CMMI - a potential blend

II

B r i d g i n g t h e e a g l e ’ s e y e a n d w o r m ’ s v i e w Slide 12

% Branches Block Depth

Cyclomatic Complexity

Correlating SIT with engineering metrics

% Branches Block Depth

Max Cyclomatic Complexity

12

Influence of complexity attribute

Page 13: Agile and CMMI - a potential blend

Composite parameter analysis

92%

4%2% 1%1%

Number of Class vs SIT defects

8% of classes is contributing to 100% of SIT defects

Study from European university

Key parameters measured Cyclomatic complexity/LOC No. of methods/class No. of Calls/method LOC/method

13

Page 14: Agile and CMMI - a potential blend

Toxicity Analysis

14

Detailed study of the data shows most of the SIT & AT defects are occurring amongst the top four Java classes shown in the sample data above which have highly toxic code with high method length

Correlates to AT & SIT defects

Page 15: Agile and CMMI - a potential blend

15

2.3.10.1

2.3.9.22.3.6.2

2.3.53.2

2.3.52.2

2.3.5.22.3.4.22.3.36.2

2.3.35.2

2.3.34.2

2.3.33.2

2.3.32.22.3.30.22.3.20.22.3.19.2

2.3.10.2

2.3.7.2

2.3.50.2

2.3.49.2

2.3.20.2

2.3.13.22.3.44.22.3.43.22.3.42.22.3.41.2

2.3.40.2

2.3.39.2

2.3.38.2

2.3.37.2

2.3.11.2

2.3.12.2

2.3.27.2

2.3.2.2

2.3.1.2

2.3.48.2

2.3.47.2

2.3.46.2

2.3.45.2

2.3.26.2

2.3.25.2

2.3.23.2

2.3.22.2

2.3.18.2

2.3.17.2

2.3.16.2

2.3.15.2

UC complexity v/s cyclomatic complexity

Page 16: Agile and CMMI - a potential blend

16

See code akin to a city map...

Page 17: Agile and CMMI - a potential blend

Developer’s Structural Analysis Kit

17

Parameters

• Max /Avg. Cyclomatic Complexity

• Methods Per Class• Avg Statements Per Method• % Branch statements• Max Block Depth• Cyclomatic complexity• No. of Calls/method• LOC/method• LOC/Program • Fan out• Data abstraction coupling

Tools

• Source monitor• PMD• Checkstyle• iPlasma & Code city• Sonar

Process

• Integration to build tools• Prior to code review• Analysis before release

Page 18: Agile and CMMI - a potential blend

Shifting to the better – Project level

18

Page 19: Agile and CMMI - a potential blend

19

Shifting to the better – Org level

Max Code Complexity

Methods per Class

Statement per Method

Branches % Max Block Depth

0

2

4

6

8

10

12

14

16

18

Dec-10Dec-11

Page 20: Agile and CMMI - a potential blend

20

Improved Pre-SIT Detection

Dec-09 Dec-11 Till Date

Page 21: Agile and CMMI - a potential blend

Shift in defect distribution

Requirements & Design review

Code Review Unit Test System Test Post Release

Pre Post

21

Page 22: Agile and CMMI - a potential blend

22

Customer Satisfaction

Engage

ment Plan

ning

Engage

ment Exe

cution

Engage

ment Resu

lts

People

Overall Engagement Level View

Overall 2010

Page 23: Agile and CMMI - a potential blend

23

Qualitative Benefits• Objective measures; language of developer

• Improve ability to isolate and deal with the defective ones

• Improved risk management and transparency

Page 24: Agile and CMMI - a potential blend

24

Thank you

Mosesraj R - ([email protected])