$30 off During Our Annual Pro Sale. View Details »

Tests for dummies

Tests for dummies

I will present this talk on a virtual meeting with the organizers of the DevOpsDays Vitória.

More details in https://twitter.com/devopsdaysvix/status/1272520235392917504 and https://www.youtube.com/watch?v=lVFdGL4_HGI

Code samples: https://github.com/sebastianwebber/test4dummies

Sebastian Webber

June 17, 2020
Tweet

More Decks by Sebastian Webber

Other Decks in Programming

Transcript

  1. Tests for Dummies v2
    Sebastian Webber

    View Slide

  2. View Slide

  3. https://golang.org/pkg/testing/

    View Slide

  4. Tests
    What are they?

    View Slide

  5. Tests are untested programs that test your
    programs (and not always are made in
    the same programming language).

    View Slide

  6. Do not test your tests.

    View Slide

  7. Why lose waste time writing tests?

    View Slide

  8. lets check
    the DEMO

    View Slide

  9. Example
    function

    View Slide

  10. Basic test

    View Slide

  11. SubTests

    View Slide

  12. Test tables
    and parallel

    View Slide

  13. Running the tests

    View Slide

  14. What about the
    benchmarks?

    View Slide

  15. Basic
    Benchmarks

    View Slide

  16. Sub-benchmarks

    View Slide

  17. Table
    Benchmarks

    View Slide

  18. Running the benchmarks

    View Slide

  19. What about
    the Setup and
    TearDown?

    View Slide

  20. View Slide

  21. References
    1. http://cs-guy.com/blog/2015/01/test-main/
    2. https://github.com/go-br/estudos/tree/master/testing
    3. https://dave.cheney.net/2013/06/30/how-to-write-benchmarks-in-go
    All examples: https://github.com/sebastianwebber/test4dummies

    View Slide

  22. View Slide