SlideShare uma empresa Scribd logo
1 de 34
Baixar para ler offline
TDD FOR SYSADMINS
                              Johan van den Dorpe




Friday, 9 December 2011
TOPICS

                          • Best   Practice in IT

                          • Test   Driven Development

                          • Discussion

                          • Behaviour    Driven Development?




Friday, 9 December 2011
SYSADMIN BEST PRACTICES

    • ITIL                • Manuals

    • ASL                 • Web   / HOWTOs

    • ISO9000, COBIT...   • Word   of mouth

                          • Tradition

                          • Experience




Friday, 9 December 2011
DEVELOPER BEST PRACTICES

    • eXtreme             Programming (XP)   • Object    orientation

    • Agile                                  • Refactoring

    • DSDM                                   • Test   driven development

    • Adaptive                               • Aspectoriented
                                              development
    • SCRUM
                                             • Use    cases...


Friday, 9 December 2011
WHAT IS TDD?


        Test Driven Development relies on the repetition of a very short
        development cycle: first the developer writes a failing automated
        test case that defines a desired improvement or new function,
        then produces code to pass that test and finally refactors the new
        code to acceptable standards.



Friday, 9 December 2011
NORMALLY...
                     Design


                              Implement


                                          Test




Friday, 9 December 2011
TDD
                     Design


                              Test


                                      Implement




Friday, 9 December 2011
TDD
                     Design


                              Test


                                      Implement


                                                  Test


Friday, 9 December 2011
TDD
                     Design


                              Test


                                      Implement


                                                  Test


Friday, 9 December 2011
HOW TO DO IT

    • Design: figure           out what you want to do

    • Test: write          a test to express the design

         • It     should FAIL

    • Implement: write           the code

    • Test         again

         • It     should PASS

Friday, 9 December 2011
BENEFITS


    • Ensures             that code is written for testability

    • Ensures             unit tests are written for all code

    • Tests           provide documentation about functionality




Friday, 9 December 2011
BENEFITS


    • Ensures             that configurations are developed for testability

    • Ensures             unit tests are written for all configurations

    • Tests           provide documentation about functionality




Friday, 9 December 2011
WHAT DO WE DO, TODAY?

    • We    have identified the need for automated testing of builds
        and configurations




Friday, 9 December 2011
WHAT DO WE DO, TODAY?

    • We    have identified the need for automated testing of builds
        and configurations

    • The          testing team doesn’t have time to write the tests




Friday, 9 December 2011
WHAT DO WE DO, TODAY?

    • We    have identified the need for automated testing of builds
        and configurations

    • The          testing team doesn’t have time to write the tests

    • Sometimes   we write validation scripts - after we’ve
        implemented the configuration we’re validating




Friday, 9 December 2011
WHAT DO WE DO, TODAY?

    • We    have identified the need for automated testing of builds
        and configurations

    • The          testing team doesn’t have time to write the tests

    • Sometimes   we write validation scripts - after we’ve
        implemented the configuration we’re validating

    • Ignore              failing checks!



Friday, 9 December 2011
TEST DRIVEN CONFIG
                             MANAGEMENT
    • Design: figure           out what you want to do

    • Test: write          a test to express the design

         • It     should FAIL

    • Implement: defined             desired configuration state & apply

    • Test         again

         • It     should PASS

Friday, 9 December 2011
RED GREEN REFACTOR




Friday, 9 December 2011
TEST DRIVEN CONFIG
                              MANAGEMENT

    • Make                tests part of automated testing cycle

    • Make                test visible to everyone

    • Test         everywhere: dev, test and live

    • Tests           can be used by SSA



Friday, 9 December 2011
TEST DRIVEN CONFIG
                             MANAGEMENT


    • Anything   being changed on the build server, or being
        migrated, should follow TDD

    • Implementation         won’t be easy




Friday, 9 December 2011
BENEFITS

    • In  future, when any change occurs we can re-run all tests to
        confirm the working state of the build

    • The   purpose of changes are more clearly defined - automated
        documentation

    • If  a configuration is requested - like a security change - we
        could request the tests are provided and we do the work to
        make them pass



Friday, 9 December 2011
BENEFITS

    • Now     we start to think of configuration as code. Can now use
        development methods and tools - revision control & code
        review.

    • All       requirements captured as tests

    • Stronger      process control around implementation of change -
        preventing unauthorised change in environments. Failed tests
        will alert.



Friday, 9 December 2011
TEST OR MONITOR?

    • Is     monitoring the equivalent of testing?

    • Should    test results be reported to existing testing
        infrastructure?

    • Should              test results be reported to monitoring infrastructure?




