Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Adopting Test Driven Development in Operations

7090d58d804c96911a37c84e4e90a9cf?s=47 Ranjib Dey
August 11, 2015

Adopting Test Driven Development in Operations

Experience report on adopting test driven development in operations. Originally presented at Agile2014, Washington DC.


Ranjib Dey

August 11, 2015


  1. Strategies for adopting TDD in Operations @RanjibDey Based on the

    Experience Report: http://goo.gl/GIwn1v
  2. Agenda @RanjibDey 1.Introduction 2.TDD in brief 3.Why TDD is compelling

    in Operations 4.Strategies 5.Key learnings 6.Q/A
  3. Introduction @RanjibDey

  4. TDD in brief @RanjibDey 1.Unit test first 2.Part of XP

    3.Has evolved a lot
  5. Why TDD in Operations? @RanjibDey Operations integrates services

  6. Why TDD in Operations? @RanjibDey Tactical workloads are difficult to

  7. Why TDD in Operations? @RanjibDey Legacy components

  8. Strategies @RanjibDey 1.Layered tests 2.Code reviews 3.Extend CI to operations

    4.Continuous learning
  9. Layered testing strategy @RanjibDey 1.Unit tests for fast feedback 2.Functional

    tests for feature validation 3.Integration tests for end to end testing
  10. Unit tests @RanjibDey directory "/var/go/.ssh" do owner 'go' group 'go'

    mode 0700 end it 'creates the go user ssh directory' do expect(runner).to create_directory('/var/go/.ssh').with( owner: 'go', group: 'go', mode: 0700 ) end
  11. Unit tests @RanjibDey pagerduty/infra[master]$rake spec Finished in 1 minute 15.16

    seconds 5629 examples, 0 failures, 4 pending
  12. Functional tests @RanjibDey it 'creates a standalone zk node' do

    ct = helper.container('pd-zk') out = ct.execute do h= 'localhost' p = 2181 telnet = Net::Telnet::new('Host' => h, 'Port' => p) state = telnet.cmd('String' => 'ruok') telnet.close state end expect(out).to eq('imok') end
  13. Integration tests @RanjibDey

  14. Code reviews @RanjibDey

  15. Continuous Integration @RanjibDey Extend CI in operations

  16. Continuous Integration @RanjibDey Make courtesy artifacts

  17. Continuous Learning @RanjibDey 1.Invest on learning resources 2.Conferences 3.Engage in

    OpenSource projects
  18. Continuous Learning @RanjibDey Invest on learning resources

  19. Continuous Learning @RanjibDey Conferences, meetups

  20. Continuous Learning @RanjibDey Contribute and learn from OpenSource projects

  21. Key Learnings @RanjibDey 1.Be patient 2.Capture patterns, test patterns 3.Embrace

  22. Key Learnings @RanjibDey Be patient

  23. Key Learnings @RanjibDey Capture patterns

  24. Key Learnings @RanjibDey Capture patterns

  25. Key Learnings @RanjibDey Embrace diversity, ease deduction

  26. @RanjibDey Thank You Based on the Experience Report: http://goo.gl/GIwn1v