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 Slide

  2. Hi! I'm lars
    @larsyencken

    View Slide

  3. My background

    View Slide

  4. Early web hacking

    View Slide

  5. View Slide

  6. View Slide

  7. View Slide

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

    View Slide

  9. Why
    automate?
    }

    View Slide

  10. people!
    Why
    automate?
    }

    View Slide

  11. People...

    View Slide

  12. have good intentions

    View Slide

  13. but , have lots to do!

    View Slide

  14. cut corners

    View Slide

  15. don't write tests

    View Slide

  16. don't run tests

    View Slide

  17. don't share
    instructions

    View Slide

  18. don't follow
    instructions

    View Slide

  19. are non-deterministic

    View Slide

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

    View Slide

  21. automation is
    pre-commitment

    View Slide

  22. Pre-commit to...

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  26. Pre-commit to testing
    "continuous integration"

    View Slide

  27. Pre-commit to testing
    running tests

    View Slide

  28. Jenkins
    TravisCI
    JuiCI

    View Slide

  29. developer

    View Slide

  30. developer
    remote
    repo
    git push

    View Slide

  31. developer
    remote
    repo
    git push
    CI server
    post

    View Slide

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

    View Slide

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

    View Slide

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

    View Slide

  35. Github integration

    View Slide

  36. Pre-commit to testing
    writing tests

    View Slide

  37. Test driven
    development

    View Slide

  38. Test driven
    bug-fixing

    View Slide

  39. Calculate
    test coverage

    View Slide

  40. Enforce coverage
    in test runs

    View Slide

  41. 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 Slide

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

    View Slide

  43. waterfall
    plan far ahead,
    ship at the end

    View Slide

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

    View Slide

  45. continuous
    ship a feature
    whenever it’s ready

    View Slide

  46. Make dev tasks
    one-step

    View Slide

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

    View Slide

  48. Make deployment
    one-step

    View Slide

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

    View Slide

  50. Feature-flipping

    View Slide

  51. continuous
    ship a feature
    whenever it’s ready

    View Slide

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

    View Slide

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

    View Slide

  54. 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 Slide

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

    View Slide

  56. View Slide

  57. “build recipes,
    not systems”

    View Slide

  58. Babushka
    Chef
    Puppet
    JuJu

    View Slide

  59. View Slide

  60. 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 Slide

  61. thanks!

    View Slide