SlideShare uma empresa Scribd logo
1 de 19
Code-inspecties


  Ronald Harmsen
  Frank Oppedijk
Agenda
 Inleiding

 Introductie IfSQ-Level 1 (6 indicatoren)
 Hands-on: inspectie Level 1

 Introductie IfSQ-Level 2 (12 indicatoren)
 Hands-on: inspectie Level 2

 IfSQ-Level 2: nog 3 indicatoren
 Vragen & discussie
Waarom?
 Fouten vinden in bestaande code
 Fouten voorkómen – door verhoging
  van kwaliteit van toekomstige code
 Inzicht krijgen in betrouwbaarheid en
  onderhoudbaarheid
Voordelen en nadelen
   Geïnspecteerde software levert half zoveel rework op
   Geïnspecteerde software kost 90% minder onderhoud
   Inspectie vindt 60% meer fouten dan testen
   Inspectie is 4x meer effectief dan testen
   Developers die code inspecteren zijn minimaal 20%
    productiever


 Code-inspecties kosten tijd
 Code-inspecties zijn saai 
 Code-inspecties kunnen negatief werken op de sfeer
  in het team
Soorten code-inspecties
 Formeel
 Lightweight
Formele code-inspectie
 Bijv. Fagan-inspecties
 Meerdere rollen en fasen
 Effectief
   Defect Removal Efficiency ~60%
   Ter vergelijking: DRE van testen: 35%
 Tijdrovend (sneuvelt daardoor vaak)
Lightweight code-inspectie
   Bijv. ‘walkthrough’, pair-programming
   Informeel
   Sneller
   Minder effectief (DRE ~50%)
   Minder efficiënt? (Formele inspecties
    meer gefocused; betere payoff)
IfSQ
 Formeel proces; objectief
 Snel
 Op papier
IfSQ: 3 levels
 Level-1: 6 indicatoren (1 min/pagina)
 Level-2: 12 (15) indicatoren (3
  min/pagina)
 Level-3: 19 indicatoren (5
  min/pagina)
IfSQ Level-1: indicatoren
 Work In Progress
   WIP-1—Vague "To Do"
   WIP-2—Disabled Code
   WIP-3—Empty Statement Block
 Structured Programming
   SP-1—Routine Too Long
   SP-2—Nesting Too Deep
 Single Point of Maintenance
   SPM-1—Magic Numbers
IfSQ Level-1: proces
IfSQ Level-1: hands-on
 Voer inspectie uit op uitgereikte code
 Level-1
 20 minuten

 Noot: indicatoren Level-1 staan in
  boekje en op Quick Reference Card
IfSQ Level-1: hands-on
 Resultaten code-inspectie:
   WIP-1—Vague "To Do":2
   WIP-2—Disabled Code: 38
   WIP-3—Empty Statement Block: 5

   SP-1—Routine Too Long: 10
   SP-2—Nesting Too Deep: 0

   SPM-1—Magic Numbers: 31
IfSQ Level-2: 6 extra indicatoren
 Structured Programming
   SP-3—Routine Too Complex
 Single Point of Maintenance
   SPM-2—Magic Strings
   SPM-3—Copy/Paste Programming
 Defensive Programming
   DP-1—Parameter Not Checked
   DP-2—Status Ignored After Call
   DP-3—Unexpected State Not Trapped
IfSQ Level-2: proces
IfSQ Level-2: hands-on
 Voer inspectie uit op zelf
  meegebrachte code
 Level-2
 30 minuten

 Noot: indicatoren Level-2 staan op
  Quick Reference Card
IfSQ Level-2: rating
 Bereken defect indicators per 1000 LOC
 Bepaal vervolgens de rating:
                    count/kLOC (min.)   count/kLOC (max.)   rating
                           0                    0            10
                           1                    1             9
                           2                    4             8
                           5                    9             7
                           10                  19             6
                           20                  49             5
                           50                  99             4
                          100                  199            3
                          200                  499            2
                          500                  999            1
                          1000              unlimited         0
IfSQ Level-2
 Nog 3 indicatoren
 Minder objectief

 CfC-NC—Not Complete
 CfC-WR—Wrong Result
 CfC-HtM—Hard to Maintain
Vragen?

Mais conteúdo relacionado

