SlideShare a Scribd company logo
1 of 15
Download to read offline
Zero to Test Driven Infrastructure
Sean Carolan – Solutions Architect, Chef
History of Software Testing
< 1956 Debugging: You found a bug in the code and fixed it.
1957–1978 Demonstration: Does the code run? Does it solve the problem?
1979–1982 Destruction: Kill all the bugs.
1983–1987 Evaluation: SDLC – Each stage has testing methods.
1988–2000 Prevention: Catch bugs and issues *before* they cost $$$(1)
2001-2009 Automation: Automate as much of your testing as possible.
2010–Today Velocity: Test fast and deploy often.
1) Gelperin, D. & Hetzel, B., (1988). The Growth of Software Testing
Why test?
• The closer a defect is discovered to its
introduction, the cheaper and easier it is to
fix.
• It is better to find a security violation before
the configuration code touches a production
system, instead of three months later during
a security audit.
• Rigorous testing allows you to deploy
infrastructure changes with confidence. The
more often you deploy code, the more
routine it becomes.
Automation is Essential
• Automate the setup, provisioning and deployment of an Apache webserver
• Infrastructure setup steps are defined as code, using the Chef DSL
• Tests are conducted during each stage of the continuous delivery pipeline
Three Types of Testing
Signal in: Did I send a properly
formed piece of code to the
interpreter?
Signal processing: Was my well-
formed signal properly interpreted?
Signal out: Did my well-formed
code, correctly interpreted, actually
achieve the thing I set out to do?
The Breakfast Taco API
What are the ingredients for success?
Chef workstation.
Can be your laptop
or a VM.
Somewhere to spin
up VMs/containers.
Source Code
Repository
CI system for
automated testing
Tools of the Trade
What’s in the Kitchen?
Rubocop
Because Ruby
• Identify potential Ruby errors
• Unclosed strings, etc.
• Identify style/convention that helps write better code
• Single quotes vs. double quotes
• This is useful for new Chefs, and helps make the code more readable
• Exclude rules that do not apply
• Not everyone is the same – some tests won’t work for your organization or for Chef code
• Run against static code, so tests are very fast (<1 second to run)
Food Critic
Test Your “Chef Style”
• Flag problems that might cause your Chef cookbooks to fail
on converge
FC010: Invalid search syntax
• Identify style/convention that has been adopted by the Chef
community
FC004: Use a service resource to start and stop
services
• Create custom rules for your own organization’s
compliance/standards
COMP001: Do not allow recipes to mount disk volumes
• Run against static code, so tests are very fast (<5 seconds to
run)
ChefSpec
Simulate Chef
• Did I send a properly formed piece of code to Chef?
• Especially important if there is mutability in your code
• This can cover things like feature flags, or behavior that changes on a
per-OS basis
• "If on Debian-based Linux I need to install package apache2, but on EL
variants I need to install package httpd.”
• Tests are very fast to run
• Even with simple code, it is useful for new Chefs to find simple errors
quickly
• Useful for regression testing – to make sure new changes
don’t break stuff that worked before.
Test Kitchen
Let’s do this (almost) for real
• “Signal Out” testing for Chef code
• Just because I said something and it was interpreted correctly, doesn't mean that
what I said is what I meant.
• Executes your Chef code on a real node. These nodes should be
disposable (local virtualization, cloud instances, etc.)
• Use any number of “signal out” testing products to ensure expected
results
• BATS
• ServerSpec
• Pester
• Can pull in other cookbook dependencies as well, and execute against
a machine that looks the same as your standard image
Six hours? Really?
• Hour 1: Visit www.learnchef.com and learn the Chef DSL basics
• Hour 2: Install ChefDK, Vagrant, Virtualbox and the kitchen-vagrant driver
• Hour 3: Write a few ChefSpec and ServerSpec tests for Apache
• Hour 4: Write Chef code so your VM passes the tests (Install, config apache)
• Hour 5: Debug, troubleshoot, fix any errors.
• Hour 6: Sit back, enjoy a Texian Martini and reflect on how awesome you are
Pre-built Apache cookbook
• Download a pre-built sample Apache
cookbook to use for testing.
• This is the same cookbook we write in
Chef Fundamentals training.
• Some sample unit and integration tests
are included to get you started.
http://bit.ly/1Iauoft
Questions?
Zero to Test Driven Infrastructure

