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

Frontend Testing

Frontend Testing

Test All The Things: Code hinting, unit testing, functional testing.

Sebastiaan Deckers

April 01, 2013
Tweet

More Decks by Sebastiaan Deckers

Other Decks in Programming

Transcript

  1. Test all the things!
    Code hinting
    Unit testing
    Functional testing

    View full-size slide

  2. Frontend :(
    ● Testing is hard weird
    ● Not sure what to test
    ● TIMTOWTDI

    View full-size slide

  3. How I learned to
    stop worrying
    and love tests.

    View full-size slide

  4. Why
    How I learned to
    stop worrying
    and love tests.

    View full-size slide

  5. editor holy war
    hard vs soft tabs
    code readability
    syntax consistency
    team.length > 1

    View full-size slide

  6. comments are lies
    documentation is fiction
    intent !== effect
    document behaviour, not implementation
    // this is not a doc

    View full-size slide

  7. downtime is $
    never deploy a broken app
    env.production = true;

    View full-size slide

  8. N builds / day
    triggered by any developer
    who broke the build?
    ship it

    View full-size slide

  9. It's the little things:
    line length, camel casing, tabs/spaces, ...
    Benevolent dictator of syntax
    JSHint

    View full-size slide

  10. nodeunit
    DRY bug fixing
    Behaviour is documented,
    implementation is verified.
    "How did that utility work again?"

    View full-size slide

  11. CasperJS
    Run high-level tests on a headless WebKit
    "Do all our features still work?"

    View full-size slide

  12. Demo
    https://github.com/cbas/demo-testing
    https://travis-ci.org/cbas/demo-testing

    View full-size slide

  13. I am Sebastiaan
    I email [email protected]
    I blog ninja.sg
    I work cf.sg
    I code git.io/seb

    View full-size slide