Posted on 10-06-2008
Filed Under (Conferences) by Dary

More nuggets:

Advanced RESTful Rails by Ben Scofield (Viget Labs)
Pick out the nouns from your app to determine the resources
Decide what methods to expose to those resources
Ajax actions generally use middle man which is a join model

Fast, Sexy, and Svelte: Our Kind of Rails Testing Dan Manges (ThoughtWorks), Zak Tamsen (ThoughtWorks)

Unit Test

  • one method or object being tested at a time
  • Avoiding Unit Test Britleness:
  • gem “unit_record”
  • ActiveRecord::Base.disconnect! keeps tests from hitting db
  • To avoid db you could use fixtures (Difficult because you need to go back and forth to the fixture file)
  • Or you could construct the object

Functional Testing Speed

  • Gonna be slower – involve more objects and hit the db
  • DeepTest speeds up functional tests
  • Read DeepTest gem ReadMe to set up distributed tests – SUPER FAST!

Integration Tests

  • Sometimes useful for special purpose tests
    • performance tests
    • smoke tests
    • tests simulating multiple users

Acceptance tests

  • Better for low levels of granularity
  • Selenium RC – way to control the browser
  • Writing Acceptance Tests:
    • Encapsulate Pages
    • Data Access:
      • Can use Factory again to create entries
    • Parallelization – multiple Selenium RCs

Integration Testing with RSpec's Story Runner by David Chelimsky (Articulated Man, Inc)

  • Process
    1. Feature Injection
    2. Focus on outputs
    3. Acceptance Criteria – if tests pass, customer accepts it
  • Popping the “Why?” stack – ask “Why?” until value comes out

Integration Testing:

  • Make sure the component parts play nice together
  • Automated User Stories/Scenarios
    • Document the expected behavior of the system
    • Verify that behavior by executing a thin vertical slice of the system
    • Narrative Format: identify goal, user, action
    • Should test edge cases!
      • ex. goal of 200, 1 should return 1% and 199 should return 99%
    • Store DOM in memory
    • manipulates DOM
    • builds POST from DOM
  • Webrat Ruby gem (http://github.com/brynary/webrat)

Selenium RC (lets you test JavaScript/AJAX & you can watch it!)

  • Because it’s slow you should only use for AJAX and use Webrat otherwise
  • Multiple Sessions

The Great Test Framework Dance-off by Josh Susser (Pivotal Labs)

  • RSpec for the structural level
  • Shoula for test cases
  • Test/unit for assertions
  • Refactor with shoulda
    Read More   

Comments

[…] **Please see my follow-ups on individual days: Friday, Saturday** […]


Post a Comment
Name:
Email:
Website:
Comments: