SlideShare una empresa de Scribd logo
1 de 51
Descargar para leer sin conexión
Garrett Honeycutt 
gh@learnpuppet.com 
learnpuppet.com 
@learnpuppet 
Garrett Honeycutt 
gh@learnpuppet.com 
learnpuppet.com 
@learnpuppet
TDD?
Why Test?
DEVELOPERS! 
DEVELOPERS! 
DEVELOPERS! 
DEVELOPERS! 
DEVELOPERS! 
DEVELOPERS! 
DEVELOPERS! 
DEVELOPERS! 
DEVELOPERS! 
DEVELOPERS!
Why Test 
First?
What to 
Test?
Tooling
require 'spec_helper' 
! 
describe package('httpd') do 
it { should be_installed } 
end 
! 
describe service('httpd') do 
it { should be_enabled } 
it { should be_running } 
end 
! 
describe port(80) do 
it { should be_listening } 
end
$ rake spec 
! 
Package "httpd" 
should be installed 
! 
Service "httpd" 
should be enabled 
should be running 
! 
Port "80" 
should be listening 
! 
4 examples, 0 failures
Monitoring
$ ping -c1 example.com 
PING example.com (93.184.216.119): 56 
data bytes 
64 bytes from 93.184.216.119: icmp_seq=0 
ttl=58 time=4.947 ms 
! 
--- example.com ping statistics --- 
1 packets transmitted, 1 packets 
received, 0.0% packet loss 
round-trip min/avg/max/stddev = 
4.947/4.947/4.947/0.000 ms
$ curl example.com -I 
HTTP/1.1 200 OK 
Accept-Ranges: bytes 
Cache-Control: max-age=604800 
Content-Type: text/html 
Date: Thu, 13 Nov 2014 03:52:15 GMT 
Etag: "359670651" 
Expires: Thu, 20 Nov 2014 03:52:15 GMT 
Last-Modified: Fri, 09 Aug 2013 23:54:35 
GMT 
Server: ECS (pae/3796) 
X-Cache: HIT 
x-ec-custom-error: 1 
Content-Length: 1270
write tests 
(which fail)
just enough 
code to pass
refactor
Garrett Honeycutt 
gh@learnpuppet.com 
learnpuppet.com 
@learnpuppet

Más contenido relacionado

Similar a 2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14

20140406 loa days-tdd-with_puppet_tutorial
20140406 loa days-tdd-with_puppet_tutorial20140406 loa days-tdd-with_puppet_tutorial
20140406 loa days-tdd-with_puppet_tutorial
garrett honeycutt
 
Puppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the ForgePuppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the Forge
Puppet
 
Puppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionPuppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG edition
Joshua Thijssen
 
Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!
Joel Farris
 
Testing and validating spark programs - Strata SJ 2016
Testing and validating spark programs - Strata SJ 2016Testing and validating spark programs - Strata SJ 2016
Testing and validating spark programs - Strata SJ 2016
Holden Karau
 

Similar a 2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14 (20)

20140406 loa days-tdd-with_puppet_tutorial
20140406 loa days-tdd-with_puppet_tutorial20140406 loa days-tdd-with_puppet_tutorial
20140406 loa days-tdd-with_puppet_tutorial
 
Puppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the ForgePuppet Module Reusability - What I Learned from Shipping to the Forge
Puppet Module Reusability - What I Learned from Shipping to the Forge
 
Introduction to Unit Testing
Introduction to Unit TestingIntroduction to Unit Testing
Introduction to Unit Testing
 
Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014Test Driven Development with Puppet - PuppetConf 2014
Test Driven Development with Puppet - PuppetConf 2014
 
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
TDD with Puppet Tutorial presented at Cascadia IT Conference 2014-03-07
 
Grokking Grok: Monitorama PDX 2015
Grokking Grok: Monitorama PDX 2015Grokking Grok: Monitorama PDX 2015
Grokking Grok: Monitorama PDX 2015
 
Puppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG editionPuppet for dummies - PHPBenelux UG edition
Puppet for dummies - PHPBenelux UG edition
 
