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

Quid Est Testing?

Quid Est Testing?

What are the basics of testing? How do we test?

Given to the RIT Society of Software Engineers in 2009. http://sse.se.rit.edu/

Nick Quaranto

January 12, 2012

More Decks by Nick Quaranto

Other Decks in Programming


  1. quid est testing? nick quaranto

  2. 5th year SE & CS major ruby fanatic bills fan

    @qrush litanyagainstfear.com
  3. http://quid.heroku.com

  4. what is testing?

  5. None
  6. None
  7. not: refreshing compiling for someone else to do

  8. empirical investigation conducted to provide stakeholders with information about the

    quality of the product or service under test wikipedia
  9. tl;dr

  10. the process of executing a program or system with the

    intent of finding errors the art of software testing
  11. closer...

  12. clean code that works

  13. acceptance testing integration testing functional testing unit testing

  14. acceptance testing integration testing functional testing unit testing

  15. what is a unit?

  16. programmer tests

  17. define what it means for the code to work

  18. why should I test?

  19. predictability have a process know you are finished

  20. tighter feedback loops running code informs decisions learn lessons faster

  21. dependability build trust know immediately when you break something

  22. loose coupling easy to test not just a buzzword

  23. how do you test?

  24. setup exercise verification teardown

  25. same process for any language test methods run in isolation

    let's do some ruby
  26. require 'test/unit' class BillsPlayerTest < Test::Unit::TestCase def test_to_is_a_tad_bit_hyped end end

  27. setup terrell_owens = BillsPlayer.new

  28. exercise terrell_owens.overpaid?

  29. verification assert

  30. other assertions assert_equal "wide receiver", terrell_owens.position assert_not_nil terrell_owens.number assert_raises InterceptionError

    do terrell_owens.miss_route! end
  31. class BillsPlayerTest < Test::Unit::TestCase def test_to_is_a_tad_bit_hyped terrell_owens = BillsPlayer.new assert

    terrell_owens.overpaid? end end
  32. class BillsPlayerTest < Test::Unit::TestCase def setup @terrell_owens = BillsPlayer.new end

    def test_to_is_a_tad_bit_hyped assert @terrell_owens.overpaid? end def teardown # bills lose, again :[ end end
  33. so what? production errors due to uncomprehensive tests often done

    after the code is written if not automated, not preformed frequently and so on...
  34. test driven development

  35. you, the developer, write the tests! write tests before implementation

    new code only when an automated test fails take small steps
  36. the process write a test watch it fail write just

    enough code to make it pass
  37. let's do this

  38. feedback loop red green refactor

  39. refactor eliminate duplication rename single responsibility and so on...

  40. tdd is about design design is a process, not a

    phase think about the interface before implementation
  41. when do I test?

  42. TATFT

  43. the drawbacks

  44. all walk, no talk easier with a pair team buy-in

  45. some thoughts...

  46. it's ok not to test!

  47. testing vs. spiking

  48. dependencies fakes stubs mocks

  49. find a coop (or job) that helps you test

  50. ask about policies on testing

  51. TATFT