SlideShare a Scribd company logo
Is It Handmade Code If You Use Power Tools?




                                Photo by matsbeads on Etsy



               Laura Beth Denker (@elblinkin)
Is It Handmade Code If You Use Power Tools?




               In the beginning...



•Deployments happened weekly
•Development happened on branches
•Release Manager role rotations


      efo re
  B
Is It Handmade Code If You Use Power Tools?




                       Deployinator


•One button deployment
•Eliminated painful weekly deploys
 • Deployments went up to a handful a day
•Eliminated release manager role rotations
 • If you committed code, it was your responsibility to push the button


        efo re
    B
Is It Handmade Code If You Use Power Tools?




    Voila! Continuous Deployment



•Buy-in
•One-button deployment process (NO fear!*)
•Monitoring and graphs


       * NO fear in the deploy process, but still some healthy fear in the code changes
Is It Handmade Code If You Use Power Tools?




“Confidence is contagious; so is lack of
confidence.”
                                              Vince Lombardi
Is It Handmade Code If You Use Power Tools?




                             Buildbot
•Developer written and maintained CI System
 • Resulted in Test Infrastructure being convoluted with site architecture
 • Test infrastructure was untested
•Tests written in Python
 • But we’re a PHP shop
•Slow and resource intensive
 • Could not run on a developer VM
•Non-deterministic failures
 • Flaky tests
 • Assertions in helpers
 • EC2 connectivity issues
Is It Handmade Code If You Use Power Tools?




              (Hudson) Jenkins CI

•Open source
•High community involvement
•Highly configurable
•Numerous plugins
•Eliminated the pitfalls of developer written and
 maintained CI
             21
      J u ne
Is It Handmade Code If You Use Power Tools?




                PyUnit to PHPUnit


•~1,500 tests moved to our lingua franca
•~3 minutes to run new PHPUnit tests
•Eliminated context-switching between
 languages


                ly 19
           Ju
Is It Handmade Code If You Use Power Tools?




                       Commit Mutex
1. Commit code to trunk (maybe merge a development branch into trunk)
2. Wait for Buildbot (and Jenkins) to tests
  a. If tests PASS, continue to Deployinator and begin deployment
  b. If tests FAIL, kick Buildbot (and Jenkins) because it might be a flake,
    then do any of the following
    i. Repeat step (b) until it passes
    ii. Debug failures and begin fixing trunk
    iii. Rollback

 Note: While there are committed changes in trunk that have not been
 deployed, DO NOT COMMIT
Is It Handmade Code If You Use Power Tools?




     Why is there a Commit Mutex?



1.Branch development
2.Tests cannot run in a timely fashion on the
 developer VMs
Is It Handmade Code If You Use Power Tools?




                      Try Server v.1
•Jenkins parameterized build + shell script
 •Parameters
  • username
  • patch file
 •Shell script
  • Create a patch file
  • Create the JSON
  • Send a request to Jenkins via cURL
•Branches NOT SUPPORTED
•Eliminated the Commit Mutex
Is It Handmade Code If You Use Power Tools?




               g us t 19
          Au
Is It Handmade Code If You Use Power Tools?




                   Try Server v.1.1

•Jenkins parameterized build + PHP script
 •Parameters
  • username
  • patch file
 •PHP script
  • Support for creating git-svn patches
  • Support for dry runs
  • Support for uploading manually created patches
Is It Handmade Code If You Use Power Tools?




               Test Classification



•Unit
•Integration
•Functional (System)
Is It Handmade Code If You Use Power Tools?




                  Test Classification



•Functional (System)
 • Provides confidence that a particular use case works
• Unit
• Integration
Is It Handmade Code If You Use Power Tools?

       Legacy CI System is Dead!




                          er 15
                 pte mb
            Se
Is It Handmade Code If You Use Power Tools?




                        Test Classification


• Functional (System)
•Integration
 • Tests interaction between a discrete number of components
   • A set of interacting classes
   • Interaction with an external service
• Unit
Is It Handmade Code If You Use Power Tools?




                           Test Classification
• Functional (System)
• Integration
•Unit
 • Fast
 • Deterministic
   •   NO   database
   •   NO   file system
   •   NO   network
   •   NO   threading, forking processes
   •   NO   sleep
   •   NO   time dependencies
 • Tests a single object
   • Best way to obtain line coverage
   • Reduces debug time
Is It Handmade Code If You Use Power Tools?




               PHPUnit @group



•@group to declare external dependencies
•PHPUnit XML Configuration
•Jenkins Project for each configuration

                            er 21
                  Oc to b
Is It Handmade Code If You Use Power Tools?




                 PHPUnit @group




@group cache
for tests that use memcache or another cache




                              er 21
                    Oc to b
Is It Handmade Code If You Use Power Tools?




                  PHPUnit @group




@group database
for tests that use a database like postgres or mysql




                                er 21
                      Oc to b
Is It Handmade Code If You Use Power Tools?




                   PHPUnit @group




@group network
for tests that talk to external services (in-house or 3rd party)




                                er 21
                      Oc to b
Is It Handmade Code If You Use Power Tools?




                   PHPUnit @group




@group sleep
for tests that call a sleep() function




                                 er 21
                       Oc to b
Is It Handmade Code If You Use Power Tools?




                  PHPUnit @group




@group time
for tests that depend on the time of day or day of the year, etc.




                                er 21
                      Oc to b
Is It Handmade Code If You Use Power Tools?




                  PHPUnit @group



@group smoke
for tests that execute cURL and regex based tests against an instance of
the web service under test




                               er 21
                     Oc to b
Is It Handmade Code If You Use Power Tools?




                  PHPUnit @group




@group flaky
for tests that fail without code changes




                                er 21
                      Oc to b
Is It Handmade Code If You Use Power Tools?




              PHPUnit @group




       There is NO @group for unit tests.




                           er 21
                 Oc to b
Is It Handmade Code If You Use Power Tools?




               PHPUnit @group



•@group to declare external dependencies
•PHPUnit XML Configuration
•Jenkins Project for each configuration

                            er 21
                  Oc to b
Is It Handmade Code If You Use Power Tools?




                 40 Deploys in a Day


•November 18th, 2010
 • <5 months after first dedicated Test & Automation engineer
 • <3 months after releasing Try Server
 • 1 week before Thanksgiving freeze
•34 deploys the day after
                                   ber
                            No ve m !
                                   !!
                                18
Is It Handmade Code If You Use Power Tools?




   How do we keep the momentum?

•The tests ported to PHPUnit are flaky
 • Re-building intermittent failures is wasting time in the push queue
•We are hiring more engineers
 • We need to deploy as fast, if not faster
•We are writing more tests
 • More tests can take more time, so we need to write faster tests
 • Started at 1,500 tests, now running >7,000 tests
                                   ber !
                                 Cy y !
                                Mo n da
Is It Handmade Code If You Use Power Tools?




                  Random Data BAD


•Fixtures Framework
 •Written and maintained by developers
 •Original intent
  • Generate data to run test instance of the website
 •Unexpected usage
  • Flaky and hard to debug integration tests posing as unit tests
Is It Handmade Code If You Use Power Tools?




       DBUnit for Multiple Databases

•Shard-ed database architecture
•Our ORM talks to multiple databases
 • At least the index and a shard
•PHPUnit_Extensions_Database_MultipleDatab
 ases
•Increased clarity in old tests ported to PHPUnit
 • Data explicitly specified in YAML, not at random
 • Developer needs to know what databases 8test will touch
                                            ra
                                     em be
                              De c
Is It Handmade Code If You Use Power Tools?




    Worth Mentioning: Try Server v.2


•Master try project in Jenkins
 • PHP Script executed in Jenkins shell builder
 • Started all sub-projects over cURL
 • Pinged all sub-projects for status
 • Used Jenkins Text Finder plugin to toggle project state
 • Sent a unified result e-mail
•Eliminated problems finding test results
                                       be r8
                              De cem
Is It Handmade Code If You Use Power Tools?



 Worth Mentioning: Try Server v.2




                                be r8
                       De cem
Is It Handmade Code If You Use Power Tools?




                       Why to mock?


unit tests
test the functionality of a single method in a single object with the
expectations of the collaborating objects


test case
as a suitcase contains suits, a test case contains tests
Is It Handmade Code If You Use Power Tools?




              PHPUnit Mock Helpers
           Making it easier to create mocks,
         should support writing more unit tests

• Tweaking prod code
• Writing short, tested helpers for internal types
• PHPUnit_Extensions_MockObject_Stub_ReturnMapping
  • UPDATE: Now in PHPUnit as $this->returnValueMap()

• Still more to do...
                                        ry 31
                               Ja nua
Is It Handmade Code If You Use Power Tools?




            PHPUnit Extensions




             Open-sourced on Github



                                            ry 27
                                Fe b r ua
Is It Handmade Code If You Use Power Tools?




                 Try Server v.3




           Jenkins Master Project Plugin
                    Try’d out on Try Server




                                              ch 24
                                         M ar
Is It Handmade Code If You Use Power Tools?




                        Pake




        Now test locally, just like Jenkins!




                                         Ap ril 5
Is It Handmade Code If You Use Power Tools?




    Deployinator Info in Jenkins!

            Jenkins Master Project Plugin
                            Just like Try
             Jenkins Deployinator Plugin
                       Special CLI Command


     ONE Jenkins job per deployment stage
  Previously, ~15 Jobs that were difficult to correlate with a push



                                                      pr il 9
                                                  A