Automated Unit Testing
Automated Unit TestingAutomated Unit Testing
Automated Unit Testing
 
Javascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and GulpJavascript TDD with Jasmine, Karma, and Gulp
Javascript TDD with Jasmine, Karma, and Gulp
 
Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!Howto Test A Patch And Make A Difference!
Howto Test A Patch And Make A Difference!
 
Sinatra
SinatraSinatra
Sinatra
 
Developer Tests - Things to Know
Developer Tests - Things to KnowDeveloper Tests - Things to Know
Developer Tests - Things to Know
 
YAPC::NA 2007 - Customizing And Extending Perl Critic
YAPC::NA 2007 - Customizing And Extending Perl CriticYAPC::NA 2007 - Customizing And Extending Perl Critic
YAPC::NA 2007 - Customizing And Extending Perl Critic
 
Testing and validating spark programs - Strata SJ 2016
Testing and validating spark programs - Strata SJ 2016Testing and validating spark programs - Strata SJ 2016
Testing and validating spark programs - Strata SJ 2016
 
How to test code with mruby
How to test code with mrubyHow to test code with mruby
How to test code with mruby
 
Test driven infrastructure
Test driven infrastructureTest driven infrastructure
Test driven infrastructure
 
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streamsTech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
Tech talks annual 2015 kirk pepperdine_ripping apart java 8 streams
 
Test
TestTest
Test
 
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
XPDS16: Xen Live Patching - Updating Xen Without Rebooting - Konrad Wilk, Ora...
 
Pycon - Python for ethical hackers
Pycon - Python for ethical hackers Pycon - Python for ethical hackers
Pycon - Python for ethical hackers
 

Más de garrett honeycutt

20130407 load puppevtv3-and_hiera
20130407 load puppevtv3-and_hiera20130407 load puppevtv3-and_hiera
20130407 load puppevtv3-and_hiera
garrett honeycutt
 
20120331 - Expanded Intro to Puppet for LOAD
20120331 - Expanded Intro to Puppet for LOAD20120331 - Expanded Intro to Puppet for LOAD
20120331 - Expanded Intro to Puppet for LOAD
garrett honeycutt
 
Fighting Spam With A Perimeter Mail System 20071108 Sasag
Fighting Spam With A Perimeter Mail System 20071108 SasagFighting Spam With A Perimeter Mail System 20071108 Sasag
Fighting Spam With A Perimeter Mail System 20071108 Sasag
garrett honeycutt
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
garrett honeycutt
 

Más de garrett honeycutt (11)

20180823 - Sensu + Puppet
20180823 - Sensu + Puppet20180823 - Sensu + Puppet
20180823 - Sensu + Puppet
 
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
Continuous Deployment Pipeline for Systems - Presented at Ohio LinuxFest 2017...
 
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
Continuous Deployment Pipeline for Systems at Cascadia IT Conference - 2017-0...
 
2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago
2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago
2014-08-19 Multiple Approaches to Managing Puppet Modules @ Puppet Camp Chicago
 
20130407 load puppevtv3-and_hiera
20130407 load puppevtv3-and_hiera20130407 load puppevtv3-and_hiera
20130407 load puppevtv3-and_hiera
 
20120331 - Expanded Intro to Puppet for LOAD
20120331 - Expanded Intro to Puppet for LOAD20120331 - Expanded Intro to Puppet for LOAD
20120331 - Expanded Intro to Puppet for LOAD
 
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
20111110 how puppet-fits_into_your_existing_infrastructure_and_change_managem...
 
20110611 expanded intro-to_puppet_for_self
20110611 expanded intro-to_puppet_for_self20110611 expanded intro-to_puppet_for_self
20110611 expanded intro-to_puppet_for_self
 
20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw20100425 Configuration Management With Puppet Lfnw
20100425 Configuration Management With Puppet Lfnw
 
Fighting Spam With A Perimeter Mail System 20071108 Sasag
Fighting Spam With A Perimeter Mail System 20071108 SasagFighting Spam With A Perimeter Mail System 20071108 Sasag
Fighting Spam With A Perimeter Mail System 20071108 Sasag
 
