Slide 1

Slide 1 text

quid est testing? nick quaranto

Slide 2

Slide 2 text

5th year SE & CS major ruby fanatic bills fan @qrush litanyagainstfear.com

Slide 3

Slide 3 text

http://quid.heroku.com

Slide 4

Slide 4 text

what is testing?

Slide 5

Slide 5 text

No content

Slide 6

Slide 6 text

No content

Slide 7

Slide 7 text

not: refreshing compiling for someone else to do

Slide 8

Slide 8 text

empirical investigation conducted to provide stakeholders with information about the quality of the product or service under test wikipedia

Slide 9

Slide 9 text

tl;dr

Slide 10

Slide 10 text

the process of executing a program or system with the intent of finding errors the art of software testing

Slide 11

Slide 11 text

closer...

Slide 12

Slide 12 text

clean code that works

Slide 13

Slide 13 text

acceptance testing integration testing functional testing unit testing

Slide 14

Slide 14 text

acceptance testing integration testing functional testing unit testing

Slide 15

Slide 15 text

what is a unit?

Slide 16

Slide 16 text

programmer tests

Slide 17

Slide 17 text

define what it means for the code to work

Slide 18

Slide 18 text

why should I test?

Slide 19

Slide 19 text

predictability have a process know you are finished

Slide 20

Slide 20 text

tighter feedback loops running code informs decisions learn lessons faster

Slide 21

Slide 21 text

dependability build trust know immediately when you break something

Slide 22

Slide 22 text

loose coupling easy to test not just a buzzword

Slide 23

Slide 23 text

how do you test?

Slide 24

Slide 24 text

setup exercise verification teardown

Slide 25

Slide 25 text

same process for any language test methods run in isolation let's do some ruby

Slide 26

Slide 26 text

require 'test/unit' class BillsPlayerTest < Test::Unit::TestCase def test_to_is_a_tad_bit_hyped end end

Slide 27

Slide 27 text

setup terrell_owens = BillsPlayer.new

Slide 28

Slide 28 text

exercise terrell_owens.overpaid?

Slide 29

Slide 29 text

verification assert

Slide 30

Slide 30 text

other assertions assert_equal "wide receiver", terrell_owens.position assert_not_nil terrell_owens.number assert_raises InterceptionError do terrell_owens.miss_route! end

Slide 31

Slide 31 text

class BillsPlayerTest < Test::Unit::TestCase def test_to_is_a_tad_bit_hyped terrell_owens = BillsPlayer.new assert terrell_owens.overpaid? end end

Slide 32

Slide 32 text

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

Slide 33

Slide 33 text

so what? production errors due to uncomprehensive tests often done after the code is written if not automated, not preformed frequently and so on...

Slide 34

Slide 34 text

test driven development

Slide 35

Slide 35 text

you, the developer, write the tests! write tests before implementation new code only when an automated test fails take small steps

Slide 36

Slide 36 text

the process write a test watch it fail write just enough code to make it pass

Slide 37

Slide 37 text

let's do this

Slide 38

Slide 38 text

feedback loop red green refactor

Slide 39

Slide 39 text

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

Slide 40

Slide 40 text

tdd is about design design is a process, not a phase think about the interface before implementation

Slide 41

Slide 41 text

when do I test?

Slide 42

Slide 42 text

TATFT

Slide 43

Slide 43 text

the drawbacks

Slide 44

Slide 44 text

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

Slide 45

Slide 45 text

some thoughts...

Slide 46

Slide 46 text

it's ok not to test!

Slide 47

Slide 47 text

testing vs. spiking

Slide 48

Slide 48 text

dependencies fakes stubs mocks

Slide 49

Slide 49 text

find a coop (or job) that helps you test

Slide 50

Slide 50 text

ask about policies on testing

Slide 51

Slide 51 text

TATFT