Friday, 9 December 2011
DISCUSS




Friday, 9 December 2011
NOT A TEST




Friday, 9 December 2011
A TEST




Friday, 9 December 2011
FAILED TEST - RED




Friday, 9 December 2011
PASSED TEST - GREEN




Friday, 9 December 2011
BDD

    • First, obtain clear understanding of desired software behaviour
        - User Story

    • Write   test case in a natural language that non programmers
        can understand

    • Look   for the purpose and benefit of code rather than
        technical details




Friday, 9 December 2011
CUCUMBER




Friday, 9 December 2011
CUCUMBER




Friday, 9 December 2011
CUCUMBER




Friday, 9 December 2011
CUCUMBER




Friday, 9 December 2011
CUCUMBER NAGIOS




Friday, 9 December 2011

Mais conteúdo relacionado

Mais procurados

Agile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer PerspectiveAgile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer PerspectiveWee Witthawaskul
 
XP Explained
XP ExplainedXP Explained
XP Explainedvineet
 
Scrum Plus Extreme Programming (XP) for Hyper Productivity
Scrum Plus Extreme Programming (XP) for Hyper ProductivityScrum Plus Extreme Programming (XP) for Hyper Productivity
Scrum Plus Extreme Programming (XP) for Hyper ProductivityRon Quartel
 
Extreme Programming (XP) for Dummies
Extreme Programming (XP) for DummiesExtreme Programming (XP) for Dummies
Extreme Programming (XP) for DummiesJon McNestrie
 
extreme Programming
extreme Programmingextreme Programming
extreme ProgrammingBilal Shah
 
Extreme Programming
Extreme ProgrammingExtreme Programming
Extreme ProgrammingKnoldus Inc.
 
Agile Software Development with XP
Agile Software Development with XPAgile Software Development with XP
Agile Software Development with XPVashira Ravipanich
 
Test driven development
Test driven developmentTest driven development
Test driven developmentShalabh Saxena
 
Agile software development and extreme Programming
Agile software development and extreme Programming  Agile software development and extreme Programming
Agile software development and extreme Programming Fatemeh Karimi
 
Test Driven Development (TDD) & Continuous Integration (CI)
Test Driven Development (TDD) & Continuous Integration (CI)Test Driven Development (TDD) & Continuous Integration (CI)
Test Driven Development (TDD) & Continuous Integration (CI)Fatkul Amri
 
Xp exterme-programming-model
Xp exterme-programming-modelXp exterme-programming-model
Xp exterme-programming-modelAli MasudianPour
 
Introduction To Extreme Programming
Introduction To Extreme ProgrammingIntroduction To Extreme Programming
Introduction To Extreme ProgrammingJoe Drumgoole
 
Essential practices and thinking tools for Agile Adoption
Essential practices and thinking tools for Agile AdoptionEssential practices and thinking tools for Agile Adoption
Essential practices and thinking tools for Agile AdoptionSteven Mak
 
Extreme programming
Extreme programmingExtreme programming
Extreme programmingaaina_katyal
 
Architecture In An Agile World
Architecture In An Agile WorldArchitecture In An Agile World
Architecture In An Agile WorldJames Cooper
 
Twelve practices of XP_Se lect5 btech
Twelve practices of XP_Se lect5 btechTwelve practices of XP_Se lect5 btech
Twelve practices of XP_Se lect5 btechIIITA
 
Extreme & pair programming Slides ppt
Extreme & pair programming Slides pptExtreme & pair programming Slides ppt
Extreme & pair programming Slides pptMr SMAK
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentShawn Jones
 

Mais procurados (20)

Agile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer PerspectiveAgile Software Development in Practice - A Developer Perspective
Agile Software Development in Practice - A Developer Perspective
 
XP Explained
XP ExplainedXP Explained
XP Explained
 
Scrum Plus Extreme Programming (XP) for Hyper Productivity
Scrum Plus Extreme Programming (XP) for Hyper ProductivityScrum Plus Extreme Programming (XP) for Hyper Productivity
Scrum Plus Extreme Programming (XP) for Hyper Productivity
 
Extreme Programming (XP) for Dummies
Extreme Programming (XP) for DummiesExtreme Programming (XP) for Dummies
Extreme Programming (XP) for Dummies
 
extreme Programming
extreme Programmingextreme Programming
extreme Programming
 
Extreme Programming
Extreme ProgrammingExtreme Programming
Extreme Programming
 
Agile Software Development with XP
Agile Software Development with XPAgile Software Development with XP
Agile Software Development with XP
 
Test driven development
Test driven developmentTest driven development
Test driven development
 