Is It Handmade Code If You Use Power Tools?




           On the Big Monitors!
Is It Handmade Code If You Use Power Tools?




             Still More to Come...


•Flaky test resolution
•More focused DBUnit Tests
•Make pure unit testing even easier

•Try to solve whatever comes next...
                                                   on d !!
                                                Bey
Is It Handmade Code If You Use Power Tools?




                      References
Code As Craft
  http://codeascraft.etsy.com/
Deployinator
  http://codeascraft.etsy.com/2010/05/20/quantum-of-deployment/
Divide and Concur
  http://codeascraft.etsy.com/2011/04/20/divide-and-concur/
Etsy PHPUnit Extensions
  https://github.com/etsy/phpunit-extensions
Jenkins CI
  http://jenkins-ci.org/
PHPUnit
  https://github.com/sebastianbergmann/phpunit/
Is It Handmade Code If You Use Power Tools?




                Wardrobe Furnished By

Spring Daisies Short Patchwork Dress
http://www.etsy.com/shop/pineapplepop of Nashville, TN


Asymmetric Flower and Beads Necklace (Silver)
Created by Michelle D’Netto, Software Engineer @ Etsy


Knitted DROPS Bolero with Lace Pattern
http://www.garnstudio.com/lang/en/visoppskrift.php?d_nr=127&d_id=24
Design by DROPS Design                    Kni t
                                      bu t        te
