際際滷

際際滷Share a Scribd company logo
www.octo.com - www.usievents.com 1@mdomenjoud #NCrafts #CultureCode@mdomenjoud #NCrafts #CultureCode
HOW TO FAIL AT CODE REVIEW
IN FIVE LESSONS
Michel DOMENJOUD
www.octo.com - www.usievents.com 2@mdomenjoud #NCrafts #CultureCode
D辿veloppeur, in love with code since 2003.
Tech Lead  Coach Craft @OctoTechnology
@mdomenjoud #CultureCode
MICHEL DOMENJOUD
www.octo.com - www.usievents.com 3@mdomenjoud #NCrafts #CultureCode
Code review?
Of course we all know about it!
www.octo.com - www.usievents.com 4@mdomenjoud #NCrafts #CultureCode
An effective team practice to provide feedback about
code quality
www.octo.com - www.usievents.com 5@mdomenjoud #NCrafts #CultureCode
Software Craftsmanship : essential practices
+ Continuous integration, Coding standards, Refactoring,
Design, etc.
Feedback
Clean Code Automated
Testing
Test Driven
Development
Code Review
www.octo.com - www.usievents.com 6@mdomenjoud #NCrafts #CultureCode
Proven effective for many years
www.octo.com - www.usievents.com 7@mdomenjoud #NCrafts #CultureCode
Proven effective for many years
http://sail.cs.queensu.ca/publications/pubs/msr2014-mcintosh.pdf
http://www.reviewtechnik.de/NationalSoftwareQualityExperiment.pdf
Objective : detect defects early
Up to 65% of detected defects
ROI of 4 to 1
1h of review  4h of debug saved
www.octo.com - www.usievents.com 8@mdomenjoud #NCrafts #CultureCode
Proven effective for many years
Other substantial benefits
Shared coding standards
Reinforce collective code
ownership
Facilitate learning
Improve communication about
code
www.octo.com - www.usievents.com 9@mdomenjoud #NCrafts #CultureCode
Peer Review
Pair programming
Collective Review
www.octo.com - www.usievents.com 10@mdomenjoud #NCrafts #CultureCode
Fail #1 : We still have bugs everywhere !
www.octo.com - www.usievents.com 11@mdomenjoud #NCrafts #CultureCode
Go as fast as you
can !
Do not prepare
anything !
Do not ask how to
do it !
- Take your time, at a sustainable pace
- Ask for code review as soon as possible
- Prepare the review beforehand
- Share coding standards and checklists
- Train together
To miss defects And to detect them ?
www.octo.com - www.usievents.com 12@mdomenjoud #NCrafts #CultureCode
Fail #2 My team does not progress
www.octo.com - www.usievents.com 13@mdomenjoud #NCrafts #CultureCode
Do not speak to
each other !
Correct the defects
in place of the
author !
Do not write you
coding standards
- Talk with your teammates during reviews
- The author fixes the defects, using pair
programming if necessary
- Write your coding standards down
- Reevaluate them over time
Not to progress And to progress ?
www.octo.com - www.usievents.com 14@mdomenjoud #NCrafts #CultureCode
Fail #3 : Reviews look like a wrestling match
www.octo.com - www.usievents.com 15@mdomenjoud #NCrafts #CultureCode
Criticize people first
Always start a
debate or language
/ framework war !
To be sure to
have a fight
- Criticize the code, not the developer
- Rely on Egoless Programming principles
- This is not the time
- Find compromises
- Pick a standard and write it down
And for a peaceful review ?
www.octo.com - www.usievents.com 16@mdomenjoud #NCrafts #CultureCode
Three complementary formats
Peer review
Pair
programming
Start a User Story,
Complex code,
Legacy code, debug,
Learning
Define coding standards
Critical code
New technologies
All the time
On a
regular basis
On demand
For every code change
Collective
review
www.octo.com - www.usievents.com 17@mdomenjoud #NCrafts #CultureCode
5 lessons to be learned for successful reviews
1  Take your time
Prepare the review beforehand
Sustainable pace (max 1h30 &
300 LoC at a time)
2  Progress together
Talk with your teammates during
reviews
The author fixes the defects,
using pair programming if
necessary
3  Use coding standards
Share standards and checklists
Reevaluate them over time
4  Criticize the code, not the
developer
Egoless Programming principles
5  Find the format(s) which fit
your team and adapt them.
www.octo.com - www.usievents.com 18@mdomenjoud #NCrafts #CultureCode
Culture Code
Software Craftsmanship : Better Places with Better Code
A collective book about Software
Craftsmanship culture and practices
(in French)
Freely available for download
http://blog.octo.com/tag/software-craftsmanship
http://www.octo.com/fr/publications/20-culture-code

