Skip to content

Latest commit

 

History

History
175 lines (128 loc) · 3.77 KB

index.md

File metadata and controls

175 lines (128 loc) · 3.77 KB

testing

what testing is

the hot soup problem

  • boxes of hot soup to be delivered
  • how to determine how many parallel packers?

basic test principles

the pyramid

the simple version

^ martin fowler

^ mike cohn

another version

^ anand bagmar

-> google testing blog's 30 min video on unit tests

the blocks

^ pete hodgson

unit tests
  • take the smallest piece of testable software in the application
  • isolate it from the remainder of the code
  • determine whether it behaves exactly as you expect

    wiki

integration tests
  • individual software modules are combined and tested as a group
  When I visit the login page
  And fill out the account signup
  I should receive an email about it
  And I should be logged in
acceptance tests
  • contract
  • the soup should not be cold
  • the soup should not be less than 90 degrees
  • the soup should not be less than 90 degrees Fahrenheit

write tests first

red green refactor

orbit

why you should test

cost of change

light bulb

canary

guide design

near instant feedback

know which X broke Y

testing in action

exercises

tdd game of life

static sites

  • jekyll
  • middleman

broken links

spell checker

cliche checker

dynamic sites

  • sinatra
  • rails
  • express

tests

  • basic login test

front end challenges

  • browsers
  • cache

more examples

mvc

  • unit tests
    describe '#normalize!' do
      it 'normalizes coordinates to "[0,x],[60,y]" form' do
        coordinate = Coordinate.new(300,3,240,4)
        coordinate.normalize!
        expect(coordinate.coordinates).to eq [[0,3], [60,-7]]
      end
    end
  • integration tests

^ flash persistence test

^ hartl's rails tutorial

  • acceptance tests

continuous

tools

JAVASCRIPT

RUBY/RAILS

  • rspec
  • minitest
  • cucumber
  • guard
  • rake
  • binding.pry
  • pry-rescue
  • pry-stack_explorer
  • rspec-given
  • httpie

PYTHON/DJANGO

  • lettuce
  • behave

browser

  • postman

shell

  • curl
curl "localhost:4000"

the end

testing_over ^ play this game