More Related Content

What's hot

Selenium Israel Meetup
Selenium Israel MeetupSelenium Israel Meetup
Selenium Israel MeetupJustin Ison
 
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce LabsSimplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce LabsSauce Labs
 
Accelerating DevOps Collaboration with Sauce Labs and JIRA
Accelerating DevOps Collaboration with Sauce Labs and JIRAAccelerating DevOps Collaboration with Sauce Labs and JIRA
Accelerating DevOps Collaboration with Sauce Labs and JIRASauce Labs
 
Continuous Testing in the Cloud
Continuous Testing in the CloudContinuous Testing in the Cloud
Continuous Testing in the CloudSauce Labs
 
Selenium and Appium Training from Sauce Labs
Selenium and Appium Training from Sauce LabsSelenium and Appium Training from Sauce Labs
Selenium and Appium Training from Sauce LabsSauce Labs
 
Role of Pipelines in Continuous Delivery
Role of Pipelines in Continuous DeliveryRole of Pipelines in Continuous Delivery
Role of Pipelines in Continuous DeliveryMandi Walls
 
Continuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarContinuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarPascal Larocque
 
“Sensu and Sensibility” - The Story of a Journey From #monitoringsucks to #mo...
“Sensu and Sensibility” - The Story of a Journey From #monitoringsucks to #mo...“Sensu and Sensibility” - The Story of a Journey From #monitoringsucks to #mo...
“Sensu and Sensibility” - The Story of a Journey From #monitoringsucks to #mo...Puppet
 
Delivery pipelines at Symphony Talent - Present and Future
Delivery pipelines at Symphony Talent - Present and FutureDelivery pipelines at Symphony Talent - Present and Future
Delivery pipelines at Symphony Talent - Present and FutureNathan Jones
 
Continuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQContinuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQTomas Riha
 
How to Cover All Your Backend Testing Needs with API and UI Tests
How to Cover All Your Backend Testing Needs with API and UI TestsHow to Cover All Your Backend Testing Needs with API and UI Tests
How to Cover All Your Backend Testing Needs with API and UI TestsBlazeMeter
 
Building Evolvable Infrastructure
Building Evolvable InfrastructureBuilding Evolvable Infrastructure
Building Evolvable Infrastructurekiefdotcom
 
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...Puppet
 
Fundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDFundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDBatyr Nuryyev
 
Combining Front-End and Backend Testing with Sauce Labs & BlazeMeter
Combining Front-End and Backend Testing with Sauce Labs & BlazeMeterCombining Front-End and Backend Testing with Sauce Labs & BlazeMeter
Combining Front-End and Backend Testing with Sauce Labs & BlazeMeterSauce Labs
 
Continuous integration, delivery & deployment
Continuous integration,  delivery & deploymentContinuous integration,  delivery & deployment
Continuous integration, delivery & deploymentMartijn van der Kamp
 
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...Andreas Grabner
 
Top Java Performance Problems and Metrics To Check in Your Pipeline
Top Java Performance Problems and Metrics To Check in Your PipelineTop Java Performance Problems and Metrics To Check in Your Pipeline
Top Java Performance Problems and Metrics To Check in Your PipelineAndreas Grabner
 
London Atlassian User Group - February 2014
London Atlassian User Group - February 2014London Atlassian User Group - February 2014
London Atlassian User Group - February 2014Steve Smith
 
Pietro Di Bello, Paolo D'Incau - Continuous Delivery su progetti Java: cosa a...
Pietro Di Bello, Paolo D'Incau - Continuous Delivery su progetti Java: cosa a...Pietro Di Bello, Paolo D'Incau - Continuous Delivery su progetti Java: cosa a...
Pietro Di Bello, Paolo D'Incau - Continuous Delivery su progetti Java: cosa a...Codemotion
 

What's hot (20)

Selenium Israel Meetup
Selenium Israel MeetupSelenium Israel Meetup
Selenium Israel Meetup
 
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce LabsSimplify CI with the Updated Jenkins Plugin for Sauce Labs
Simplify CI with the Updated Jenkins Plugin for Sauce Labs
 