Agile software development and extreme Programming
Agile software development and extreme Programming  Agile software development and extreme Programming
Agile software development and extreme Programming
 
Test Driven Development (TDD) & Continuous Integration (CI)
Test Driven Development (TDD) & Continuous Integration (CI)Test Driven Development (TDD) & Continuous Integration (CI)
Test Driven Development (TDD) & Continuous Integration (CI)
 
Xp exterme-programming-model
Xp exterme-programming-modelXp exterme-programming-model
Xp exterme-programming-model
 
Introduction To Extreme Programming
Introduction To Extreme ProgrammingIntroduction To Extreme Programming
Introduction To Extreme Programming
 
Essential practices and thinking tools for Agile Adoption
Essential practices and thinking tools for Agile AdoptionEssential practices and thinking tools for Agile Adoption
Essential practices and thinking tools for Agile Adoption
 
Extreme programming
Extreme programmingExtreme programming
Extreme programming
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Architecture In An Agile World
Architecture In An Agile WorldArchitecture In An Agile World
Architecture In An Agile World
 
Chapter 3 Reducing Risks Using CI
Chapter 3 Reducing Risks Using CIChapter 3 Reducing Risks Using CI
Chapter 3 Reducing Risks Using CI
 
Twelve practices of XP_Se lect5 btech
Twelve practices of XP_Se lect5 btechTwelve practices of XP_Se lect5 btech
Twelve practices of XP_Se lect5 btech
 
Extreme & pair programming Slides ppt
Extreme & pair programming Slides pptExtreme & pair programming Slides ppt
Extreme & pair programming Slides ppt
 
A Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven DevelopmentA Brief Introduction to Test-Driven Development
A Brief Introduction to Test-Driven Development
 

Semelhante a Test Driven Sysadmin

Are Your Tests Really Helping You?
Are Your Tests Really Helping You?Are Your Tests Really Helping You?
Are Your Tests Really Helping You?LB Denker
 
Development without Testers: Myth or Real Option?
Development without Testers: Myth or Real Option?Development without Testers: Myth or Real Option?
Development without Testers: Myth or Real Option?Mikalai Alimenkou
 
Development without Testers: Myth or Real Option? (ConfeT&QA conference)
Development without Testers: Myth or Real Option? (ConfeT&QA conference)Development without Testers: Myth or Real Option? (ConfeT&QA conference)
Development without Testers: Myth or Real Option? (ConfeT&QA conference)Mikalai Alimenkou
 
Arch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesArch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesIgor Moochnick
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven developmentEinar Ingebrigtsen
 
Infusion for the birds
Infusion for the birdsInfusion for the birds
Infusion for the birdscolinbdclark
 
10 Lessons learned in test automation
10 Lessons learned in test automation10 Lessons learned in test automation
10 Lessons learned in test automationRomania Testing
 
How to test a Mainframe Application
How to test a Mainframe ApplicationHow to test a Mainframe Application
How to test a Mainframe ApplicationMichael Erichsen
 
