Unit Testing and Mocking Tools: C/C++, Java, JavaScript, .NET, PHP, Python, Ruby, Flex

 

Ruby Unit Tests Tools

Approval Tests

Unit testing asserts can be difficult to use. Approval tests simplify this by taking a snapshot of the results, and confirming that they have not changed.


Blue Ridge

The Blue Ridge JavaScript Testing Rails Plugin adds support for command-line and in-browser JavaScript unit tests to your Rails app. It bundles several great tools together in a convention-over-configuration, Rails-like way.


Factory Girl

Remove duplication and confusion from your tests using factories. factory_girl allows you to quickly define prototypes for each of your models and ask for instances with properties that are important to the test at hand.


FlexMock

FlexMock is a simple, but flexible, mock object library for Ruby unit testing.


Hardmock

Hardmock is an expectations-driven mock objects tool for Ruby with emphasis on correct and complete call ordering.


heckle

Think you write good tests? Not bloody likely... Put it to the test with heckle. It’ll put your code into submission in seconds.


IronRubyUnit

An IronRuby on Silverlight testing framework that spports Test-Driven Development (TDD).


minitest

minitest/unit is a small and fast replacement for ruby‘s huge and slow test/unit. This is meant to be clean and easy to use both as a regular test writer and for language implementors that need a minimal set of methods to bootstrap a working unit test suite. mini/spec is a functionally complete spec engine. mini/mock, by Steven Baker, is a beautifully tiny mock object framework.


Mocha

Mocha is a library for mocking and stubbing using a syntax like that of JMock, and SchMock. Most commonly Mocha is used in conjunction with Test::Unit, but it can be used in other contexts. One of its main advantages is that it allows you to mock and stub methods on real (non-mock) classes and instances. You can for example stub ActiveRecord instance methods like create, save, destroy and even class methods like find to avoid hitting the database in unit tests. Mocha provides a unified, simple and readable syntax for both traditional mocking and for mocking with real objects.


Nelson

Nelson analyzes a model in your Rails project and provides you with the following: 1. a method to generate a mock object with all required fields supplied 2. a file with stub! and should_receive statements for class and instance methods that can be automagically parsed 3. output of methods that could not be parsed Nelson tries to take all the pain out of mocking ActiveRecord objects.


RSpec

RSpec is the original Behaviour Driven Development framework for Ruby.


SchMock

Simple Ruby mock object implementation knocked together while developing a ruby on rails app. Draws from the jmock stable of mocking.


Shoulda

The Shoulda gem makes it easy to write elegant, understandable, and maintainable Ruby tests. Shoulda consists of test macros, assertions, and helpers added on to the Test::Unit framework. It’s fully compatible with your existing tests, and requires no retooling to use.


Systir

Systir stands for System Testing In Ruby. This doesn’t mean “system testing of Ruby code”; rather, it means we used Ruby to create a tool for helping you automate your system tests. In short, Systir allows you to write system-level tests in a “domain language”; that is, a custom language that pertains to your target software functionality and its own particular constructs.


ZenTest

ZenTest scans your target and unit-test code and writes your missing code based on simple naming rules, enabling XP at a much quicker pace. ZenTest only works with Ruby and Test::Unit.