SlideShare a Scribd company logo
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

More Related Content

PPTX
Going extreme-with-extreme-programming
PDF
eXtreme programming (XP) - An Overview
PPTX
Extreme programming
PDF
Agile and test driven development
PDF
Agile Software Development Process Practice in Thai Culture
PDF
XP In 10 slides
PPTX
Extreme programming - a quick and agile overview !
PPTX
Agile Practices - eXtreme Programming
Going extreme-with-extreme-programming
eXtreme programming (XP) - An Overview
Extreme programming
Agile and test driven development
Agile Software Development Process Practice in Thai Culture
XP In 10 slides
Extreme programming - a quick and agile overview !
Agile Practices - eXtreme Programming

What's hot (20)

PDF
Agile Software Development in Practice - A Developer Perspective
PPT
XP Explained
PPTX
Scrum Plus Extreme Programming (XP) for Hyper Productivity
PPTX
Extreme Programming (XP) for Dummies
PPT
extreme Programming
ODP
Extreme Programming
PPT
Agile Software Development with XP
PDF
Test driven development
PPTX
Agile software development and extreme Programming
PDF
Test Driven Development (TDD) & Continuous Integration (CI)
PPTX
Xp exterme-programming-model
PPT
Introduction To Extreme Programming
KEY
Essential practices and thinking tools for Agile Adoption
PPT
Extreme programming
PPTX
Test Driven Development
PPTX
Architecture In An Agile World
PPTX
Chapter 3 Reducing Risks Using CI
PPT
Twelve practices of XP_Se lect5 btech
PPT
Extreme & pair programming Slides ppt
PPTX
A Brief Introduction to Test-Driven Development
Agile Software Development in Practice - A Developer Perspective
XP Explained
Scrum Plus Extreme Programming (XP) for Hyper Productivity
Extreme Programming (XP) for Dummies
extreme Programming
Extreme Programming
Agile Software Development with XP
Test driven development
Agile software development and extreme Programming
Test Driven Development (TDD) & Continuous Integration (CI)
Xp exterme-programming-model
Introduction To Extreme Programming
Essential practices and thinking tools for Agile Adoption
Extreme programming
Test Driven Development
Architecture In An Agile World
Chapter 3 Reducing Risks Using CI
Twelve practices of XP_Se lect5 btech
Extreme & pair programming Slides ppt
A Brief Introduction to Test-Driven Development
Ad

Similar to Test Driven Sysadmin (20)

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

Recently uploaded (20)

PDF
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
PPTX
MYSQL Presentation for SQL database connectivity
PPTX
Understanding_Digital_Forensics_Presentation.pptx
PDF
Encapsulation theory and applications.pdf
PPTX
Cloud computing and distributed systems.
PDF
Encapsulation_ Review paper, used for researhc scholars
PDF
Advanced methodologies resolving dimensionality complications for autism neur...
PDF
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
PDF
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
PPTX
Programs and apps: productivity, graphics, security and other tools
PDF
Diabetes mellitus diagnosis method based random forest with bat algorithm
PPTX
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
PDF
KodekX | Application Modernization Development
PDF
Unlocking AI with Model Context Protocol (MCP)
PDF
Dropbox Q2 2025 Financial Results & Investor Presentation
PDF
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
PDF
cuic standard and advanced reporting.pdf
PDF
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
PPTX
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
PPT
Teaching material agriculture food technology
TokAI - TikTok AI Agent : The First AI Application That Analyzes 10,000+ Vira...
MYSQL Presentation for SQL database connectivity
Understanding_Digital_Forensics_Presentation.pptx
Encapsulation theory and applications.pdf
Cloud computing and distributed systems.
Encapsulation_ Review paper, used for researhc scholars
Advanced methodologies resolving dimensionality complications for autism neur...
7 ChatGPT Prompts to Help You Define Your Ideal Customer Profile.pdf
Architecting across the Boundaries of two Complex Domains - Healthcare & Tech...
Programs and apps: productivity, graphics, security and other tools
Diabetes mellitus diagnosis method based random forest with bat algorithm
KOM of Painting work and Equipment Insulation REV00 update 25-dec.pptx
KodekX | Application Modernization Development
Unlocking AI with Model Context Protocol (MCP)
Dropbox Q2 2025 Financial Results & Investor Presentation
How UI/UX Design Impacts User Retention in Mobile Apps.pdf
cuic standard and advanced reporting.pdf
Build a system with the filesystem maintained by OSTree @ COSCUP 2025
VMware vSphere Foundation How to Sell Presentation-Ver1.4-2-14-2024.pptx
Teaching material agriculture food technology

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