CSC/ECE 517 Fall 2011/ch2 2e ad: Difference between revisions
Line 48: | Line 48: | ||
! #Testing Supported|Testing Type Supported | ! #Testing Supported|Testing Type Supported | ||
! #Install Command|Install Command | ! #Install Command|Install Command | ||
! Documentation Support | ! Documentation/Version Support | ||
|- | |- | ||
! Test:Unit | ! Test:Unit | ||
Line 56: | Line 56: | ||
| TDD,Mocking | | TDD,Mocking | ||
| gem install test-unit | | gem install test-unit | ||
| [http://rubyforge.org/projects/test-unit/ Test:Unit Site] | | [http://rubyforge.org/projects/test-unit/ Test:Unit Site] [http://rubyforge.org/frs/?group_id=5650 All Available Versions] | ||
|- | |- | ||
! Shoulda | ! Shoulda |
Revision as of 18:06, 19 September 2011
Testing frameworks for Ruby
Introduction
This is an introduction to the subject.
Definition
Test Driven Development (TDD)
Behavior Driven Development(BDD)
Mocking in Testing
Benchmarking in Testing
Testing Framework
Testing Framework Evolution
Explain here how testing in ruby went from regular Test:unit testing to BDD testing.
TDD vs BDD
Give high level example how they differ from each other.
Ruby Testing Frameworks
Compared to five years ago the number of testing framework available for ruby has increased rapidly. Selecting a perfect testing framework for a particular project has become harder.
Overview of testing framework
Selection of testing framework for ruby projects depends on factors like what are we trying to accomplish TDD or BDD, is GUI testing included, is acceptance testing required, do we have to merge legacy ruby test code with new testing framework. Altough GUI testing and acceptance testing are out of scope for this wiki we have made attempt to cover them in some details at the end of this wiki page. Meanwhile, below is the detailed explanation of five most commonly used unit testing framework.
Test:Unit
This testing framework is a base testing framework that is integrated inside ruby. The packages for this testing framework can be downloaded as a gem. The first version gem for this testing framework was released on 20th march 2008.
Shoulda
RSpec
Riot
Mini
Pros And Cons of Ruby Testing Frameworks
Testing Framework | Released Date | Released Version | Current Version | Testing Type Supported | Install Command | Documentation/Version Support |
---|---|---|---|---|---|---|
Test:Unit | 03-20-2008 | 1.2.3 | 2.3.0 | TDD,Mocking | gem install test-unit | Test:Unit Site All Available Versions |
Shoulda | 03-20-2008 | 1.2.3 | 2.3.0 | TDD,Mocking | gem install test-unit | Test:Unit Site |
RSpec | 03-20-2008 | 1.2.3 | 2.3.0 | TDD,Mocking | gem install test-unit | Test:Unit Site |
Riot | 03-20-2008 | 1.2.3 | 2.3.0 | TDD,Mocking | gem install test-unit | Test:Unit Site |
MiniTest | 03-20-2008 | 1.2.3 | 2.3.0 | TDD,Mocking | gem install test-unit | Test:Unit Site |
Cucumber | 03-20-2008 | 1.2.3 | 2.3.0 | TDD,Mocking | gem install test-unit | Test:Unit Site |
Examples
Actual Code being tested (Intro of functionality)
Test:Unit testing code
Shoulda testing code
RSpec testing code
Riot testing code
Mini testing code
Example code goes here
Additional Testing Framework
UI Testing Framework
Context
Win32-AutoGUI
Acceptance testing
Cucumber
Capybara
References
- [1] Ruby Forge Test:Unit Site
- [2] Shay Friedman A Mini-Review-Benchmark of Ruby’s Different Testing Frameworks
Note
There are many testing frameworks for Rails, but for this topic, I would like you to concentrate on testing frameworks for Ruby itself. Look up information on these frameworks, and describe their evolution.