SlideShare a Scribd company logo
1 of 47
Download to read offline
@sebrose http://cucumber.io
Seb Rose
Should testers
participate in code
reviews?
TL;DR - Yes
@sebrose http://cucumber.io
Agenda
• Some definitions
• Primary motivation
• Typical approaches
• A technique
• Two examples
• Why testers?
• Wrap up
@sebrose http://cucumber.io
Do you have a
DEFINITION
of what constitutes
a review?
@sebrose http://cucumber.io
What is a review?
a formal assessment or examination
of something with the possibility or
intention of instituting change if
necessary
@sebrose http://cucumber.io
Formal
•done in accordance with rules of
convention or etiquette
•suitable for or constituting an
official or important situation or
occasion
•officially sanctioned or recognised
@sebrose http://cucumber.io
What makes it a
CODE review?
@sebrose http://cucumber.io
What is a code review?
a formal assessment or examination
of something with the possibility or
intention of instituting change if
necessary
@sebrose http://cucumber.io
What is a code review?
a formal assessment or examination
of source code with the possibility or
intention of instituting change if
necessary
@sebrose http://cucumber.io
Will you review
the ALL the
code?
@sebrose http://cucumber.io
What is a code review?
a formal assessment or examination
of a source code change with the
possibility or intention of instituting
change if necessary
@sebrose http://cucumber.io
What is a code review?
a formal assessment or examination
of a small source code change with
the possibility or intention of
instituting change if necessary
@sebrose http://cucumber.io
Who should
CONTRIBUTE to
a review?
@sebrose http://cucumber.io
Peer
a person that is of equal standing with another
@sebrose http://cucumber.io
Today’s working definition
a formal assessment or
examination of a small source
code change
(by one or more of the author’s
peers) with the possibility or
intention of instituting change
if necessary
@sebrose http://cucumber.io
Why review?
A. Style, structure, conformity
B. Understandability
C. Performance efficiency
D. Bug prevention / detection
E. None of the above
The PRIMARY reason for carrying out a review is:
@sebrose http://cucumber.io
What is the
LIFE EXPECTANCY
of your product?
@sebrose http://cucumber.io
Simulation @robsmallshire
@sebrose http://cucumber.io
Simulation @robsmallshire
@sebrose http://cucumber.io
Why peer review?
To ensure that the next
person who works with the
code will be able to do so
safely.
@sebrose http://cucumber.io
Programs must be written
for people to read, and only
incidentally for machines to
execute.
Harold Abelson, 1984
This is not news!
@sebrose http://cucumber.io
How do we conduct reviews?
@sebrose http://cucumber.io
Behind closed doors
CODE REVIEW

IN PROGRESS
How do we conduct reviews?
@sebrose http://cucumber.io
In pairs
How do we conduct reviews?
@sebrose http://cucumber.io
On our own
How do we conduct reviews?
@sebrose http://cucumber.io
Which is best?
To ensure future
understandability, reviews
should be conducted
without the presence of the
author(s).
@sebrose http://cucumber.io
Tests as documentation
So if you want to go fast,
if you want to get done
quickly, if you want your
code to be easy to write,
make it easy to read.
Robert Martin
@sebrose http://cucumber.io
Tests as documentation
@Test
public void scale() {
Date now = new Date();
Calendar calBegin = Calendar.getInstance();
calBegin.setTime(now);
calBegin.add(Calendar.HOUR, -4);
Date begin = calBegin.getTime();
Period p = new Period(4);
long delta = p.getBegin().getTime() -
begin.getTime();
Assert.assertTrue(
p.getEnd().compareTo(now) >= 0);
logger.trace(delta);
Assert.assertTrue(delta < 10 && delta > -10);
Assert.assertEquals(
new Integer(4), new Integer(p.getScale()));
}
@sebrose http://cucumber.io
@Test
public void smoker_requires_manual_referral()
{
Customer customer = customerBuilder
.standardSingleFemale()
.smoker()
.build();
Referral referral =
underwriting.process(customer);
Assert.assertEquals(Referral.Manual, referral);
}
Tests as documentation
@sebrose http://cucumber.io
How were they different?
Intention revealing names are easier
to understand.
@sebrose http://cucumber.io
Sample pull requests (PRs)
Other source control software is
available
@sebrose http://cucumber.io
Example 1: a poor pull request
@sebrose http://cucumber.io
https://github.com/sixty-north/cosmic-ray/pull/374/commits
Example 1: a poor pull request
@sebrose http://cucumber.io
What do you think of this commit?
https://github.com/sixty-north/cosmic-ray/pull/374/commits
@sebrose http://cucumber.io
Example 2: a better pull request
@sebrose http://cucumber.io
https://github.com/cucumber/cucumber-jvm/pull/1342/commits
Example 2: a better pull request
@sebrose http://cucumber.io
What do you think of this commit?
https://github.com/cucumber/cucumber-jvm/pull/1342/commits
@sebrose http://cucumber.io
What do you think of this commit?
https://github.com/cucumber/cucumber-jvm/pull/1342/commits
@sebrose http://cucumber.io
What do you think of this commit?
https://github.com/cucumber/cucumber-jvm/pull/1342/commits
@sebrose http://cucumber.io
How were they different?
The test acts as
documentation of the
developer’s intent.
Non-developers canunderstand the test
names
@sebrose http://cucumber.io
Including non-developers …
• Ensures diverse perspectives
• Brings the beginner’s eye
• Keeps the language ubiquitous
@sebrose http://cucumber.io
Including testers …
• Brings the test perspective
• Spots missing tests early
• Allows testers to identify risk
• Helps cross-skill
@sebrose http://cucumber.io
h"p://www.slideshare.net/ehendrickson/the-thinking-tester-evolved
@sebrose http://cucumber.io
Readable unit test names
• Gives visibility to non-developers
• Allow focus on risk
• Minimise duplication of effort
• Maximise time spent exploring
@sebrose http://cucumber.io
Unvalidated hypothesis
Health Warning
@sebrose http://cucumber.io
Takeaways
Primary purpose of
review is
understandability
Drive reviewfrom the tests
Include non-
developers in
the review
Exclude theauthor(s) from
the review
@sebrose http://cucumber.io
Should testers participate in peer reviews?
Should non-developers participate in peer reviews?
YES!
Seb Rose