Accelerating DevOps Collaboration with Sauce Labs and JIRA
Accelerating DevOps Collaboration with Sauce Labs and JIRAAccelerating DevOps Collaboration with Sauce Labs and JIRA
Accelerating DevOps Collaboration with Sauce Labs and JIRA
 
Continuous Testing in the Cloud
Continuous Testing in the CloudContinuous Testing in the Cloud
Continuous Testing in the Cloud
 
Selenium and Appium Training from Sauce Labs
Selenium and Appium Training from Sauce LabsSelenium and Appium Training from Sauce Labs
Selenium and Appium Training from Sauce Labs
 
Role of Pipelines in Continuous Delivery
Role of Pipelines in Continuous DeliveryRole of Pipelines in Continuous Delivery
Role of Pipelines in Continuous Delivery
 
Continuous integration using Jenkins and Sonar
Continuous integration using Jenkins and SonarContinuous integration using Jenkins and Sonar
Continuous integration using Jenkins and Sonar
 
“Sensu and Sensibility” - The Story of a Journey From #monitoringsucks to #mo...
“Sensu and Sensibility” - The Story of a Journey From #monitoringsucks to #mo...“Sensu and Sensibility” - The Story of a Journey From #monitoringsucks to #mo...
“Sensu and Sensibility” - The Story of a Journey From #monitoringsucks to #mo...
 
Delivery pipelines at Symphony Talent - Present and Future
Delivery pipelines at Symphony Talent - Present and FutureDelivery pipelines at Symphony Talent - Present and Future
Delivery pipelines at Symphony Talent - Present and Future
 
Continuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQContinuous Delivery Testing @HiQ
Continuous Delivery Testing @HiQ
 
How to Cover All Your Backend Testing Needs with API and UI Tests
How to Cover All Your Backend Testing Needs with API and UI TestsHow to Cover All Your Backend Testing Needs with API and UI Tests
How to Cover All Your Backend Testing Needs with API and UI Tests
 
Building Evolvable Infrastructure
Building Evolvable InfrastructureBuilding Evolvable Infrastructure
Building Evolvable Infrastructure
 
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...
PuppetConf 2016: Site Launch Automation: From Days to Minutes – Kristen Crawf...
 
Fundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CDFundamentals of DevOps and CI/CD
Fundamentals of DevOps and CI/CD
 
Combining Front-End and Backend Testing with Sauce Labs & BlazeMeter
Combining Front-End and Backend Testing with Sauce Labs & BlazeMeterCombining Front-End and Backend Testing with Sauce Labs & BlazeMeter
Combining Front-End and Backend Testing with Sauce Labs & BlazeMeter
 
Continuous integration, delivery & deployment
Continuous integration,  delivery & deploymentContinuous integration,  delivery & deployment
Continuous integration, delivery & deployment
 
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
Performance Metrics for your Build Pipeline - presented at Vienna WebPerf Oct...
 
Top Java Performance Problems and Metrics To Check in Your Pipeline
Top Java Performance Problems and Metrics To Check in Your PipelineTop Java Performance Problems and Metrics To Check in Your Pipeline
Top Java Performance Problems and Metrics To Check in Your Pipeline
 
London Atlassian User Group - February 2014
London Atlassian User Group - February 2014London Atlassian User Group - February 2014
London Atlassian User Group - February 2014
 
Pietro Di Bello, Paolo D'Incau - Continuous Delivery su progetti Java: cosa a...
Pietro Di Bello, Paolo D'Incau - Continuous Delivery su progetti Java: cosa a...Pietro Di Bello, Paolo D'Incau - Continuous Delivery su progetti Java: cosa a...
Pietro Di Bello, Paolo D'Incau - Continuous Delivery su progetti Java: cosa a...
 

Similar to Zero to Test Driven Infrastructure

Terraform Testing with InSpec Demo
Terraform Testing with InSpec DemoTerraform Testing with InSpec Demo
Terraform Testing with InSpec DemoAnnie Hedgpeth
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and AutomationMahesh Salaria
 
Topic production code
Topic production codeTopic production code
Topic production codeKavi Kumar
 