More Related Content

How to fail at code reviews in 5 lessons

  • 1. www.octo.com - www.usievents.com 1@mdomenjoud #NCrafts #CultureCode@mdomenjoud #NCrafts #CultureCode HOW TO FAIL AT CODE REVIEW IN FIVE LESSONS Michel DOMENJOUD
  • 2. www.octo.com - www.usievents.com 2@mdomenjoud #NCrafts #CultureCode D辿veloppeur, in love with code since 2003. Tech Lead Coach Craft @OctoTechnology @mdomenjoud #CultureCode MICHEL DOMENJOUD
  • 3. www.octo.com - www.usievents.com 3@mdomenjoud #NCrafts #CultureCode Code review? Of course we all know about it!
  • 4. www.octo.com - www.usievents.com 4@mdomenjoud #NCrafts #CultureCode An effective team practice to provide feedback about code quality
  • 5. www.octo.com - www.usievents.com 5@mdomenjoud #NCrafts #CultureCode Software Craftsmanship : essential practices + Continuous integration, Coding standards, Refactoring, Design, etc. Feedback Clean Code Automated Testing Test Driven Development Code Review
  • 6. www.octo.com - www.usievents.com 6@mdomenjoud #NCrafts #CultureCode Proven effective for many years
  • 7. www.octo.com - www.usievents.com 7@mdomenjoud #NCrafts #CultureCode Proven effective for many years http://sail.cs.queensu.ca/publications/pubs/msr2014-mcintosh.pdf http://www.reviewtechnik.de/NationalSoftwareQualityExperiment.pdf Objective : detect defects early Up to 65% of detected defects ROI of 4 to 1 1h of review 4h of debug saved
  • 8. www.octo.com - www.usievents.com 8@mdomenjoud #NCrafts #CultureCode Proven effective for many years Other substantial benefits Shared coding standards Reinforce collective code ownership Facilitate learning Improve communication about code
  • 9. www.octo.com - www.usievents.com 9@mdomenjoud #NCrafts #CultureCode Peer Review Pair programming Collective Review
  • 10. www.octo.com - www.usievents.com 10@mdomenjoud #NCrafts #CultureCode Fail #1 : We still have bugs everywhere !
  • 11. www.octo.com - www.usievents.com 11@mdomenjoud #NCrafts #CultureCode Go as fast as you can ! Do not prepare anything ! Do not ask how to do it ! - Take your time, at a sustainable pace - Ask for code review as soon as possible - Prepare the review beforehand - Share coding standards and checklists - Train together To miss defects And to detect them ?
  • 12. www.octo.com - www.usievents.com 12@mdomenjoud #NCrafts #CultureCode Fail #2 My team does not progress
  • 13. www.octo.com - www.usievents.com 13@mdomenjoud #NCrafts #CultureCode Do not speak to each other ! Correct the defects in place of the author ! Do not write you coding standards - Talk with your teammates during reviews - The author fixes the defects, using pair programming if necessary - Write your coding standards down - Reevaluate them over time Not to progress And to progress ?
  • 14. www.octo.com - www.usievents.com 14@mdomenjoud #NCrafts #CultureCode Fail #3 : Reviews look like a wrestling match
  • 15. www.octo.com - www.usievents.com 15@mdomenjoud #NCrafts #CultureCode Criticize people first Always start a debate or language / framework war ! To be sure to have a fight - Criticize the code, not the developer - Rely on Egoless Programming principles - This is not the time - Find compromises - Pick a standard and write it down And for a peaceful review ?
  • 16. www.octo.com - www.usievents.com 16@mdomenjoud #NCrafts #CultureCode Three complementary formats Peer review Pair programming Start a User Story, Complex code, Legacy code, debug, Learning Define coding standards Critical code New technologies All the time On a regular basis On demand For every code change Collective review
  • 17. www.octo.com - www.usievents.com 17@mdomenjoud #NCrafts #CultureCode 5 lessons to be learned for successful reviews 1 Take your time Prepare the review beforehand Sustainable pace (max 1h30 & 300 LoC at a time) 2 Progress together Talk with your teammates during reviews The author fixes the defects, using pair programming if necessary 3 Use coding standards Share standards and checklists Reevaluate them over time 4 Criticize the code, not the developer Egoless Programming principles 5 Find the format(s) which fit your team and adapt them.
  • 18. www.octo.com - www.usievents.com 18@mdomenjoud #NCrafts #CultureCode Culture Code Software Craftsmanship : Better Places with Better Code A collective book about Software Craftsmanship culture and practices (in French) Freely available for download http://blog.octo.com/tag/software-craftsmanship http://www.octo.com/fr/publications/20-culture-code