SlideShare ist ein Scribd-Unternehmen logo
1 von 43
Yael Zaritsky Perez, Software Developer @ Wix
Software Developers, Communicate
Your Intentions!
(TL;DR: Do it Using Tests)
yaelz@wix.com twitter@zaritskyPe_yael linkedin/yael-zaritsky-perez github.com/yaelz
About
me
00
Wix Engineering
Locations
Ukraine Israel Lithuania
VilniusKiev
Dnipro
Tel-Aviv
Be’er Sheva
Haifa
AGENDA
Communicate? Why?
Communicate? What?
Methods of Communication
Examples
Summary
Communicate?
Why?
01
Communicate
Why?
Robert C. Martin's quote about this
Communicate
Why?
New
FeaturesBugs
Communicate
Why?
We work on existing codebase
Don’t touch what
already works
Communicate
Why?
and need to feel comfortable to touch it
We work on existing codebase
Communicate
Why?
… also, we are not alone
Communicate?
What?
02
Communicate
What?
Libraries, APIs Inner Parts
Methods of
Communication
03
#1Documentation
Methods of
Communication
You don’t have to
change it
Usually outdated
Methods of
Communication
#2Verbal communication
We don’t remember
Not for everyone
No one stays forever
Methods of
Communication
#3Types
Add to the system
Can’t explain edge cases
Can’t tell a story
Methods of
Communication
#4Tests
Already there (?)
Live documentation
Using tests to communicate.
Examples
04
Example #1
Tests can tell a story
describe('Feed’, () => {
it('should render a single blog post’, () => {...})
it('should filter by ...’, () => {...})
})
How quickly can
you understand
this?
it('should render a single blog post', async () => {
nock(baseURL).get('/experts-blog-posts')
.reply(200, [{ title: 'My epic blog post title', id:
13 }])
const { wrapper } = setup({})
const tab = queryByTestId(wrapper, 'feed-tab')
fireEvent.click(tab)
sideNavBarDriver.feedTab().click()
const feedDriver = feedDriverCreator(wrapper)
await expect(
queryByTestId(componentWrapper, `blog-post-
header-13`).textContent)
.toContain(‘My epic blog post title’)
})
it('should render a single blog post', async () => {
nock(baseURL)
.get('/experts-blog-posts')
.reply(200, [{ title: 'My epic blog post title', id: 13 }])
const { wrapper } = setup({})
const tab = queryByTestId(wrapper, 'feed-tab')
fireEvent.click(tab)
await expect(
queryByTestId(componentWrapper, `blog-post-header-13`).textContent)
.toContain(‘My epic blog post title’)
})
Before
it('should render a single blog post', async () => {
nock(baseURL)
.get('/experts-blog-posts')
.reply(200, [{ title: 'My epic blog post title', id: 13 }])
const { wrapper } = setup({})
const tab = queryByTestId(wrapper, 'feed-tab')
fireEvent.click(tab)
await expect(
queryByTestId(componentWrapper, `blog-post-header-13`).textContent)
.toContain(‘My epic blog post title’)
})
Before
Part 1
it('should render a single blog post', async () => {
nock(baseURL)
.get('/experts-blog-posts')
.reply(200, [{ title: 'My epic blog post title', id: 13 }])
const { wrapper } = setup({})
const tab = queryByTestId(wrapper, 'feed-tab')
fireEvent.click(tab)
await expect(
queryByTestId(componentWrapper, `blog-post-header-13`).textContent)
.toContain(‘My epic blog post title’)
})
Before
Part 2
it('should render a single blog post', async () => {
nock(baseURL)
.get('/experts-blog-posts')
.reply(200, [{ title: 'My epic blog post title', id: 13 }])
const { wrapper } = setup({})
const tab = queryByTestId(wrapper, 'feed-tab')
fireEvent.click(tab)
await eventually(async () => {
expect(
queryByTestId(wrapper, ‘blog-post-header-13’).textContent)
.toContain(‘My epic blog post title’)})
})
Before
Part 3
Now,
Let’s Refactor it
it('should render a single blog post on feed', async () => {
nock(baseURL)
.get('/experts-blog-posts')
.reply(200, [{ title: 'My epic blog post title', id: 13 }])
const { wrapper } = setup({})
const tab = queryByTestId(wrapper, 'feed-tab')
fireEvent.click(tab)
await eventually(async () => {
expect(
queryByTestId(wrapper, ‘blog-post-header-13’).textContent)
.toContain(‘My epic blog post title’)})
})
Refactoring...
Refactoring...
nock(baseURL)
.get('/experts-blog-posts')
.reply(200, [{ title: 'My epic blog post title', id: 13 }])
makeBlogPostServerReturn([
{ title: 'My epic blog post
title', id: 13 }
])
Part 1
Refactoring...
const { wrapper } = setup({})
const tab = queryByTestId(wrapper, 'feed-tab')
fireEvent.click(tab)
const { wrapper } = setup({})
const sideNavBarDriver = sideNavBarDriverCreator(wrapper)
sideNavBarDriver.clickOnFeedLink()
Part 2
Refactoring...
Part 3
expect(queryByTestId(wrapper, ‘blog-post-header-13’).textContent)
.toContain(‘My epic blog post title’)
const feedDriver = feedDriverCreator(wrapper)
await expect(feedDriver.getTextForBlogPostHeader(13))
.toContain(‘My epic blog post title’)
it('should render a single blog post', async () => {
const wixBlogPost = createDisplayBlogPostWith({ id, title })
makeBlogPostServerReturn([wixBlogPost])
const { wrapper } = setup({})
const sideNavBarDriver = sideNavBarDriverCreator(wrapper)
sideNavBarDriver.clickOnFeedLink()
const feedDriver = feedDriverCreator(wrapper)
await expect(feedDriver.getTextForBlogPostHeader(id)).toContain(title)
})
Refactoring...
it('should render a single blog post', async () => {
const wixBlogPost = createDisplayBlogPostWith({ id, title })
makeBlogPostServerReturn([wixBlogPost])
const { wrapper } = setup({})
const sideNavBarDriver = sideNavBarDriverCreator(wrapper)
sideNavBarDriver.clickOnFeedLink()
const feedDriver = feedDriverCreator(wrapper)
await expect(feedDriver.getTextForBlogPostHeader(id)).toContain(title)
})
After
Example #2
Breathing Documentation
const getImageUrlsFromImgNames = imageNameArr =>
imageNameArr
.map(imageName => nameToImageUrlMap[imageName])
.filter(imageUrl => imageUrl)
It may seem redundant...
describe('getImageUrlsFromImgNames', () => {
.
.
.
it('should filter out imageNames that don’t exist in map', () => {
imageFilter.initMap({ anImageName: 'http://www.someImageUrl.jpg' })
const imageNameArray = ['imageNameNotInTheMap']
expect(imageFilter.getImageUrlsFromImgNames(imageNameArray)).toEqual([])
})
})
Now it’s clear
Time to
Wrap
05
Using Tests as
Documentation
Worth our time
Live documentation
Tells the story
Explains edge cases
Prevents mistakes
Live documentation
Tells the story
Explains edge cases
Prevents mistakes
Using Tests as
Documentation
Worth our time
Saves
It’s just a state of mind
“Any fool can write code that a computer
can understand. Good programmers write
code that humans can understand.“
-- Martin Fowler
Thank You
yaelz@wix.com twitter@zaritskyPe_yael linkedin/yael-zaritsky-perez github.com/yaelz
Q&A
yaelz@wix.com twitter@zaritskyPe_yael linkedin/yael-zaritsky-perez github.com/yaelz
Sources
Clean Code (pdf)
Software Devs, communicate your intentions (Blog post)
yaelz@wix.com twitter@zaritskyPe_yael linkedin/yael-zaritsky-perez github.com/yaelz

Weitere ähnliche Inhalte

Was ist angesagt?

Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
Rebecca Murphey
 
Appengine Java Night #2a
Appengine Java Night #2aAppengine Java Night #2a
Appengine Java Night #2a
Shinichi Ogawa
 
The report of JavaOne2011 about groovy
The report of JavaOne2011 about groovyThe report of JavaOne2011 about groovy
The report of JavaOne2011 about groovy
Yasuharu Nakano
 
How to close an issue
How to close an issueHow to close an issue
How to close an issue
Avik Das
 

Was ist angesagt? (20)

Taking Objective-C to the next level. UA Mobile 2016.
Taking Objective-C to the next level. UA Mobile 2016.Taking Objective-C to the next level. UA Mobile 2016.
Taking Objective-C to the next level. UA Mobile 2016.
 
Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)Symfony: Your Next Microframework (SymfonyCon 2015)
Symfony: Your Next Microframework (SymfonyCon 2015)
 
JSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than TwilightJSON and Swift, Still A Better Love Story Than Twilight
JSON and Swift, Still A Better Love Story Than Twilight
 
New Symfony Tips & Tricks (SymfonyCon Paris 2015)
New Symfony Tips & Tricks (SymfonyCon Paris 2015)New Symfony Tips & Tricks (SymfonyCon Paris 2015)
New Symfony Tips & Tricks (SymfonyCon Paris 2015)
 
Hooks WCSD12
Hooks WCSD12Hooks WCSD12
Hooks WCSD12
 
Matters of State
Matters of StateMatters of State
Matters of State
 
Dojo Confessions
Dojo ConfessionsDojo Confessions
Dojo Confessions
 
WCLV13 JavaScript
WCLV13 JavaScriptWCLV13 JavaScript
WCLV13 JavaScript
 
Mulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development ToolkitMulberry: A Mobile App Development Toolkit
Mulberry: A Mobile App Development Toolkit
 
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
The Coolest Symfony Components you’ve never heard of - DrupalCon 2017
 
jQuery in 15 minutes
jQuery in 15 minutesjQuery in 15 minutes
jQuery in 15 minutes
 
Building Large jQuery Applications
Building Large jQuery ApplicationsBuilding Large jQuery Applications
Building Large jQuery Applications
 
Appengine Java Night #2a
Appengine Java Night #2aAppengine Java Night #2a
Appengine Java Night #2a
 
CodeIgniter 3.0
CodeIgniter 3.0CodeIgniter 3.0
CodeIgniter 3.0
 
Spiffy Applications With JavaScript
Spiffy Applications With JavaScriptSpiffy Applications With JavaScript
Spiffy Applications With JavaScript
 
Real Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.ioReal Time Communication using Node.js and Socket.io
Real Time Communication using Node.js and Socket.io
 
The report of JavaOne2011 about groovy
The report of JavaOne2011 about groovyThe report of JavaOne2011 about groovy
The report of JavaOne2011 about groovy
 
Launching Beeline with Firebase
Launching Beeline with FirebaseLaunching Beeline with Firebase
Launching Beeline with Firebase
 
How to close an issue
How to close an issueHow to close an issue
How to close an issue
 
Symfony 2
Symfony 2Symfony 2
Symfony 2
 

Ähnlich wie Programmers, communicate your intentions

Mongo db勉強会20110730
Mongo db勉強会20110730Mongo db勉強会20110730
Mongo db勉強会20110730
Akihiro Okuno
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
Stefano Zanetti
 
Tips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applicationsTips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applications
Tim Cull
 

Ähnlich wie Programmers, communicate your intentions (20)

Vue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue routerVue routing tutorial getting started with vue router
Vue routing tutorial getting started with vue router
 
QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"
QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"
QA Lab: тестирование ПО. Яков Крамаренко: "KISS Automation"
 
reactjs-quiz..docs.pdf
reactjs-quiz..docs.pdfreactjs-quiz..docs.pdf
reactjs-quiz..docs.pdf
 
React outbox
React outboxReact outbox
React outbox
 
Declarative UIs with Jetpack Compose
Declarative UIs with Jetpack ComposeDeclarative UIs with Jetpack Compose
Declarative UIs with Jetpack Compose
 
Front End Development: The Important Parts
Front End Development: The Important PartsFront End Development: The Important Parts
Front End Development: The Important Parts
 
Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)Prompt engineering for iOS developers (How LLMs and GenAI work)
Prompt engineering for iOS developers (How LLMs and GenAI work)
 