Mais de Devnology

Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISPDevnology
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISPDevnology
 
Devnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology
 
Devnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en ArchitectuurDevnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en ArchitectuurDevnology
 
Devnology Back to School III : Software impact
Devnology Back to School III : Software impactDevnology Back to School III : Software impact
Devnology Back to School III : Software impactDevnology
 
Devnology back toschool software reengineering
Devnology back toschool software reengineeringDevnology back toschool software reengineering
Devnology back toschool software reengineeringDevnology
 
Introduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software VolcanoIntroduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software VolcanoDevnology
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology
 
Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011Devnology
 
Spoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in EclipseSpoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in EclipseDevnology
 
Experimenting with Augmented Reality
Experimenting with Augmented RealityExperimenting with Augmented Reality
Experimenting with Augmented RealityDevnology
 
Unit testing and MVVM in Silverlight
Unit testing and MVVM in SilverlightUnit testing and MVVM in Silverlight
Unit testing and MVVM in SilverlightDevnology
 
mobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingmobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingDevnology
 
Devnology Fitnesse workshop
Devnology Fitnesse workshopDevnology Fitnesse workshop
Devnology Fitnesse workshopDevnology
 
Rascal Devnology Code Fest
Rascal Devnology Code FestRascal Devnology Code Fest
Rascal Devnology Code FestDevnology
 
Building an artificial game player in Smalltalk
Building an artificial game player in SmalltalkBuilding an artificial game player in Smalltalk
Building an artificial game player in SmalltalkDevnology
 
Reverse Engineering Spreadsheets
Reverse Engineering SpreadsheetsReverse Engineering Spreadsheets
Reverse Engineering SpreadsheetsDevnology
 
Software Transactioneel Geheugen
Software Transactioneel GeheugenSoftware Transactioneel Geheugen
Software Transactioneel GeheugenDevnology
 
Van Idee Tot ISV
Van Idee Tot ISVVan Idee Tot ISV
Van Idee Tot ISVDevnology
 

Mais de Devnology (20)

Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
 
Learn a language : LISP
Learn a language : LISPLearn a language : LISP
Learn a language : LISP
 
Devnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software DevelopmentDevnology Back to School: Empirical Evidence on Modeling in Software Development
Devnology Back to School: Empirical Evidence on Modeling in Software Development
 
Devnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en ArchitectuurDevnology Back to School IV - Agility en Architectuur
Devnology Back to School IV - Agility en Architectuur
 
Devnology Back to School III : Software impact
Devnology Back to School III : Software impactDevnology Back to School III : Software impact
Devnology Back to School III : Software impact
 
Devnology back toschool software reengineering
Devnology back toschool software reengineeringDevnology back toschool software reengineering
Devnology back toschool software reengineering
 
Introduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software VolcanoIntroduction to Software Evolution: The Software Volcano
Introduction to Software Evolution: The Software Volcano
 
Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011Devnology Workshop Genpro 2 feb 2011
Devnology Workshop Genpro 2 feb 2011
 
Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011Devnology Coding Dojo 05-01-2011
Devnology Coding Dojo 05-01-2011
 
Spoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in EclipseSpoofax: ontwikkeling van domeinspecifieke talen in Eclipse
Spoofax: ontwikkeling van domeinspecifieke talen in Eclipse
 
Experimenting with Augmented Reality
Experimenting with Augmented RealityExperimenting with Augmented Reality
Experimenting with Augmented Reality
 
Unit testing and MVVM in Silverlight
Unit testing and MVVM in SilverlightUnit testing and MVVM in Silverlight
Unit testing and MVVM in Silverlight
 
mobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkelingmobl: Een DSL voor mobiele applicatieontwikkeling
mobl: Een DSL voor mobiele applicatieontwikkeling
 
Devnology Fitnesse workshop
Devnology Fitnesse workshopDevnology Fitnesse workshop
Devnology Fitnesse workshop
 
Rascal Devnology Code Fest
Rascal Devnology Code FestRascal Devnology Code Fest
Rascal Devnology Code Fest
 
Building an artificial game player in Smalltalk
Building an artificial game player in SmalltalkBuilding an artificial game player in Smalltalk
Building an artificial game player in Smalltalk
 
Reverse Engineering Spreadsheets
Reverse Engineering SpreadsheetsReverse Engineering Spreadsheets
Reverse Engineering Spreadsheets
 