Compliance Automation with InSpec
Compliance Automation with InSpecCompliance Automation with InSpec
Compliance Automation with InSpec Nathen Harvey
 
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017adamleff
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Molliewillemstuursma
 
Software Testing, Everyone's responsibility
Software Testing, Everyone's responsibilitySoftware Testing, Everyone's responsibility
Software Testing, Everyone's responsibilityKurt Bliefernich
 
Continuous Integration Testing for SAP
Continuous Integration Testing for SAPContinuous Integration Testing for SAP
Continuous Integration Testing for SAPWorksoft
 
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping QualityMichael Roufa
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham.NET Conf UY
 
10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware ProgrammingPostSharp Technologies
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013David Funaro
 
Improving Batch-Process Testing Techniques with a Domain-Specific Language
Improving Batch-Process Testing Techniques with a Domain-Specific LanguageImproving Batch-Process Testing Techniques with a Domain-Specific Language
Improving Batch-Process Testing Techniques with a Domain-Specific LanguageDr. Spock
 
Continuous Delivery for Open Source Java projects
Continuous Delivery for Open Source Java projectsContinuous Delivery for Open Source Java projects
Continuous Delivery for Open Source Java projectsTricode (part of Dept)
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comAviran Mordo
 
MyHeritage - QA Automations in a Continuous Deployment environment
MyHeritage -  QA Automations in a Continuous Deployment environmentMyHeritage -  QA Automations in a Continuous Deployment environment
MyHeritage - QA Automations in a Continuous Deployment environmentMatanGoren
 

Similar to Zero to Test Driven Infrastructure (20)

Chef Cookbook Workflow
Chef Cookbook WorkflowChef Cookbook Workflow
Chef Cookbook Workflow
 
Terraform Testing with InSpec Demo
Terraform Testing with InSpec DemoTerraform Testing with InSpec Demo
Terraform Testing with InSpec Demo
 
Test Driven Development and Automation
Test Driven Development and AutomationTest Driven Development and Automation
Test Driven Development and Automation
 
Topic production code
Topic production codeTopic production code
Topic production code
 
Compliance Automation with InSpec
Compliance Automation with InSpecCompliance Automation with InSpec
Compliance Automation with InSpec
 
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017Compliance Automation with InSpec - Chef NYC Meetup - April 2017
Compliance Automation with InSpec - Chef NYC Meetup - April 2017
 
Continuous Integration at Mollie
Continuous Integration at MollieContinuous Integration at Mollie
Continuous Integration at Mollie
 
DevOps in an Embedded World
DevOps in an Embedded WorldDevOps in an Embedded World
DevOps in an Embedded World
 
Software Testing, Everyone's responsibility
Software Testing, Everyone's responsibilitySoftware Testing, Everyone's responsibility
Software Testing, Everyone's responsibility
 
Continuous Integration Testing for SAP
Continuous Integration Testing for SAPContinuous Integration Testing for SAP
Continuous Integration Testing for SAP
 
Bootstrapping Quality
Bootstrapping QualityBootstrapping Quality
Bootstrapping Quality
 
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald BelchamGetting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
Getting Ahead of Delivery Issues with Deep SDLC Analysis by Donald Belcham
 
10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming10 Reasons You MUST Consider Pattern-Aware Programming
10 Reasons You MUST Consider Pattern-Aware Programming
 
Continuous delivery @wcap 5-09-2013
Continuous delivery   @wcap 5-09-2013Continuous delivery   @wcap 5-09-2013
Continuous delivery @wcap 5-09-2013
 
Improving Batch-Process Testing Techniques with a Domain-Specific Language
Improving Batch-Process Testing Techniques with a Domain-Specific LanguageImproving Batch-Process Testing Techniques with a Domain-Specific Language
Improving Batch-Process Testing Techniques with a Domain-Specific Language
 
Tdd
TddTdd
Tdd
 
Continuous Delivery for Open Source Java projects
Continuous Delivery for Open Source Java projectsContinuous Delivery for Open Source Java projects
Continuous Delivery for Open Source Java projects
 
CD
CDCD
CD
 
