Code Review E Book Greiler V2
Code Review E Book Greiler V2
MICHAELA GREILER
CODE REVIEWS
WWW.MICHAELAGREILER,COM
CONTENT
03
ABOUT DR. GREILER
04
CODE REVIEW
WORKSHOP
05
CODE REVIEW STUDY
09
CODE REVIEW
BEST PRACTICES
10
CODE REVIEWS AT
MICROSOFT
11
CODE REVIEWS AT
GOOGLE
CONTENT
12
MOTIVATIONS FOR
CODE REVIEWS
13
CODE REVIEW
PITFALLS
14
CODE REVIEW
TOOL NEEDS
15
CODE REVIEW
CHECKLIST - PROCESS
16
CODE REVIEW
CHECKLIST - CODE
Hi, I'm Dr. Michaela Greiler
I help companies and teams to implement
software development.
or trainer.
WWW.MICHAELAGREILER.COM
MAKE
CODE REVIEWS
YOUR
SUPERPOWER
This highly interactive full-day workshop is designed to give
you superpowers through your boosted code review practice.
CODE REVIEW
STUDY
At Microsoft, we conducted a study to This report highlights some of the
understand developers' needs and best outcomes of this in-depth study.
practices during code reviewing.
The observations, interviews and survey
For this large-scale study, surveyed helped us to get a very clear
more than 900 developers. This survey understanding of the challenges
was a follow-up from interviews and software engineers face when
observations we did with 18 developers conducting code reviews.
from 4 different projects.
We also distilled several best practices
Especially this combination of that can help teams to be more
quantitativ results of hundreds of productive and get the most value from
developers with the qualitative and in- code reviewing.
depth findings from sitting with teams
for over one week to observe and To learn more about this study:
understand their code review activities Code Review Study
in detail, is a very powerful one.
WWW.MICHAELAGREILER.COM PAGE 05
DR. MICHAELA GREILER
SURVEY FOCUS
In our survey at Microsoft, we asked over 900 engineers about their
demographics, their team policies and of course which review
tools they use.
We also asked them about their motivation for code reviews, and
the challenges they face.
SURVEY DEMOGRAPHICS
75%
of respondents are software
engineers or senior software
engineers
25%
are either managers in
technical roles or product
managers
WWW.MICHAELAGREILER.COM PAGE 06
DR. MICHAELA GREILER
39% 21%
indicate to review changes of of the respondents review
others at least once a day. multiple changes per day.
36% 13%
review code at a couple of times either review once per week or
per week do not participate in code
reviews in the last week
WWW.MICHAELAGREILER.COM PAGE 07
DR. MICHAELA GREILER
MOTIVATIONS
The most important
reasons for developers to
do code reviews are:
CODE REVIEW
MOTIVATION Code improvements
WWW.MICHAELAGREILER.COM PAGE 08
Code Review
Best Practices
Code Author
Read through the changes
Code Reviewer
code review
review
Ensure traceability for decisions
need them
Reduce task switching as it kills
learn
Give feedback in a timely manner
review
bang fashion
the review
Use a review checklists
reviewers
www.michaelagreiler.com
DR. MICHAELA GREILER
CODE REVIEWS AT
MICROSOFT
process
Code reviews can be performed in
great best practice. And most high- times, teams review code together in
performing teams spend a lot of time doing groups. But the most likely scenario
www.michaelagreiler.com
DR. MICHAELA GREILER
CODE REVIEWS AT
GOOGLE
readability certificate
PAGE 11
www.michaelagreiler.com
DR. MICHAELA GREILER
5 REASONS
GOOGLERS
REVIEW CODE
Accident
Education prevention
Mentoring, learning, Find bugs and defects,
Tracing &
STOP
Gatekeeping tracking
Prevent arbitrary code to Understanding evolution and
Readable Code
Maintaining norms, consistent style and
design, and having adequate tests
it definitely improves the overall code health of the system being worked on,
PAGE 12
www.michaelagreiler.com
DR. MICHAELA GREILER
CODE REVIEW
PITFALLS
is a pain
Code reviewing isn’t always a smooth the code in the meanwhile can be a
provides.
Read all Code Review Pitfalls here.
PAGE 13
DR. MICHAELA GREILER
and coherent?
How do I structure my work day?
Have you written a description about the When is a good time to do code
Have you tested and analyzed the the Have I set dedicated time aside to do
timely-manner?
feedback?
How do I handle feedback? Did I communicate in a respectful way?
Did I tell reviewers how I have addressed Did I explain what the code author has
traceability?
www.michaelagreiler.com
Code Review Checklist
Code (1/3)
Implementation Dependencies
Does this code change do what it is If this change requires updates outside
Dependency Injection?
www.michaelagreiler.com
Code Review Checklist
Code (2/3)
the code does not behave as intended? Which parts were confusing to you and
events that could break the code? Can the readability of the code be
Does it have enough automated tests Would more comments make the code
Are there some test cases, input or Is there any commented out code?
addition?
www.michaelagreiler.com
Code Review Checklist
Code (3/3)
Usability and Accessibility Experts Opinion
Is the proposed solution well Do you think a specific expert, like a
Is the proposed solution (UI) Will this code change impact different
Performance
Do you think this code change will
Find more at michaelagreiler.com
Code Review Best Practices
impact system performance in a
Code Review Pitfalls
negative way?
Code Reviews at Microsoft
Do you see any potential to improve
Code Reviews at Google
the performance of the code?
www.michaelagreiler.com
Get 10% off my
workshop on
code review
Book a free appointment
Software Engineering
UNLOCKED
WWW.SE-UNLOCKED.COM
FIND IT ON ITUNES, SPOTIFY AND MANY MORE