20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag20090514 Introducing Puppet To Sasag
20090514 Introducing Puppet To Sasag
 

Último

XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
Neometrix_Engineering_Pvt_Ltd
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
Health
 

Último (20)

Computer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to ComputersComputer Lecture 01.pptxIntroduction to Computers
Computer Lecture 01.pptxIntroduction to Computers
 
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptxS1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
S1S2 B.Arch MGU - HOA1&2 Module 3 -Temple Architecture of Kerala.pptx
 
Online food ordering system project report.pdf
Online food ordering system project report.pdfOnline food ordering system project report.pdf
Online food ordering system project report.pdf
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
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
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
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
 
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
 
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
 
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
 
Integrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - NeometrixIntegrated Test Rig For HTFE-25 - Neometrix
Integrated Test Rig For HTFE-25 - Neometrix
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
Introduction to Serverless with AWS Lambda
Introduction to Serverless with AWS LambdaIntroduction to Serverless with AWS Lambda
Introduction to Serverless with AWS Lambda
 
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptxHOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
HOA1&2 - Module 3 - PREHISTORCI ARCHITECTURE OF KERALA.pptx
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
+97470301568>> buy weed in qatar,buy thc oil qatar,buy weed and vape oil in d...
 
Engineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planesEngineering Drawing focus on projection of planes
Engineering Drawing focus on projection of planes
 
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptxA CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
A CASE STUDY ON CERAMIC INDUSTRY OF BANGLADESH.pptx
 

2014-11-14 - Why Test Driven Development (TDD) Works for Sysadmins @ LISA14

  • 1. Garrett Honeycutt gh@learnpuppet.com learnpuppet.com @learnpuppet Garrett Honeycutt gh@learnpuppet.com learnpuppet.com @learnpuppet
  • 2.
  • 3.
  • 6.
  • 7.
  • 8. DEVELOPERS! DEVELOPERS! DEVELOPERS! DEVELOPERS! DEVELOPERS! DEVELOPERS! DEVELOPERS! DEVELOPERS! DEVELOPERS! DEVELOPERS!
  • 9.
  • 10.
  • 11.
  • 12.
  • 13.
  • 14.
  • 15.
  • 16.
  • 18.
  • 19.
  • 20.
  • 21.
  • 22.
  • 23.
  • 25.
  • 26.
  • 27.
  • 29.
  • 30.
  • 31.
  • 32.
  • 33.
  • 34.
  • 35.
  • 36.
  • 37.
  • 38. require 'spec_helper' ! describe package('httpd') do it { should be_installed } end ! describe service('httpd') do it { should be_enabled } it { should be_running } end ! describe port(80) do it { should be_listening } end
  • 39. $ rake spec ! Package "httpd" should be installed ! Service "httpd" should be enabled should be running ! Port "80" should be listening ! 4 examples, 0 failures
  • 40.
  • 41.
  • 42.
  • 44.
  • 45. $ ping -c1 example.com PING example.com (93.184.216.119): 56 data bytes 64 bytes from 93.184.216.119: icmp_seq=0 ttl=58 time=4.947 ms ! --- example.com ping statistics --- 1 packets transmitted, 1 packets received, 0.0% packet loss round-trip min/avg/max/stddev = 4.947/4.947/4.947/0.000 ms
  • 46. $ curl example.com -I HTTP/1.1 200 OK Accept-Ranges: bytes Cache-Control: max-age=604800 Content-Type: text/html Date: Thu, 13 Nov 2014 03:52:15 GMT Etag: "359670651" Expires: Thu, 20 Nov 2014 03:52:15 GMT Last-Modified: Fri, 09 Aug 2013 23:54:35 GMT Server: ECS (pae/3796) X-Cache: HIT x-ec-custom-error: 1 Content-Length: 1270
  • 47.
  • 49. just enough code to pass
  • 51. Garrett Honeycutt gh@learnpuppet.com learnpuppet.com @learnpuppet