Road to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.comRoad to Continuous Delivery - Wix.com
Road to Continuous Delivery - Wix.com
 
MyHeritage - QA Automations in a Continuous Deployment environment
MyHeritage -  QA Automations in a Continuous Deployment environmentMyHeritage -  QA Automations in a Continuous Deployment environment
MyHeritage - QA Automations in a Continuous Deployment environment
 

More from Mike Rosado, DevOps, CSM®, CASM™ (8)

All The Talks - The Best of Ignite Talks
All The Talks - The Best of Ignite TalksAll The Talks - The Best of Ignite Talks
All The Talks - The Best of Ignite Talks
 
Estudia ● Persevera ● Truinfa - Mentalidad DevOps
Estudia ● Persevera ● Truinfa - Mentalidad DevOpsEstudia ● Persevera ● Truinfa - Mentalidad DevOps
Estudia ● Persevera ● Truinfa - Mentalidad DevOps
 
Yung Chou - Anatomy of Cloud Solution
Yung Chou - Anatomy of Cloud SolutionYung Chou - Anatomy of Cloud Solution
Yung Chou - Anatomy of Cloud Solution
 
AWS_Business_Technical_Certificate
AWS_Business_Technical_CertificateAWS_Business_Technical_Certificate
AWS_Business_Technical_Certificate
 
AWS_Business_Professional_Certificate
AWS_Business_Professional_CertificateAWS_Business_Professional_Certificate
AWS_Business_Professional_Certificate
 
Miguel A. Rosado-ScrumAlliance_CSM_Certificate
Miguel A. Rosado-ScrumAlliance_CSM_CertificateMiguel A. Rosado-ScrumAlliance_CSM_Certificate
Miguel A. Rosado-ScrumAlliance_CSM_Certificate
 
FINAL_Certificate_of_CASM
FINAL_Certificate_of_CASMFINAL_Certificate_of_CASM
FINAL_Certificate_of_CASM
 
DevOps_Foundation_Certification
DevOps_Foundation_CertificationDevOps_Foundation_Certification
DevOps_Foundation_Certification
 

Recently uploaded

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEEVICTOR MAESTRE RAMIREZ
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesPhilip Schwarz
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceBrainSell Technologies
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEOrtus Solutions, Corp
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Cizo Technology Services
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationBradBedford3
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024StefanoLambiase
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...stazi3110
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Andreas Granig
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureDinusha Kumarasiri
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityNeo4j
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noidabntitsolutionsrishis
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....kzayra69
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 

Recently uploaded (20)

Cloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEECloud Data Center Network Construction - IEEE
Cloud Data Center Network Construction - IEEE
 
Folding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a seriesFolding Cheat Sheet #4 - fourth in a series
Folding Cheat Sheet #4 - fourth in a series
 
CRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. SalesforceCRM Contender Series: HubSpot vs. Salesforce
CRM Contender Series: HubSpot vs. Salesforce
 
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASEBATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
BATTLEFIELD ORM: TIPS, TACTICS AND STRATEGIES FOR CONQUERING YOUR DATABASE
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
Global Identity Enrolment and Verification Pro Solution - Cizo Technology Ser...
 
How to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion ApplicationHow to submit a standout Adobe Champion Application
How to submit a standout Adobe Champion Application
 
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
Dealing with Cultural Dispersion — Stefano Lambiase — ICSE-SEIS 2024
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
Building a General PDE Solving Framework with Symbolic-Numeric Scientific Mac...
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024Automate your Kamailio Test Calls - Kamailio World 2024
Automate your Kamailio Test Calls - Kamailio World 2024
 
Implementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with AzureImplementing Zero Trust strategy with Azure
Implementing Zero Trust strategy with Azure
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 
EY_Graph Database Powered Sustainability
EY_Graph Database Powered SustainabilityEY_Graph Database Powered Sustainability
EY_Graph Database Powered Sustainability
 
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in NoidaBuds n Tech IT Solutions: Top-Notch Web Services in Noida
Buds n Tech IT Solutions: Top-Notch Web Services in Noida
 
What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....What are the key points to focus on before starting to learn ETL Development....
What are the key points to focus on before starting to learn ETL Development....
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 

