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

Automation for web development

Automation for web development

Automation as a form of pre-commitment to best practices in web development. A talk given to the University of Melbourne's Web Information Technology class (Sem 1, 2013), based on experiences at 99designs.

Lars Yencken

May 15, 2013
Tweet

More Decks by Lars Yencken

Other Decks in Technology

Transcript

  1. Automation
    for web development
    A talk by @larsyencken to the University of Melbourne's
    Web Information Technologies class (Sem 1, 2013)

    View full-size slide

  2. Hi! I'm lars
    @larsyencken

    View full-size slide

  3. My background

    View full-size slide

  4. Early web hacking

    View full-size slide

  5. 0
    225000
    450000
    675000
    900000
    Jan-07 Jan-08 Jan-09 Jan-10 Jan-11 Jan-12 Jan-13
    Designs submitted

    View full-size slide

  6. Why
    automate?
    }

    View full-size slide

  7. people!
    Why
    automate?
    }

    View full-size slide

  8. have good intentions

    View full-size slide

  9. but , have lots to do!

    View full-size slide

  10. don't write tests

    View full-size slide

  11. don't run tests

    View full-size slide

  12. don't share
    instructions

    View full-size slide

  13. don't follow
    instructions

    View full-size slide

  14. are non-deterministic

    View full-size slide

  15. I have all these
    problems
    I should know...

    View full-size slide

  16. automation is
    pre-commitment

    View full-size slide

  17. Pre-commit to...

    View full-size slide

  18. Pre-commit to...
    testing your code

    View full-size slide

  19. Pre-commit to...
    shipping often and early

    View full-size slide

  20. Pre-commit to...
    disposing
    your infrastructure

    View full-size slide

  21. Pre-commit to testing
    "continuous integration"

    View full-size slide

  22. Pre-commit to testing
    running tests

    View full-size slide

  23. Jenkins
    TravisCI
    JuiCI

    View full-size slide

  24. developer
    remote
    repo
    git push

    View full-size slide

  25. developer
    remote
    repo
    git push
    CI server
    post

    View full-size slide

  26. developer
    remote
    repo
    git push
    CI server
    post
    tests
    run

    View full-size slide

  27. developer
    remote
    repo
    git push
    CI server
    post
    tests
    run
    notifies

    View full-size slide

  28. developer
    remote
    repo
    git push
    CI server
    post
    tests
    run
    notifies
    mark
    status

    View full-size slide

  29. Github integration

    View full-size slide

  30. Pre-commit to testing
    writing tests

    View full-size slide

  31. Test driven
    development

    View full-size slide

  32. Test driven
    bug-fixing

    View full-size slide

  33. Calculate
    test coverage

    View full-size slide

  34. Enforce coverage
    in test runs

    View full-size slide

  35. Pre-commit to testing
    1. Set up automated tests which run every time
    you push code
    2. Test before coding wherever possible, to
    make sure your design will allow for testing
    3. Measure coverage of your tests, and fail your
    test run unless coverage increases

    View full-size slide

  36. Pre-commit to shipping
    early and often
    "continuous deployment"

    View full-size slide

  37. waterfall
    plan far ahead,
    ship at the end

    View full-size slide

  38. agile
    plan a fortnight,
    ship every fortnight
    a “sprint”

    View full-size slide

  39. continuous
    ship a feature
    whenever it’s ready

    View full-size slide

  40. Make dev tasks
    one-step

    View full-size slide

  41. Rake rake ctags
    Shovel shovel ctags
    Grunt grunt ctags
    GNU Make make ctags

    View full-size slide

  42. Make deployment
    one-step

    View full-size slide

  43. Capistrano cap deploy
    Fabric fab deploy
    GNU Make make deploy

    View full-size slide

  44. Feature-flipping

    View full-size slide

  45. continuous
    ship a feature
    whenever it’s ready

    View full-size slide

  46. feature-flipping
    ship features to admins
    until they’re ready
    use guards

    View full-size slide

  47. feature-flipping
    ship features to admins
    until they’re ready
    use guards
    http://99designs.com/tech-blog/blog/2012/03/01/feature-flipping/

    View full-size slide

  48. Pre-commit to shipping
    early and often
    1. Make builds, deploys and other tedious tasks
    one-step
    2. Use your test suite as a sanity check during
    deployment
    3. Use feature flipping to get your code into the
    live site earlier

    View full-size slide

  49. Pre-commit to
    disposing of servers
    "software as infrastructure"

    View full-size slide

  50. “build recipes,
    not systems”

    View full-size slide

  51. Babushka
    Chef
    Puppet
    JuJu

    View full-size slide

  52. Commit to
    disposing of servers
    1. Write recipes for servers which start from a
    basic machine image (e.g. Ubuntu)
    2. Use tools like Vagrant to prototype new
    server types and test recipes

    View full-size slide