Lean UX Principles in Practice (Zach Larson on SideReel's iOS App)
Lean UX Principles in Practice (Zach Larson on SideReel's iOS App)Lean UX Principles in Practice (Zach Larson on SideReel's iOS App)
Lean UX Principles in Practice (Zach Larson on SideReel's iOS App)Balanced Team
 
Test driven development v1.0
Test driven development v1.0Test driven development v1.0
Test driven development v1.0Ganesh Kondal
 
Test Driven Design by Jonas Auken
Test Driven Design by Jonas AukenTest Driven Design by Jonas Auken
Test Driven Design by Jonas Aukenagilencr
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)zeeg
 
TestProject-X-Webinar_June-22.pptx
TestProject-X-Webinar_June-22.pptxTestProject-X-Webinar_June-22.pptx
TestProject-X-Webinar_June-22.pptxVishalPatil105290
 
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learnedSwiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learnedMichael Palotas
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven DevelopmentMike Douglas
 

Semelhante a Test Driven Sysadmin (20)

Are Your Tests Really Helping You?
Are Your Tests Really Helping You?Are Your Tests Really Helping You?
Are Your Tests Really Helping You?
 
Development without Testers: Myth or Real Option?
Development without Testers: Myth or Real Option?Development without Testers: Myth or Real Option?
Development without Testers: Myth or Real Option?
 
Development without Testers: Myth or Real Option? (ConfeT&QA conference)
Development without Testers: Myth or Real Option? (ConfeT&QA conference)Development without Testers: Myth or Real Option? (ConfeT&QA conference)
Development without Testers: Myth or Real Option? (ConfeT&QA conference)
 
Arch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best PracticesArch factory - Agile Design: Best Practices
Arch factory - Agile Design: Best Practices
 
Driving application development through behavior driven development
Driving application development through behavior driven developmentDriving application development through behavior driven development
Driving application development through behavior driven development
 
Infusion for the birds
Infusion for the birdsInfusion for the birds
Infusion for the birds
 
10 Lessons learned in test automation
10 Lessons learned in test automation10 Lessons learned in test automation
10 Lessons learned in test automation
 
How to test a Mainframe Application
How to test a Mainframe ApplicationHow to test a Mainframe Application
How to test a Mainframe Application
 
Test Driven Development
Test Driven DevelopmentTest Driven Development
Test Driven Development
 
Tests that talk
Tests that talkTests that talk
Tests that talk
 
Lean UX Principles in Practice (Zach Larson on SideReel's iOS App)
Lean UX Principles in Practice (Zach Larson on SideReel's iOS App)Lean UX Principles in Practice (Zach Larson on SideReel's iOS App)
Lean UX Principles in Practice (Zach Larson on SideReel's iOS App)
 
Test driven development v1.0
Test driven development v1.0Test driven development v1.0
Test driven development v1.0
 
Test Driven Design by Jonas Auken
Test Driven Design by Jonas AukenTest Driven Design by Jonas Auken
Test Driven Design by Jonas Auken
 
Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)Continuous Deployment at Disqus (Pylons Minicon)
Continuous Deployment at Disqus (Pylons Minicon)
 
It's XP, Stupid
It's XP, StupidIt's XP, Stupid
It's XP, Stupid
 
TDD in Agile
TDD in AgileTDD in Agile
TDD in Agile
 
Testing banking apps
Testing banking appsTesting banking apps
Testing banking apps
 
TestProject-X-Webinar_June-22.pptx
TestProject-X-Webinar_June-22.pptxTestProject-X-Webinar_June-22.pptx
TestProject-X-Webinar_June-22.pptx
 
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learnedSwiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
Swiss Testing Day - Testautomation, 10 (sometimes painful) lessons learned
 
Acceptance Test Driven Development
Acceptance Test Driven DevelopmentAcceptance Test Driven Development
Acceptance Test Driven Development
 

Último

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilV3cube
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Drew Madelung
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Enterprise Knowledge
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Miguel Araújo
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdflior mazor
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsJoaquim Jorge
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘RTylerCroy
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?Igalia
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonAnna Loughnan Colquhoun
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesBoston Institute of Analytics
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationRadu Cotescu
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationSafe Software
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherRemote DBA Services
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobeapidays
 

Último (20)

Developing An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of BrazilDeveloping An App To Navigate The Roads of Brazil
Developing An App To Navigate The Roads of Brazil
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
Strategies for Unlocking Knowledge Management in Microsoft 365 in the Copilot...
 
Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...Driving Behavioral Change for Information Management through Data-Driven Gree...
Driving Behavioral Change for Information Management through Data-Driven Gree...
 
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
Mastering MySQL Database Architecture: Deep Dive into MySQL Shell and MySQL R...
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
GenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdfGenAI Risks & Security Meetup 01052024.pdf
GenAI Risks & Security Meetup 01052024.pdf
 
Artificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and MythsArtificial Intelligence: Facts and Myths
Artificial Intelligence: Facts and Myths
 
🐬 The future of MySQL is Postgres 🐘
🐬  The future of MySQL is Postgres   🐘🐬  The future of MySQL is Postgres   🐘
🐬 The future of MySQL is Postgres 🐘
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?A Year of the Servo Reboot: Where Are We Now?
A Year of the Servo Reboot: Where Are We Now?
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
Data Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt RobisonData Cloud, More than a CDP by Matt Robison
Data Cloud, More than a CDP by Matt Robison
 
HTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation StrategiesHTML Injection Attacks: Impact and Mitigation Strategies
HTML Injection Attacks: Impact and Mitigation Strategies
 
Scaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organizationScaling API-first – The story of a global engineering organization
Scaling API-first – The story of a global engineering organization
 
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time AutomationFrom Event to Action: Accelerate Your Decision Making with Real-Time Automation
From Event to Action: Accelerate Your Decision Making with Real-Time Automation
 
Strategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a FresherStrategies for Landing an Oracle DBA Job as a Fresher
Strategies for Landing an Oracle DBA Job as a Fresher
 
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, AdobeApidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
Apidays New York 2024 - Scaling API-first by Ian Reasor and Radu Cotescu, Adobe
 

Test Driven Sysadmin

  • 1. TDD FOR SYSADMINS Johan van den Dorpe Friday, 9 December 2011
  • 2. TOPICS • Best Practice in IT • Test Driven Development • Discussion • Behaviour Driven Development? Friday, 9 December 2011
  • 3. SYSADMIN BEST PRACTICES • ITIL • Manuals • ASL • Web / HOWTOs • ISO9000, COBIT... • Word of mouth • Tradition • Experience Friday, 9 December 2011
  • 4. DEVELOPER BEST PRACTICES • eXtreme Programming (XP) • Object orientation • Agile • Refactoring • DSDM • Test driven development • Adaptive • Aspectoriented development • SCRUM • Use cases... Friday, 9 December 2011
  • 5. WHAT IS TDD? Test Driven Development relies on the repetition of a very short development cycle: first the developer writes a failing automated test case that defines a desired improvement or new function, then produces code to pass that test and finally refactors the new code to acceptable standards. Friday, 9 December 2011
  • 6. NORMALLY... Design Implement Test Friday, 9 December 2011
  • 7. TDD Design Test Implement Friday, 9 December 2011
  • 8. TDD Design Test Implement Test Friday, 9 December 2011
  • 9. TDD Design Test Implement Test Friday, 9 December 2011
  • 10. HOW TO DO IT • Design: figure out what you want to do • Test: write a test to express the design • It should FAIL • Implement: write the code • Test again • It should PASS Friday, 9 December 2011
  • 11. BENEFITS • Ensures that code is written for testability • Ensures unit tests are written for all code • Tests provide documentation about functionality Friday, 9 December 2011
  • 12. BENEFITS • Ensures that configurations are developed for testability • Ensures unit tests are written for all configurations • Tests provide documentation about functionality Friday, 9 December 2011
  • 13. WHAT DO WE DO, TODAY? • We have identified the need for automated testing of builds and configurations Friday, 9 December 2011
  • 14. WHAT DO WE DO, TODAY? • We have identified the need for automated testing of builds and configurations • The testing team doesn’t have time to write the tests Friday, 9 December 2011
  • 15. WHAT DO WE DO, TODAY? • We have identified the need for automated testing of builds and configurations • The testing team doesn’t have time to write the tests • Sometimes we write validation scripts - after we’ve implemented the configuration we’re validating Friday, 9 December 2011
  • 16. WHAT DO WE DO, TODAY? • We have identified the need for automated testing of builds and configurations • The testing team doesn’t have time to write the tests • Sometimes we write validation scripts - after we’ve implemented the configuration we’re validating • Ignore failing checks! Friday, 9 December 2011
  • 17. TEST DRIVEN CONFIG MANAGEMENT • Design: figure out what you want to do • Test: write a test to express the design • It should FAIL • Implement: defined desired configuration state & apply • Test again • It should PASS Friday, 9 December 2011
  • 18. RED GREEN REFACTOR Friday, 9 December 2011
  • 19. TEST DRIVEN CONFIG MANAGEMENT • Make tests part of automated testing cycle • Make test visible to everyone • Test everywhere: dev, test and live • Tests can be used by SSA Friday, 9 December 2011
  • 20. TEST DRIVEN CONFIG MANAGEMENT • Anything being changed on the build server, or being migrated, should follow TDD • Implementation won’t be easy Friday, 9 December 2011
  • 21. BENEFITS • In future, when any change occurs we can re-run all tests to confirm the working state of the build • The purpose of changes are more clearly defined - automated documentation • If a configuration is requested - like a security change - we could request the tests are provided and we do the work to make them pass Friday, 9 December 2011
  • 22. BENEFITS • Now we start to think of configuration as code. Can now use development methods and tools - revision control & code review. • All requirements captured as tests • Stronger process control around implementation of change - preventing unauthorised change in environments. Failed tests will alert. Friday, 9 December 2011
  • 23. TEST OR MONITOR? • Is monitoring the equivalent of testing? • Should test results be reported to existing testing infrastructure? • Should test results be reported to monitoring infrastructure? Friday, 9 December 2011
  • 25. NOT A TEST Friday, 9 December 2011
  • 26. A TEST Friday, 9 December 2011
  • 27. FAILED TEST - RED Friday, 9 December 2011
  • 28. PASSED TEST - GREEN Friday, 9 December 2011
  • 29. BDD • First, obtain clear understanding of desired software behaviour - User Story • Write test case in a natural language that non programmers can understand • Look for the purpose and benefit of code rather than technical details Friday, 9 December 2011
  • 34. CUCUMBER NAGIOS Friday, 9 December 2011