Using WordPress as your application stack
Using WordPress as your application stackUsing WordPress as your application stack
Using WordPress as your application stack
 
Mongo db勉強会20110730
Mongo db勉強会20110730Mongo db勉強会20110730
Mongo db勉強会20110730
 
Implicit parameters, when to use them (or not)!
Implicit parameters, when to use them (or not)!Implicit parameters, when to use them (or not)!
Implicit parameters, when to use them (or not)!
 
iOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful BackendiOS App with Parse.com as RESTful Backend
iOS App with Parse.com as RESTful Backend
 
How to build to do app using vue composition api and vuex 4 with typescript
How to build to do app using vue composition api and vuex 4 with typescriptHow to build to do app using vue composition api and vuex 4 with typescript
How to build to do app using vue composition api and vuex 4 with typescript
 
WordPress as the Backbone(.js)
WordPress as the Backbone(.js)WordPress as the Backbone(.js)
WordPress as the Backbone(.js)
 
Rails GUI Development with Ext JS
Rails GUI Development with Ext JSRails GUI Development with Ext JS
Rails GUI Development with Ext JS
 
Page object from the ground up.ppt
Page object from the ground up.pptPage object from the ground up.ppt
Page object from the ground up.ppt
 
Page object from the ground up by Joe Beale
Page object from the ground up by Joe BealePage object from the ground up by Joe Beale
Page object from the ground up by Joe Beale
 
