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

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

More Decks by Sebastian Webber

Other Decks in Programming


  1. Tests for Dummies v2 Sebastian Webber

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

  4. Tests What are they?

  5. Tests are untested programs that test your programs (and not

    always are made in the same programming language).
  6. Do not test your tests.

  7. Why lose waste time writing tests?

  8. lets check the DEMO

  9. Example function

  10. Basic test

  11. SubTests

  12. Test tables and parallel

  13. Running the tests

  14. What about the benchmarks?

  15. Basic Benchmarks

  16. Sub-benchmarks

  17. Table Benchmarks

  18. Running the benchmarks

  19. What about the Setup and TearDown?

  20. None
  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

  22. None