Effective Code Review
-
Upload
jane-prusakova -
Category
Software
-
view
370 -
download
0
Transcript of Effective Code Review
Judge a coder by the code?
Author
Reviewer
Code
Cooperation, not competition
Attention is respect
Everyone is a reviewer
Judge a coder by the code?
Cooperation, not competition
Attention is respect
Everyone is a reviewer
Author
Reviewer
Code
Bucket listVisual layout
Naming
Architecture
Test coverage
• Is it
readable*?• Is it good
maintainable code? • Does it do
what it appears to do?
What is readable code?Defined by technology community
Common knowledge
Expected tenure
Popular tools
Skip
Explanations what the code does
Checks by automated tools
Reasons why this code is bad
Arguments about preferences*
Code review is NOTA substitute for the QA
A check on automated tools results
A discussion on formatting, tools, or patterns
Goals of code review Immediate benefit
Medium to longer-term improvements
Building technical community
BugsUnintended
behavior
Bad Code
Bugs coming soon
Erratic codeHard to
understand
Common Vision
-ilitiesDependenciesPoor scalability
Good CodeWorthy of a compliment
Code review is not a meeting
Preparation Conversation Follow up0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Author Reviewer(s)
Code review is not a meeting
Preparation Conversation Follow up0
0.5
1
1.5
2
2.5
3
3.5
4
4.5
Author Reviewer(s)
Author
Verify test coverageRun code quality tools
Fix problems
Reviewer
Run testsRead the codeRead the tests
Be prepared
Show logic
One decision per code block
Show main line of reasoning
D.R.Y.
Test every scenario exactly once
NamingMake sense
Accepted terminology
Abbreviations
As short as possible but not any shorter
oviAnioviparousAnimal
Chicken!
Technical Quality
Takes time
Takes a community
Takes iterations
Write code
Prepare for code review
Code review
Follow up
BugsUnintended
behavior
Bad Code
Bugs coming soon
Erratic codeHard to
understand
Common Vision
-ilitiesDependenciesPoor scalability
Good CodeWorthy of a compliment
GOOD CODE
SHARED UNDERSTANDING
IMPROVING
Code review is like pants. If you work alone, pants are optional. But if you are part of a team, make sure you have pants on.