Developer Testing Tricks

Brian Takita (Pivotal Labs)
Tutorial
Location: E145 - E146
Average rating: **...
(2.25, 20 ratings)
By going over a number of testing technologies, methodologies, and code, this talk will:
  • present a set of testing related situations and experience in solving a number of issues
  • raise the audiences’ awareness over effective ways of communicating through tests
  • emphasize skills and courage to solve testing issues

Most of the examples will use rspec (and some using test/unit) and focus on testing strategies in different situations. The concepts are applicable to rspec and test/unit or derivative technologies.

I will go over:
  • Empirical software development – Automated vs Manual testing
  • When to do automated testing
  • Developer vs Customer Acceptance tests
  • Tests as communication (specifications and examples)
  • The lifecycle of a test and how testing strategies/refactorings change over the life of the test
    • TDDBrian Takita worked at Pivotal Labs 3 years doing TDD with Rails and Ruby. He works with some of the best talent in the software development industry. Brian has also worked on a number of open source projects including:
  • rspec (core contributor)
  • SeleniumrcFu plugin
  • RR mock framework
  • Desert plugin framework
    • Regression Test
    • Death of the Test
  • Code coverage vs Logical coverage
  • The parts of a test and how to use each part to communicate the intent, situation, and conditions of the test.
    • Preconditions
    • Execution
    • Postconditions
  • Spec/Test tools for organization
    • Example names (Test::Unit method names)
    • Using before and after callbacks to help set up your preconditions and postconditions (Test::Unit #setup and #teardown methods)
    • Nested describes (Test::Unit subclassing)
    • Shared Behaviour (Modules)
    • “Macros” (class methods that generate tests a la Shoulda)
  • Different ways to organize test/specs with their advantages/disadvantages
    • One ExampleGroup (TestCase) per situation
    • One Example (test) per condition
    • One Example testing several conditions
    • Variable names to check different scenarios
  • Unit Testing and Functional Testing
    • What are the goals of each approach
    • Can you do just functional testing? (it depends)
    • Your unit can be more than one object (Unit of concern)
  • Productivity
    • TDD rhythm
    • Test execution time (Speed matters)
      • Tools to improve execution time
  • Mocks and their advantages / disadvantages
    • Do mocks make your test simpler or more complicated?
    • Prefer to use the front door (state based testing)
    • When are mock the only reliable way to test something
    • When do they make more sense to use that state based testing
    • When do they not make more sense to use that state based testing
    • Using mocks to clarify the test (even state based tests)
    • Using the mock proxy pattern to get mock validations while calling the real method
  • Rails fixtures
    • Best practices for using fixtures
    • Testing your fixtures
  • Object Mother
  • Test fragility
  • Test consolidation / expansion
  • How to make refactorings easier with tests
  • Selenium and where it makes sense
  • Selenium and where it makes sense
    • Making your Selenium tests easy to write and read using a DSL
    • Handling Selenium concurrency
  • Testing Javascript
    • Testing rjs
    • JSunit
  • Special situations
    • Testing concurrency
    • Testing already implemented code (legacy apps)
    • Client/server testing with Ajax

Brian Takita

Pivotal Labs

Brian Takita worked at Pivotal Labs 3 years doing TDD with Rails and Ruby. He works with some of the best talent in the software development industry. Brian has also worked on a number of open source projects including:
  • rspec (core contributor)
  • SeleniumrcFu plugin
  • RR mock framework
  • Desert plugin framework
  • Rubinius
News and Coverage
co-presented by Ruby Central, Inc. O'Reilly
  • Engine Yard
  • Sun Microsystems
  • FiveRuns
  • GotThingsDone
  • Heroku
  • ThoughtWorks
  • Atlantic Dominion Solutions
  • Blue Box Group
  • CodeGear
  • E-xact
  • ELC Technologies
  • EnterpriseDB
  • GemStone Systems
  • Intridea
  • Morph Labs
  • RightScale
  • TechRepublic

Sponsorship Opportunities

For information on exhibition and sponsorship opportunities at RailsConf, contact Yvonne Romaine.

Download the RailsConf Sponsor/Exhibitor Prospectus

Media and Promotional Opportunities

Download the Media & Promotional Partner Brochure (PDF) for more information on trade opportunities with O'Reilly conferences, or contact mediapartners@ oreilly.com.

Program Ideas

Post your suggestions for speakers, topics, and activities on the RailsConf wiki or send an email to rails-idea@oreilly.com.

Press and Media

For media-related inquiries, contact confpr@oreilly.com.

Contact Us

View a complete list of RailsConf 2008 contacts.