How to build twitter bot using golang from scratch
How to build twitter bot using golang from scratchHow to build twitter bot using golang from scratch
How to build twitter bot using golang from scratch
 
Tips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applicationsTips and tricks for building api heavy ruby on rails applications
Tips and tricks for building api heavy ruby on rails applications
 
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
Test-driven Development with Drupal and Codeception (DrupalCamp Brighton)
 
Building Potent WordPress Websites
Building Potent WordPress WebsitesBuilding Potent WordPress Websites
Building Potent WordPress Websites
 

Kürzlich hochgeladen

FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
dollysharma2066
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
amitlee9823
 

Kürzlich hochgeladen (20)

Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024Water Industry Process Automation & Control Monthly - April 2024
Water Industry Process Automation & Control Monthly - April 2024
 
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
FULL ENJOY Call Girls In Mahipalpur Delhi Contact Us 8377877756
 
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort ServiceCall Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
Call Girls in Netaji Nagar, Delhi 💯 Call Us 🔝9953056974 🔝 Escort Service
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
(INDIRA) Call Girl Meerut Call Now 8617697112 Meerut Escorts 24x7
 
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Palanpur 7001035870 Whatsapp Number, 24/07 Booking
 
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Ankleshwar 7001035870 Whatsapp Number, 24/07 Booking
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
KubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghlyKubeKraft presentation @CloudNativeHooghly
KubeKraft presentation @CloudNativeHooghly
 
Generative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPTGenerative AI or GenAI technology based PPT
Generative AI or GenAI technology based PPT
 
Unit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdfUnit 1 - Soil Classification and Compaction.pdf
Unit 1 - Soil Classification and Compaction.pdf
 
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night StandCall Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
Call Girls In Bangalore ☎ 7737669865 🥵 Book Your One night Stand
 
Unleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leapUnleashing the Power of the SORA AI lastest leap
Unleashing the Power of the SORA AI lastest leap
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
VIP Model Call Girls Kothrud ( Pune ) Call ON 8005736733 Starting From 5K to ...
 
Double Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torqueDouble Revolving field theory-how the rotor develops torque
Double Revolving field theory-how the rotor develops torque
 

Programmers, communicate your intentions