Developer Testing Tricks
- 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
People planning to attend this session also want to see:
Brian Takita
Pivotal Labs
- rspec (core contributor)
- SeleniumrcFu plugin
- RR mock framework
- Desert plugin framework
- Rubinius






















