The document discusses how to effectively conduct code reviews and provides lessons on avoiding common failures. It explains that code reviews are an essential practice for software craftsmanship to provide feedback on code quality. However, they can fail if the reviews are not properly prepared, if the team does not work together, or if reviews devolve into arguments. The document recommends taking time to prepare, focusing on improving the code instead of criticizing authors, finding formats that work for the team, and progressing together.
1 of 18
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
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
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 ?
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 ?
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