Zero to Test Driven Infrastructure

  • 1. Zero to Test Driven Infrastructure Sean Carolan – Solutions Architect, Chef
  • 2. History of Software Testing < 1956 Debugging: You found a bug in the code and fixed it. 1957–1978 Demonstration: Does the code run? Does it solve the problem? 1979–1982 Destruction: Kill all the bugs. 1983–1987 Evaluation: SDLC – Each stage has testing methods. 1988–2000 Prevention: Catch bugs and issues *before* they cost $$$(1) 2001-2009 Automation: Automate as much of your testing as possible. 2010–Today Velocity: Test fast and deploy often. 1) Gelperin, D. & Hetzel, B., (1988). The Growth of Software Testing
  • 3. Why test? • The closer a defect is discovered to its introduction, the cheaper and easier it is to fix. • It is better to find a security violation before the configuration code touches a production system, instead of three months later during a security audit. • Rigorous testing allows you to deploy infrastructure changes with confidence. The more often you deploy code, the more routine it becomes.
  • 4. Automation is Essential • Automate the setup, provisioning and deployment of an Apache webserver • Infrastructure setup steps are defined as code, using the Chef DSL • Tests are conducted during each stage of the continuous delivery pipeline
  • 5. Three Types of Testing Signal in: Did I send a properly formed piece of code to the interpreter? Signal processing: Was my well- formed signal properly interpreted? Signal out: Did my well-formed code, correctly interpreted, actually achieve the thing I set out to do? The Breakfast Taco API
  • 6. What are the ingredients for success? Chef workstation. Can be your laptop or a VM. Somewhere to spin up VMs/containers. Source Code Repository CI system for automated testing
  • 7. Tools of the Trade What’s in the Kitchen?
  • 8. Rubocop Because Ruby • Identify potential Ruby errors • Unclosed strings, etc. • Identify style/convention that helps write better code • Single quotes vs. double quotes • This is useful for new Chefs, and helps make the code more readable • Exclude rules that do not apply • Not everyone is the same – some tests won’t work for your organization or for Chef code • Run against static code, so tests are very fast (<1 second to run)
  • 9. Food Critic Test Your “Chef Style” • Flag problems that might cause your Chef cookbooks to fail on converge FC010: Invalid search syntax • Identify style/convention that has been adopted by the Chef community FC004: Use a service resource to start and stop services • Create custom rules for your own organization’s compliance/standards COMP001: Do not allow recipes to mount disk volumes • Run against static code, so tests are very fast (<5 seconds to run)
  • 10. ChefSpec Simulate Chef • Did I send a properly formed piece of code to Chef? • Especially important if there is mutability in your code • This can cover things like feature flags, or behavior that changes on a per-OS basis • "If on Debian-based Linux I need to install package apache2, but on EL variants I need to install package httpd.” • Tests are very fast to run • Even with simple code, it is useful for new Chefs to find simple errors quickly • Useful for regression testing – to make sure new changes don’t break stuff that worked before.
  • 11. Test Kitchen Let’s do this (almost) for real • “Signal Out” testing for Chef code • Just because I said something and it was interpreted correctly, doesn't mean that what I said is what I meant. • Executes your Chef code on a real node. These nodes should be disposable (local virtualization, cloud instances, etc.) • Use any number of “signal out” testing products to ensure expected results • BATS • ServerSpec • Pester • Can pull in other cookbook dependencies as well, and execute against a machine that looks the same as your standard image
  • 12. Six hours? Really? • Hour 1: Visit www.learnchef.com and learn the Chef DSL basics • Hour 2: Install ChefDK, Vagrant, Virtualbox and the kitchen-vagrant driver • Hour 3: Write a few ChefSpec and ServerSpec tests for Apache • Hour 4: Write Chef code so your VM passes the tests (Install, config apache) • Hour 5: Debug, troubleshoot, fix any errors. • Hour 6: Sit back, enjoy a Texian Martini and reflect on how awesome you are
  • 13. Pre-built Apache cookbook • Download a pre-built sample Apache cookbook to use for testing. • This is the same cookbook we write in Chef Fundamentals training. • Some sample unit and integration tests are included to get you started. http://bit.ly/1Iauoft