Software Transactioneel Geheugen
Software Transactioneel GeheugenSoftware Transactioneel Geheugen
Software Transactioneel Geheugen
 
Codereviews
CodereviewsCodereviews
Codereviews
 
Van Idee Tot ISV
Van Idee Tot ISVVan Idee Tot ISV
Van Idee Tot ISV
 

Code inspecties

  • 1. Code-inspecties Ronald Harmsen Frank Oppedijk
  • 2. Agenda  Inleiding  Introductie IfSQ-Level 1 (6 indicatoren)  Hands-on: inspectie Level 1  Introductie IfSQ-Level 2 (12 indicatoren)  Hands-on: inspectie Level 2  IfSQ-Level 2: nog 3 indicatoren  Vragen & discussie
  • 3. Waarom?  Fouten vinden in bestaande code  Fouten voorkómen – door verhoging van kwaliteit van toekomstige code  Inzicht krijgen in betrouwbaarheid en onderhoudbaarheid
  • 4. Voordelen en nadelen  Geïnspecteerde software levert half zoveel rework op  Geïnspecteerde software kost 90% minder onderhoud  Inspectie vindt 60% meer fouten dan testen  Inspectie is 4x meer effectief dan testen  Developers die code inspecteren zijn minimaal 20% productiever  Code-inspecties kosten tijd  Code-inspecties zijn saai   Code-inspecties kunnen negatief werken op de sfeer in het team
  • 6. Formele code-inspectie  Bijv. Fagan-inspecties  Meerdere rollen en fasen  Effectief  Defect Removal Efficiency ~60%  Ter vergelijking: DRE van testen: 35%  Tijdrovend (sneuvelt daardoor vaak)
  • 7. Lightweight code-inspectie  Bijv. ‘walkthrough’, pair-programming  Informeel  Sneller  Minder effectief (DRE ~50%)  Minder efficiënt? (Formele inspecties meer gefocused; betere payoff)
  • 8. IfSQ  Formeel proces; objectief  Snel  Op papier
  • 9. IfSQ: 3 levels  Level-1: 6 indicatoren (1 min/pagina)  Level-2: 12 (15) indicatoren (3 min/pagina)  Level-3: 19 indicatoren (5 min/pagina)
  • 10. IfSQ Level-1: indicatoren  Work In Progress  WIP-1—Vague "To Do"  WIP-2—Disabled Code  WIP-3—Empty Statement Block  Structured Programming  SP-1—Routine Too Long  SP-2—Nesting Too Deep  Single Point of Maintenance  SPM-1—Magic Numbers
  • 12. IfSQ Level-1: hands-on  Voer inspectie uit op uitgereikte code  Level-1  20 minuten  Noot: indicatoren Level-1 staan in boekje en op Quick Reference Card
  • 13. IfSQ Level-1: hands-on  Resultaten code-inspectie:  WIP-1—Vague "To Do":2  WIP-2—Disabled Code: 38  WIP-3—Empty Statement Block: 5  SP-1—Routine Too Long: 10  SP-2—Nesting Too Deep: 0  SPM-1—Magic Numbers: 31
  • 14. IfSQ Level-2: 6 extra indicatoren  Structured Programming  SP-3—Routine Too Complex  Single Point of Maintenance  SPM-2—Magic Strings  SPM-3—Copy/Paste Programming  Defensive Programming  DP-1—Parameter Not Checked  DP-2—Status Ignored After Call  DP-3—Unexpected State Not Trapped
  • 16. IfSQ Level-2: hands-on  Voer inspectie uit op zelf meegebrachte code  Level-2  30 minuten  Noot: indicatoren Level-2 staan op Quick Reference Card
  • 17. IfSQ Level-2: rating  Bereken defect indicators per 1000 LOC  Bepaal vervolgens de rating: count/kLOC (min.) count/kLOC (max.) rating 0 0 10 1 1 9 2 4 8 5 9 7 10 19 6 20 49 5 50 99 4 100 199 3 200 499 2 500 999 1 1000 unlimited 0
  • 18. IfSQ Level-2  Nog 3 indicatoren  Minder objectief  CfC-NC—Not Complete  CfC-WR—Wrong Result  CfC-HtM—Hard to Maintain