In OO programming a unit is often a class, but could be also quite often a specific method of a class. This applies also to Java programming language.
Unit tests often verify the API’s contract. This means that it check that the code does what is expected to do.
Junit framework offers the posibility to create automated unit tests. There are also other similar frameworks
Similar to JUnit framework, unit testing frameworks for other programming languages were developed. The name XUnit was given to the collection of all these frameworks.
According to Martin Fowler’s article on XUnit :
XUnit is the family name given to bunch of testing frameworks that have become widely known amongst software developers. The name is a derivation of JUnit the first of these to be widely known.
Unit testing frameworks/tools for the web:
Framework/Tool | Description |
HtmlUnit | Java headless browser emulator |
HttpUnit | testing framework for web applications, typically used in combination with JUnit |
IEUnit | testing framework for web applications, based on IE browser and Javascript |
Selenium | Testing framework whose playback can run in most modern web browsers to test webpages. |
Watir | Testing framework based on the Ruby language, that can run in web browsers to test webpages. |
soapUI | Open source web service testing tool for service-oriented architectures (SOA). |
SOAtest | Parasoft SOAtest automates web application testing, message/protocol testing, cloud testing and security testing. |
Java unit testing frameworks:
Framework/Tool | Description |
JUnit | Unit testing framework for Java language. |
TestNG | An integration testing framework, which means its tests include unit tests, functional tests, and integration tests. |
JExample | A JUnit extension that uses dependencies between test cases to reduce code duplication and improves defect localization. |
DbUnit | A JUnit extension to perform unit testing with database-driven programs |
JUnitEE | A JUnit extension for testing Java EE applications |
Cactus | A JUnit extension for testing Java EE and web applications. Cactus tests are executed inside the Java EE/web container. |
JSST | Java Server-Side Testing framework which is based on the similar idea to the one of Apache CACTUS, but unlike CACTUS it’s not coupled to JUnit 3.x and can be used in conjunction with any testing framework. |
GroboUtils | A JUnit extension providing Automated documentation, class hierarchy unit testing, code coverage, and multi-threaded tests. |
Mockrunner | Mockrunner A JUnit extension for testing testing servlets, filters, tag classes and Struts actions and forms. |
Unitils | Offers general utilities and features for helping with persistence layer testing and testing with mock objects. Offers specific support for testing application code that makes use of JPA, hibernate and spring. Unitils integrates with the test frameworks JUnit and TestNG. |
XMLUnit | JUnit and NUnit testing for XML |
JMock | A mock framework |
EasyMock | A mock framework |
Mockito | A mock framework, using the Hamcrest library |
PowerMock | An extension to both Mockito and EasyMock that lets you test static methods |
Concutest | A framework for testing concurrent programs |
JBehave | Behavior Driven Development |
Instinct | Behavior Driven Development |
JDave | Behavior Driven Development |
beanSpec | Behavior Driven Development |
JavaScript unit testing frameworks:
Framework/Tool | Description |
DOH | Dojo Objective Harness that can be run in-browser or independently via Rhino |
JSUnit | Open source Unit Testing framework for client-side (in-browser) JavaScript. It is essentially a port of JUnit to JavaScript. JSUnit is no longer actively maintained. |
QUnit | jQuery test harness |
Crosscheck | Browserless java-based framework |
J3Unit | An object-oriented unit testing framework for JavaScript. J3Unit runs JavaScript tests directly in the web browser and can be automated using JUnit and Jetty. J3Unit builds on previous work by JSUnit and Script.aculo.us to provide a better way to automate JavaScript unit tests. |
YUI Test | Testing framework developed by YAHOO for browser-based JavaScript solutions. Using YUI Test, you can easily add unit testing to your JavaScript solutions. While not a direct port from any specific xUnit framework, YUI Test does derive some characteristics from nUnit and JUnit./td> |
JSSpec | Behaviour-driven development framework |
UnitTesting | script.aculo.us javascript test harness |
Jasmine | BDD, framework independent, easy integration with Ruby projects and continuous builds. Allows for both DOM-less testing and asynchronous testing. |
RhinoUnit | Rhino-based framework that allows tests to be run in Ant |
JasUnit | Light-weight framework. Part of a project that provides Mocks and IoC.) |
FireUnit | Testing framework that provides logging and viewing within a new tab of Firebug |
Js-test-driver | The goal of JsTestDriver is to build a JavaScript test runner which easily integrates with continuous builds systems and allows running tests on multiple browsers quickly to ease TDD style development. |
Js-test-runner | A JUnit test runner that runs JS tests. The goal of the JS Test Runner is to be able to test JS code using an approach that test driven programmers will feel comfortable with; particularly in the context of Continuous Integration. |
Nodeunit | Asynchronous Javascript testing framework |
Language | Framework | Description | xunit |
Adobe Flex & ActionScript | FlexUnit 4 | Metadata-driven unit testing for Flex 2,3 and 4 and ActionScript 3 projects | yes |
Adobe Flex & ActionScript | FUnit | Metadata-driven unit testing for Flex | yes |
ASP | ASPUnit | ||
BPEL | BPELUnit | ||
C | AceUnit | AceUnit is JUnit 4.x style, easy, modular and flexible. | yes |
C | CUnit | OS Independent | yes |
C++ | CppUnit | yes | |
C++ | CPUnit | yes | |
C++ | Google C++ Testing Framework | yes | |
C++ | Symbian OS Unit | ||
CFML (ColdFusion) | MXUnit | Unit Test Framework and Eclipse Plugin for CFML (ColdFusion) | yes |
Groovy | Spock | ||
Haskell | HUnit | yes | |
LabVIEW | VI Tester | Native LabVIEW object-oriented implementation of xUnit framework. Unit tests are written as VIs in LabVIEW. | yes |
MATLAB | MATLAB xUnit Test Framework | Accepts both xUnit-style subclass or simple MATLAB function test cases. | yes |
MySQL | utMySQL | Unit test framework for MySQL V 5 using stored procedures. | yes |
Perl | TAP | the Test Anything Protocol used by most Perl tests | |
Perl | Test::Class | xUnit style testing adapted to Perl | yes |
Oracle PL/SQL | utPLSQL | An open source unit testing framework for PL/SQL development modeled on the Junit and xUnit frameworks. | yes |
Oracle PL/SQL | PL/SQL Unit Testing for Oracle (PLUTO) | Open source unit testing framework modeled after JUnit and based on the Oracle PL/SQL object system | yes |
Prolog | PlUnit | ||
Python | PyUnit | it’s part of Python’s standard library | yes |
Ruby | Test::Unit | ||
Ruby | RSpec | Behaviour-driven development framework | |
Transact-SQL | tSQLt | Database unit testing framework for Microsoft SQL Server. Includes mocking framework, continuous integration support and uses SQL Test as a GUI |
|
XML | XUnit | For testing: native XML programs, individual XSLT templates, and Java programs that deal with XML data. | |
XML | WUnit | For testing Web applications.Tests are written in XML/XPath (XUnit).AJAX applications are supported, Can also test server-side functionalities if they are made with Java servlets (for example, it is possible to store authoritatively an object in the user session server-side without sending an HTTP request and then get with HTTP the page that renders it). | |
.NET | xUnit.net | Developed by the original inventor of NUnit to be its successor. xUnit.net is currently the highest rated .NET unit testing framework due to it being leaner with a more refined syntax and lower friction usage then NUnit. | yes |
.NET | csUnit | includes GUI, command line, VS2005 plug-in; supports C#, VB.NET, Managed C++, J#, other .NET languages, supports .NET 3.5 and earlier versions; integrated with ReSharper | yes |
.NET | DbUnit.NET | A .NET 2.0 unit testing framework for database access code |
No comments:
Post a Comment