Knitted by Laura Beth Denker                a l as d at t h
                                                  ,         e
                                           f o r i t wa s C o n f,
                                                 the       t
                                                     dre s o o d a r k
                                                          s :-(
Is It Handmade Code If You Use Power Tools?




  Our software is artisanally crafted using the
ancient techniques from the 1960s. All releases
are aged in a handmade filled cave for at least
   20 minutes before decanting to the Web.
                                               --Noah Sussman
Ad

Recommended

ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
ProbeDroid - Crafting Your Own Dynamic Instrument Tool on Android for App Beh...
ZongXian Shen
 
DevOps - Boldly Go for Distro
DevOps - Boldly Go for Distro
Paul Boos
 
(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis
(CISC 2013) Real-Time Record and Replay on Android for Malware Analysis
ZongXian Shen
 
Testability for developers – Fighting a mess by making it testable
Testability for developers – Fighting a mess by making it testable
Alexander Tarlinder
 
Software testing: an introduction - 2017
Software testing: an introduction - 2017
XavierDevroey
 
Continuous Delivery Overview
Continuous Delivery Overview
Will Iverson
 
PuppetConf 2016: Implementing Puppet within a Complex Enterprise – Jerry Caup...
PuppetConf 2016: Implementing Puppet within a Complex Enterprise – Jerry Caup...
Puppet
 
Erlang plus BDB: Disrupting the Conventional Web Wisdom
Erlang plus BDB: Disrupting the Conventional Web Wisdom
guest3933de
 
Kku2011
Kku2011
ทวิร พานิชสมบัติ
 
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Raffi Khatchadourian
 
QTP Automation Testing Tutorial 6
QTP Automation Testing Tutorial 6
Akash Tyagi
 
Phosphor: Illuminating Dynamic Data Flow in Commodity JVMs
Phosphor: Illuminating Dynamic Data Flow in Commodity JVMs
jon_bell
 
Automatic testing in DevOps
Automatic testing in DevOps
Benoit Baudry
 
Continuous Testing
Continuous Testing
jaredrrichardson
 
PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet
PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet
Puppet
 
Craftsmanship Workshop: Coding Kata
Craftsmanship Workshop: Coding Kata
Michael Ibarra
 
Need forbuildspeed agile2012
Need forbuildspeed agile2012
drewz lin
 
Performance Analysis of Idle Programs
Performance Analysis of Idle Programs
greenwop
 
ProspectusPresentationPrinterFriendly
ProspectusPresentationPrinterFriendly
martijnetje
 
Master class in Java in 2018
Master class in Java in 2018
Miro Cupak
 
Master class in modern Java
Master class in modern Java
Miro Cupak
 
Master class in modern Java
Master class in modern Java
Miro Cupak
 
Autom editor video blooper recognition and localization for automatic monolo...
Autom editor video blooper recognition and localization for automatic monolo...
Carlos Toxtli
 
Reverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android apps
Gaurav Lochan
 
Continuous Automated Regression Testing to the Rescue
Continuous Automated Regression Testing to the Rescue
TechWell
 
PushToTest TestMaker 6.5 Open Source Test Design Document
PushToTest TestMaker 6.5 Open Source Test Design Document
Clever Moe
 
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Michael Zhang
 
Reproducibility in artificial intelligence
Reproducibility in artificial intelligence
Carlos Toxtli
 
Building a Cloud-based Social Network with Zend Framework and Doctrine 2
Building a Cloud-based Social Network with Zend Framework and Doctrine 2
Mayflower GmbH
 
Write php deploy everywhere tek11
Write php deploy everywhere tek11
Michelangelo van Dam
 

More Related Content

What's hot (20)

Kku2011
Kku2011
ทวิร พานิชสมบัติ
 
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Raffi Khatchadourian
 
QTP Automation Testing Tutorial 6
QTP Automation Testing Tutorial 6
Akash Tyagi
 
Phosphor: Illuminating Dynamic Data Flow in Commodity JVMs
Phosphor: Illuminating Dynamic Data Flow in Commodity JVMs
jon_bell
 
Automatic testing in DevOps
Automatic testing in DevOps
Benoit Baudry
 
Continuous Testing
Continuous Testing
jaredrrichardson
 
PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet
PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet
Puppet
 
Craftsmanship Workshop: Coding Kata
Craftsmanship Workshop: Coding Kata
Michael Ibarra
 
Need forbuildspeed agile2012
Need forbuildspeed agile2012
drewz lin
 
Performance Analysis of Idle Programs
Performance Analysis of Idle Programs
greenwop
 
ProspectusPresentationPrinterFriendly
ProspectusPresentationPrinterFriendly
martijnetje
 
Master class in Java in 2018
Master class in Java in 2018
Miro Cupak
 
Master class in modern Java
Master class in modern Java
Miro Cupak
 
Master class in modern Java
Master class in modern Java
Miro Cupak
 
Autom editor video blooper recognition and localization for automatic monolo...
Autom editor video blooper recognition and localization for automatic monolo...
Carlos Toxtli
 
Reverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android apps
Gaurav Lochan
 
Continuous Automated Regression Testing to the Rescue
Continuous Automated Regression Testing to the Rescue
TechWell
 
PushToTest TestMaker 6.5 Open Source Test Design Document
PushToTest TestMaker 6.5 Open Source Test Design Document
Clever Moe
 
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Michael Zhang
 
Reproducibility in artificial intelligence
Reproducibility in artificial intelligence
Carlos Toxtli
 
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Actor Concurrency Bugs: A Comprehensive Study on Symptoms, Root Causes, API U...
Raffi Khatchadourian
 
QTP Automation Testing Tutorial 6
QTP Automation Testing Tutorial 6
Akash Tyagi
 
Phosphor: Illuminating Dynamic Data Flow in Commodity JVMs
Phosphor: Illuminating Dynamic Data Flow in Commodity JVMs
jon_bell
 
Automatic testing in DevOps
Automatic testing in DevOps
Benoit Baudry
 
PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet
PuppetConf 2016: The Future of Testing Puppet Code – Gareth Rushgrove, Puppet
Puppet
 
Craftsmanship Workshop: Coding Kata
Craftsmanship Workshop: Coding Kata
Michael Ibarra
 
Need forbuildspeed agile2012
Need forbuildspeed agile2012
drewz lin
 
Performance Analysis of Idle Programs
Performance Analysis of Idle Programs
greenwop
 
ProspectusPresentationPrinterFriendly
ProspectusPresentationPrinterFriendly
martijnetje
 
Master class in Java in 2018
Master class in Java in 2018
Miro Cupak
 
Master class in modern Java
Master class in modern Java
Miro Cupak
 
Master class in modern Java
Master class in modern Java
Miro Cupak
 
Autom editor video blooper recognition and localization for automatic monolo...
Autom editor video blooper recognition and localization for automatic monolo...
Carlos Toxtli
 
Reverse engineering and instrumentation of android apps
Reverse engineering and instrumentation of android apps
Gaurav Lochan
 
Continuous Automated Regression Testing to the Rescue
Continuous Automated Regression Testing to the Rescue
TechWell
 
PushToTest TestMaker 6.5 Open Source Test Design Document
PushToTest TestMaker 6.5 Open Source Test Design Document
Clever Moe
 
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Q con shanghai2013-[黄舒泉]-[intel it openstack practice]
Michael Zhang
 
Reproducibility in artificial intelligence
Reproducibility in artificial intelligence
Carlos Toxtli
 

Viewers also liked (10)

Building a Cloud-based Social Network with Zend Framework and Doctrine 2
Building a Cloud-based Social Network with Zend Framework and Doctrine 2
Mayflower GmbH
 
Write php deploy everywhere tek11
Write php deploy everywhere tek11
Michelangelo van Dam
 
Misguided manager
Misguided manager
Zoe Slattery
 
PHP Days 2011 - Keynote: Microsoft WebMatrix
PHP Days 2011 - Keynote: Microsoft WebMatrix
pietrobr
 
How to create social apps for millions of users
How to create social apps for millions of users
Bastian Hofmann
 
Hybrid Cloud PHPUK2012
Hybrid Cloud PHPUK2012
Combell NV
 
2012 Confoo: Changing the Face of Identity in Ecommerce
2012 Confoo: Changing the Face of Identity in Ecommerce
Jonathan LeBlanc
 
Mashing up JavaScript
Mashing up JavaScript
Bastian Hofmann
 
23k guestbooks mix
23k guestbooks mix
Waleed Ahmad
 
Modern PHP
Modern PHP
Changwan Jun
 
Building a Cloud-based Social Network with Zend Framework and Doctrine 2
Building a Cloud-based Social Network with Zend Framework and Doctrine 2
Mayflower GmbH
 
PHP Days 2011 - Keynote: Microsoft WebMatrix
PHP Days 2011 - Keynote: Microsoft WebMatrix
pietrobr
 
How to create social apps for millions of users
How to create social apps for millions of users
Bastian Hofmann
 
Hybrid Cloud PHPUK2012
Hybrid Cloud PHPUK2012
Combell NV
 
2012 Confoo: Changing the Face of Identity in Ecommerce
2012 Confoo: Changing the Face of Identity in Ecommerce
Jonathan LeBlanc
 
23k guestbooks mix
23k guestbooks mix
Waleed Ahmad
 
Ad

Similar to Php com con-2011 (20)

Continuous Integration In Php
Continuous Integration In Php
Wilco Jansen
 
Tool up your lamp stack
Tool up your lamp stack
AgileOnTheBeach
 
Tool Up Your LAMP Stack
Tool Up Your LAMP Stack
Lorna Mitchell
 
Taming the Deployment Beast
Taming the Deployment Beast
Chris Cornutt
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
DECK36
 
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
manssandstrom
 
Automated testing DrupalCamp in Asheville
Automated testing DrupalCamp in Asheville
Promet Source
 
The Journey Towards Continuous Integration
The Journey Towards Continuous Integration
Sebastian Marek
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CI
wajrcs
 
Test Automation
Test Automation
Rodrigo Paiva
 
Your code are my tests
Your code are my tests
Michelangelo van Dam
 
Automated tests
Automated tests
Damian Sromek
 
Continuous Integration Step-by-step
Continuous Integration Step-by-step
Michelangelo van Dam
 
Test
Test
Eddie Kao
 
Development workflow
Development workflow
Sigsiu.NET
 
Development tools
Development tools
Robert Deutz
 
Unit Testing Your Application
Unit Testing Your Application
Paladin Web Services
 
PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.
Francesco Fullone
 
PHPUnit from a developer's perspective
PHPUnit from a developer's perspective
Tushar Joshi
 
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
MoonTechnolabsPvtLtd
 
Continuous Integration In Php
Continuous Integration In Php
Wilco Jansen
 
Tool Up Your LAMP Stack
Tool Up Your LAMP Stack
Lorna Mitchell
 
Taming the Deployment Beast
Taming the Deployment Beast
Chris Cornutt
 
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
Effizientere WordPress-Plugin-Entwicklung mit Softwaretests
DECK36
 
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
Att lyckas med integration av arbetet från flera scrum team - Christophe Acho...
manssandstrom
 
Automated testing DrupalCamp in Asheville
Automated testing DrupalCamp in Asheville
Promet Source
 
The Journey Towards Continuous Integration
The Journey Towards Continuous Integration
Sebastian Marek
 
Continuous Delivery - Automate & Build Better Software with Travis CI
Continuous Delivery - Automate & Build Better Software with Travis CI
wajrcs
 
Continuous Integration Step-by-step
Continuous Integration Step-by-step
Michelangelo van Dam
 
Development workflow
Development workflow
Sigsiu.NET
 
PHP 4? OMG! A small vademecum for obsolete software migration.
PHP 4? OMG! A small vademecum for obsolete software migration.
Francesco Fullone
 
PHPUnit from a developer's perspective
PHPUnit from a developer's perspective
Tushar Joshi
 
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
Top 8 Powerful Tools Developers Use for Laravel Web Development.pdf
MoonTechnolabsPvtLtd
 
Ad

More from LB Denker (8)

Testing and DevOps Culture: Lessons Learned
Testing and DevOps Culture: Lessons Learned
LB Denker
 
Php|tek '12 It's More Than Just Style
Php|tek '12 It's More Than Just Style
LB Denker
 
Developer testing 201: When to Mock and When to Integrate
Developer testing 201: When to Mock and When to Integrate
LB Denker
 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing Fanatic
LB Denker
 
phpDay 2012: Scaling Communication via Continuous Integration
phpDay 2012: Scaling Communication via Continuous Integration
LB Denker
 
QC Merge 2012: Growing community
QC Merge 2012: Growing community
LB Denker
 
PHP UK Conference 2012: Scaling Communication via Continuous Integration
PHP UK Conference 2012: Scaling Communication via Continuous Integration
LB Denker
 
Are Your Tests Really Helping You?
Are Your Tests Really Helping You?
LB Denker
 
Testing and DevOps Culture: Lessons Learned
Testing and DevOps Culture: Lessons Learned
LB Denker
 
Php|tek '12 It's More Than Just Style
Php|tek '12 It's More Than Just Style
LB Denker
 
Developer testing 201: When to Mock and When to Integrate
Developer testing 201: When to Mock and When to Integrate
LB Denker
 
Developer testing 101: Become a Testing Fanatic
Developer testing 101: Become a Testing Fanatic
LB Denker
 
phpDay 2012: Scaling Communication via Continuous Integration
phpDay 2012: Scaling Communication via Continuous Integration
LB Denker
 
QC Merge 2012: Growing community
QC Merge 2012: Growing community
LB Denker
 
PHP UK Conference 2012: Scaling Communication via Continuous Integration
PHP UK Conference 2012: Scaling Communication via Continuous Integration
LB Denker
 
Are Your Tests Really Helping You?
Are Your Tests Really Helping You?
LB Denker
 

Recently uploaded (20)

Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
Precisely
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 
Mastering AI Workflows with FME - Peak of Data & AI 2025
Mastering AI Workflows with FME - Peak of Data & AI 2025
Safe Software
 
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
FME for Distribution & Transmission Integrity Management Program (DIMP & TIMP)
Safe Software
 
AI VIDEO MAGAZINE - June 2025 - r/aivideo
AI VIDEO MAGAZINE - June 2025 - r/aivideo
1pcity Studios, Inc
 
Enabling BIM / GIS integrations with Other Systems with FME
Enabling BIM / GIS integrations with Other Systems with FME
Safe Software
 
The State of Web3 Industry- Industry Report
The State of Web3 Industry- Industry Report
Liveplex
 
Edge-banding-machines-edgeteq-s-200-en-.pdf
Edge-banding-machines-edgeteq-s-200-en-.pdf
AmirStern2
 
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik - Passionate Tech Enthusiast
Raman Bhaumik
 
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
No-Code Workflows for CAD & 3D Data: Scaling AI-Driven Infrastructure
Safe Software
 
June Patch Tuesday
June Patch Tuesday
Ivanti
 
Providing an OGC API Processes REST Interface for FME Flow
Providing an OGC API Processes REST Interface for FME Flow
Safe Software
 
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Seminar: Authentication for a Billion Consumers - Amazon.pptx
FIDO Alliance
 
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
AudGram Review: Build Visually Appealing, AI-Enhanced Audiograms to Engage Yo...
SOFTTECHHUB
 
Down the Rabbit Hole – Solving 5 Training Roadblocks
Down the Rabbit Hole – Solving 5 Training Roadblocks
Rustici Software
 
Crypto Super 500 - 14th Report - June2025.pdf
Crypto Super 500 - 14th Report - June2025.pdf
Stephen Perrenod
 
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Seminar: New Data: Passkey Adoption in the Workforce.pptx
FIDO Alliance
 
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
“Why It’s Critical to Have an Integrated Development Methodology for Edge AI,...
Edge AI and Vision Alliance
 
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Integration of Utility Data into 3D BIM Models Using a 3D Solids Modeling Wor...
Safe Software
 
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
SAP Modernization Strategies for a Successful S/4HANA Journey.pdf
Precisely
 
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
ENERGY CONSUMPTION CALCULATION IN ENERGY-EFFICIENT AIR CONDITIONER.pdf
Muhammad Rizwan Akram
 
Data Validation and System Interoperability
Data Validation and System Interoperability
Safe Software
 

Php com con-2011

  • 1. Is It Handmade Code If You Use Power Tools? Photo by matsbeads on Etsy Laura Beth Denker (@elblinkin)
  • 2. Is It Handmade Code If You Use Power Tools? In the beginning... •Deployments happened weekly •Development happened on branches •Release Manager role rotations efo re B
  • 3. Is It Handmade Code If You Use Power Tools? Deployinator •One button deployment •Eliminated painful weekly deploys • Deployments went up to a handful a day •Eliminated release manager role rotations • If you committed code, it was your responsibility to push the button efo re B
  • 4. Is It Handmade Code If You Use Power Tools? Voila! Continuous Deployment •Buy-in •One-button deployment process (NO fear!*) •Monitoring and graphs * NO fear in the deploy process, but still some healthy fear in the code changes
  • 5. Is It Handmade Code If You Use Power Tools? “Confidence is contagious; so is lack of confidence.” Vince Lombardi
  • 6. Is It Handmade Code If You Use Power Tools? Buildbot •Developer written and maintained CI System • Resulted in Test Infrastructure being convoluted with site architecture • Test infrastructure was untested •Tests written in Python • But we’re a PHP shop •Slow and resource intensive • Could not run on a developer VM •Non-deterministic failures • Flaky tests • Assertions in helpers • EC2 connectivity issues
  • 7. Is It Handmade Code If You Use Power Tools? (Hudson) Jenkins CI •Open source •High community involvement •Highly configurable •Numerous plugins •Eliminated the pitfalls of developer written and maintained CI 21 J u ne
  • 8. Is It Handmade Code If You Use Power Tools? PyUnit to PHPUnit •~1,500 tests moved to our lingua franca •~3 minutes to run new PHPUnit tests •Eliminated context-switching between languages ly 19 Ju
  • 9. Is It Handmade Code If You Use Power Tools? Commit Mutex 1. Commit code to trunk (maybe merge a development branch into trunk) 2. Wait for Buildbot (and Jenkins) to tests a. If tests PASS, continue to Deployinator and begin deployment b. If tests FAIL, kick Buildbot (and Jenkins) because it might be a flake, then do any of the following i. Repeat step (b) until it passes ii. Debug failures and begin fixing trunk iii. Rollback Note: While there are committed changes in trunk that have not been deployed, DO NOT COMMIT
  • 10. Is It Handmade Code If You Use Power Tools? Why is there a Commit Mutex? 1.Branch development 2.Tests cannot run in a timely fashion on the developer VMs
  • 11. Is It Handmade Code If You Use Power Tools? Try Server v.1 •Jenkins parameterized build + shell script •Parameters • username • patch file •Shell script • Create a patch file • Create the JSON • Send a request to Jenkins via cURL •Branches NOT SUPPORTED •Eliminated the Commit Mutex
  • 12. Is It Handmade Code If You Use Power Tools? g us t 19 Au
  • 13. Is It Handmade Code If You Use Power Tools? Try Server v.1.1 •Jenkins parameterized build + PHP script •Parameters • username • patch file •PHP script • Support for creating git-svn patches • Support for dry runs • Support for uploading manually created patches
  • 14. Is It Handmade Code If You Use Power Tools? Test Classification •Unit •Integration •Functional (System)
  • 15. Is It Handmade Code If You Use Power Tools? Test Classification •Functional (System) • Provides confidence that a particular use case works • Unit • Integration
  • 16. Is It Handmade Code If You Use Power Tools? Legacy CI System is Dead! er 15 pte mb Se
  • 17. Is It Handmade Code If You Use Power Tools? Test Classification • Functional (System) •Integration • Tests interaction between a discrete number of components • A set of interacting classes • Interaction with an external service • Unit
  • 18. Is It Handmade Code If You Use Power Tools? Test Classification • Functional (System) • Integration •Unit • Fast • Deterministic • NO database • NO file system • NO network • NO threading, forking processes • NO sleep • NO time dependencies • Tests a single object • Best way to obtain line coverage • Reduces debug time
  • 19. Is It Handmade Code If You Use Power Tools? PHPUnit @group •@group to declare external dependencies •PHPUnit XML Configuration •Jenkins Project for each configuration er 21 Oc to b
  • 20. Is It Handmade Code If You Use Power Tools? PHPUnit @group @group cache for tests that use memcache or another cache er 21 Oc to b
  • 21. Is It Handmade Code If You Use Power Tools? PHPUnit @group @group database for tests that use a database like postgres or mysql er 21 Oc to b
  • 22. Is It Handmade Code If You Use Power Tools? PHPUnit @group @group network for tests that talk to external services (in-house or 3rd party) er 21 Oc to b
  • 23. Is It Handmade Code If You Use Power Tools? PHPUnit @group @group sleep for tests that call a sleep() function er 21 Oc to b
  • 24. Is It Handmade Code If You Use Power Tools? PHPUnit @group @group time for tests that depend on the time of day or day of the year, etc. er 21 Oc to b
  • 25. Is It Handmade Code If You Use Power Tools? PHPUnit @group @group smoke for tests that execute cURL and regex based tests against an instance of the web service under test er 21 Oc to b
  • 26. Is It Handmade Code If You Use Power Tools? PHPUnit @group @group flaky for tests that fail without code changes er 21 Oc to b
  • 27. Is It Handmade Code If You Use Power Tools? PHPUnit @group There is NO @group for unit tests. er 21 Oc to b
  • 28. Is It Handmade Code If You Use Power Tools? PHPUnit @group •@group to declare external dependencies •PHPUnit XML Configuration •Jenkins Project for each configuration er 21 Oc to b
  • 29. Is It Handmade Code If You Use Power Tools? 40 Deploys in a Day •November 18th, 2010 • <5 months after first dedicated Test & Automation engineer • <3 months after releasing Try Server • 1 week before Thanksgiving freeze •34 deploys the day after ber No ve m ! !! 18
  • 30. Is It Handmade Code If You Use Power Tools? How do we keep the momentum? •The tests ported to PHPUnit are flaky • Re-building intermittent failures is wasting time in the push queue •We are hiring more engineers • We need to deploy as fast, if not faster •We are writing more tests • More tests can take more time, so we need to write faster tests • Started at 1,500 tests, now running >7,000 tests ber ! Cy y ! Mo n da
  • 31. Is It Handmade Code If You Use Power Tools? Random Data BAD •Fixtures Framework •Written and maintained by developers •Original intent • Generate data to run test instance of the website •Unexpected usage • Flaky and hard to debug integration tests posing as unit tests
  • 32. Is It Handmade Code If You Use Power Tools? DBUnit for Multiple Databases •Shard-ed database architecture •Our ORM talks to multiple databases • At least the index and a shard •PHPUnit_Extensions_Database_MultipleDatab ases •Increased clarity in old tests ported to PHPUnit • Data explicitly specified in YAML, not at random • Developer needs to know what databases 8test will touch ra em be De c
  • 33. Is It Handmade Code If You Use Power Tools? Worth Mentioning: Try Server v.2 •Master try project in Jenkins • PHP Script executed in Jenkins shell builder • Started all sub-projects over cURL • Pinged all sub-projects for status • Used Jenkins Text Finder plugin to toggle project state • Sent a unified result e-mail •Eliminated problems finding test results be r8 De cem
  • 34. Is It Handmade Code If You Use Power Tools? Worth Mentioning: Try Server v.2 be r8 De cem
  • 35. Is It Handmade Code If You Use Power Tools? Why to mock? unit tests test the functionality of a single method in a single object with the expectations of the collaborating objects test case as a suitcase contains suits, a test case contains tests
  • 36. Is It Handmade Code If You Use Power Tools? PHPUnit Mock Helpers Making it easier to create mocks, should support writing more unit tests • Tweaking prod code • Writing short, tested helpers for internal types • PHPUnit_Extensions_MockObject_Stub_ReturnMapping • UPDATE: Now in PHPUnit as $this->returnValueMap() • Still more to do... ry 31 Ja nua
  • 37. Is It Handmade Code If You Use Power Tools? PHPUnit Extensions Open-sourced on Github ry 27 Fe b r ua
  • 38. Is It Handmade Code If You Use Power Tools? Try Server v.3 Jenkins Master Project Plugin Try’d out on Try Server ch 24 M ar
  • 39. Is It Handmade Code If You Use Power Tools? Pake Now test locally, just like Jenkins! Ap ril 5
  • 40. Is It Handmade Code If You Use Power Tools? Deployinator Info in Jenkins! Jenkins Master Project Plugin Just like Try Jenkins Deployinator Plugin Special CLI Command ONE Jenkins job per deployment stage Previously, ~15 Jobs that were difficult to correlate with a push pr il 9 A
  • 41. Is It Handmade Code If You Use Power Tools? On the Big Monitors!
  • 42. Is It Handmade Code If You Use Power Tools? Still More to Come... •Flaky test resolution •More focused DBUnit Tests •Make pure unit testing even easier •Try to solve whatever comes next... on d !! Bey
  • 43. Is It Handmade Code If You Use Power Tools? References Code As Craft http://codeascraft.etsy.com/ Deployinator http://codeascraft.etsy.com/2010/05/20/quantum-of-deployment/ Divide and Concur http://codeascraft.etsy.com/2011/04/20/divide-and-concur/ Etsy PHPUnit Extensions https://github.com/etsy/phpunit-extensions Jenkins CI http://jenkins-ci.org/ PHPUnit https://github.com/sebastianbergmann/phpunit/
  • 44. Is It Handmade Code If You Use Power Tools? Wardrobe Furnished By Spring Daisies Short Patchwork Dress http://www.etsy.com/shop/pineapplepop of Nashville, TN Asymmetric Flower and Beads Necklace (Silver) Created by Michelle D’Netto, Software Engineer @ Etsy Knitted DROPS Bolero with Lace Pattern http://www.garnstudio.com/lang/en/visoppskrift.php?d_nr=127&d_id=24 Design by DROPS Design Kni t bu t te Knitted by Laura Beth Denker a l as d at t h , e f o r i t wa s C o n f, the t dre s o o d a r k s :-(
  • 45. Is It Handmade Code If You Use Power Tools? Our software is artisanally crafted using the ancient techniques from the 1960s. All releases are aged in a handmade filled cave for at least 20 minutes before decanting to the Web. --Noah Sussman

Editor's Notes