Twitter: @sebrose
Blog: http:/cucumber.io/blog
E-mail: seb@cucumber.io http://bddbooks.com
Questions?

More Related Content

More from Seb Rose

Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022Seb Rose
 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Seb Rose
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021Seb Rose
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021Seb Rose
 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021Seb Rose
 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021Seb Rose
 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Seb Rose
 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021Seb Rose
 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020Seb Rose
 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019Seb Rose
 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019Seb Rose
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Seb Rose
 
What is a user story anyway - lightning talk 2018
What is a user story anyway - lightning talk 2018What is a user story anyway - lightning talk 2018
What is a user story anyway - lightning talk 2018Seb Rose
 
Contract testing and Pact
Contract testing and PactContract testing and Pact
Contract testing and PactSeb Rose
 
How long is a piece of string?
How long is a piece of string?How long is a piece of string?
How long is a piece of string?Seb Rose
 
Introduction to BDD - SQUID 2018
Introduction to BDD - SQUID 2018Introduction to BDD - SQUID 2018
Introduction to BDD - SQUID 2018Seb Rose
 
Introduction to BDD - shortened
Introduction to BDD - shortenedIntroduction to BDD - shortened
Introduction to BDD - shortenedSeb Rose
 
Using BDD as a communication tool between the business and technology
Using BDD as a communication tool between the business and technologyUsing BDD as a communication tool between the business and technology
Using BDD as a communication tool between the business and technologySeb Rose
 
Introduction to bdd
Introduction to bddIntroduction to bdd
Introduction to bddSeb Rose
 
Planning poker in a nutshell
Planning poker in a nutshellPlanning poker in a nutshell
Planning poker in a nutshellSeb Rose
 

More from Seb Rose (20)

Example mapping (with builds) - ProductWorld 2022
Example mapping (with builds)  - ProductWorld 2022Example mapping (with builds)  - ProductWorld 2022
Example mapping (with builds) - ProductWorld 2022
 
Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022Example mapping - ProductWorld 2022
Example mapping - ProductWorld 2022
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
 
No code, low code, machine code QA ATL 2021
No code, low code, machine code   QA ATL 2021No code, low code, machine code   QA ATL 2021
No code, low code, machine code QA ATL 2021
 
No code, low code, machine code - Unicom 2021
No code, low code, machine code -  Unicom 2021No code, low code, machine code -  Unicom 2021
No code, low code, machine code - Unicom 2021
 
BDD: from soup to nuts - The Future of Work Scotland 2021
BDD: from soup to nuts  - The Future of Work Scotland 2021BDD: from soup to nuts  - The Future of Work Scotland 2021
BDD: from soup to nuts - The Future of Work Scotland 2021
 
Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020Contrasting test automation and BDD - 2020
Contrasting test automation and BDD - 2020
 
Are BDD and test automation the same thing? Automation Guild 2021
Are BDD and test automation the same thing?   Automation Guild 2021Are BDD and test automation the same thing?   Automation Guild 2021
Are BDD and test automation the same thing? Automation Guild 2021
 
"Our BDDs are broken!" Lean Agile Exchange 2020
"Our BDDs are broken!"   Lean Agile Exchange 2020"Our BDDs are broken!"   Lean Agile Exchange 2020
"Our BDDs are broken!" Lean Agile Exchange 2020
 
User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019User stories: from good intentions to bad advice - Agile Scotland 2019
User stories: from good intentions to bad advice - Agile Scotland 2019
 
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019User stories: from good intentions to bad advice - Lean Agile Scotland 2019
User stories: from good intentions to bad advice - Lean Agile Scotland 2019
 
Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...Software contracts or: how I learned to stop worrying and love releasing. Agi...
Software contracts or: how I learned to stop worrying and love releasing. Agi...
 
What is a user story anyway - lightning talk 2018
What is a user story anyway - lightning talk 2018What is a user story anyway - lightning talk 2018
What is a user story anyway - lightning talk 2018
 
Contract testing and Pact
Contract testing and PactContract testing and Pact
Contract testing and Pact
 
How long is a piece of string?
How long is a piece of string?How long is a piece of string?
How long is a piece of string?
 
Introduction to BDD - SQUID 2018
Introduction to BDD - SQUID 2018Introduction to BDD - SQUID 2018
Introduction to BDD - SQUID 2018
 
Introduction to BDD - shortened
Introduction to BDD - shortenedIntroduction to BDD - shortened
Introduction to BDD - shortened
 
Using BDD as a communication tool between the business and technology
Using BDD as a communication tool between the business and technologyUsing BDD as a communication tool between the business and technology
Using BDD as a communication tool between the business and technology
 
Introduction to bdd
Introduction to bddIntroduction to bdd
Introduction to bdd
 
Planning poker in a nutshell
Planning poker in a nutshellPlanning poker in a nutshell
Planning poker in a nutshell
 

Recently uploaded

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024BookNet Canada
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsPrecisely
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraDeakin University
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentationphoebematthew05
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersThousandEyes
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Neo4j
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxnull - The Open Security Community
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024The Digital Insurer
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...Fwdays
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Mattias Andersson
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsMemoori
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsHyundai Motor Group
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr LapshynFwdays
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsAndrey Dotsenko
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...shyamraj55
 

Recently uploaded (20)

New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
New from BookNet Canada for 2024: BNC BiblioShare - Tech Forum 2024
 
Unlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power SystemsUnlocking the Potential of the Cloud for IBM Power Systems
Unlocking the Potential of the Cloud for IBM Power Systems
 
Artificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning eraArtificial intelligence in the post-deep learning era
Artificial intelligence in the post-deep learning era
 
costume and set research powerpoint presentation
costume and set research powerpoint presentationcostume and set research powerpoint presentation
costume and set research powerpoint presentation
 
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for PartnersEnhancing Worker Digital Experience: A Hands-on Workshop for Partners
Enhancing Worker Digital Experience: A Hands-on Workshop for Partners
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptxVulnerability_Management_GRC_by Sohang Sengupta.pptx
Vulnerability_Management_GRC_by Sohang Sengupta.pptx
 
Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024Build your next Gen AI Breakthrough - April 2024
Build your next Gen AI Breakthrough - April 2024
 
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptxMaking_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
Making_way_through_DLL_hollowing_inspite_of_CFG_by_Debjeet Banerjee.pptx
 
My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024My INSURER PTE LTD - Insurtech Innovation Award 2024
My INSURER PTE LTD - Insurtech Innovation Award 2024
 
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks..."LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
"LLMs for Python Engineers: Advanced Data Analysis and Semantic Kernel",Oleks...
 
Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?Are Multi-Cloud and Serverless Good or Bad?
Are Multi-Cloud and Serverless Good or Bad?
 
AI as an Interface for Commercial Buildings
AI as an Interface for Commercial BuildingsAI as an Interface for Commercial Buildings
AI as an Interface for Commercial Buildings
 
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter RoadsSnow Chain-Integrated Tire for a Safe Drive on Winter Roads
Snow Chain-Integrated Tire for a Safe Drive on Winter Roads
 
My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
"Federated learning: out of reach no matter how close",Oleksandr Lapshyn
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
Automating Business Process via MuleSoft Composer | Bangalore MuleSoft Meetup...
 

Should testers participate in code reviews