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


Java Unit Tests Tools


The AgitarOne product family helps you work safer, better, and smarter as you develop and maintain your Java applications. AgitarOne JUnit Generator creates thorough JUnit tests on your code. This helps you find regressions and makes it safer and easier to improve your code to reduce the cost to maintain it. AgitarOne Agitator helps developers understand the behavior of their code as they write it. This helps you prevent bugs and prevent code complexity that can become tomorrow's maintenance headache.

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.

Artima SuiteRunner

Artima SuiteRunner is a free open source testing toolkit for Java released under the Open Software License. You can use this tool with JUnit to run existing JUnit test suites, or standalone to create unit and conformance tests for Java APIs. The three main advantages Artima SuiteRunner offers to JUnit users are reporters, runpaths, and recipe files. Existing JUnit users can use SuiteRunner to run their JUnit tests, which allows them to gain the benefits of reporters, runpaths, and recipe files while continuing to use their JUnit test cases.


BDoc documents behaviour specified by unit tests. In its easiest form it is like TestDox, creating simple documentation from the method names in JUnit test cases.


Bumblebee is a framework that builds on top of JUnit to create documentation by example.


Cactus is a simple test framework for unit testing server-side java code (Servlets, EJBs, Tag Libs, Filters, ...). The intent of Cactus is to lower the cost of writing tests for server-side code. It uses JUnit and extends it. Cactus implements an in-container strategy, meaning that tests are executed inside the container.


Cantata++ is designed as a software testing tool for use mainly with C, C++, but with some useful functionality for Java. It combines the ability to generate test scripts with test coverage analysis. It can be run on all main host platforms (Windows, Linux, Solaris and others), with the same as target platforms plus many embedded platforms. Using Eclipse as the basis for its IDE Cantata++ is able to lead the user through the generation of a template test script, leaving to the user the need only to add chosen input values and expected outputs. The tool also provides the ability to simulate external calls, by means of stub and wrapper functionality. Coverage analysis includes support for Entry Point, Statement, Decision (branch) and Decision coverage.


Carma is a tool which validates the quality of your product by analyzing your test cases. It clearly identifies gaps in your test cases and reports the conditions which certainly require additional and/or enhanced test cases.


Checkstyle is a development tool to help programmers write Java code that adheres to a coding standard. It automates the process of checking Java code to spare humans of this boring (but important) task. This makes it ideal for projects that want to enforce a coding standard. Checkstyle is highly configurable and can be made to support almost any coding standard. An example configuration file is supplied supporting the Sun Code Conventions. As well, other sample configuration files are supplied for other well known conventions.


ClassMock is a framework that helps the creation of unit tests for components that use reflection or annotations. In this kind of classes, the behavior is dependent of the class structure. This way, each test case usually works with a different class created specifically for the test. With ClassMock is possible to define and generate classes in runtime, allowing a better test readability and logic sharing between tests.

CodePro AnalytiX

CodePro Analytix is a comprehensive set of software analysis tools composed of a collection of native Eclipse plugins. CodePro seamlessly integrates into any Eclipse based Java desktop development environment, adding static code analysis (with nearly 1,000 audit rules), metrics, automated test generation, JUnit test editing, and team collaboration functionality. Extensive security audit rules were recently added to enable developers to automatically detect and address security vulnerabilities as they are writing code, thus closing the opportunities for potential malicious users, and focusing on quality earlier in the software development lifecycle (SDLC). Seamless integration with Eclipse, IBM Rational, JBuilder and MyEclipse.


Concordion is an open source framework for Java that lets you turn a plain English description of a requirement into an automated test — an active specification.


CT-Eclipse (Continuous Testing for Eclipse) builds on the automated developer support in Eclipse to make it even easier to keep your Java code well-tested, if you have a JUnit test suite. With CT-Eclipse enabled, as you edit your code, Eclipse runs your tests quietly in the background, and notifies you if any of them fail or cause errors. It is most useful in situations where you would already have a test suite while you are changing code: when performing maintenance, refactoring, or using test-first development. CT-Eclipse includes the ability to run tests in a prioritized order, and to filter out irrelevant tests. We have found that with tests run so often, a simple "Most Recently Failed First" metric is sufficient to achieve very good prioritization. You may have more sophisticated ideas about prioritizing and filtering tests--these can be contributed as plug-ins to the extension points provided by CT-Eclipse.


DDSteps is a JUnit extension for building data driven test cases. In a nutshell, DDSteps lets you parameterize your test cases, and run them more than once using different data. Since DDSteps is 100% JUnit compatible, you can run your new data driven test cases just like any old JUnit test case. No IDE plugins or new Ant tasks are required - just add the DDSteps jars to your classpath and you are ready to go! DDSteps uses external test data (in Excel) which is injected into your test case using standard JavaBeans properties. Your test case is run once for each row of data, so adding new tests is just a matter of adding a row of data in Excel. DDSteps integrates best-of-breed toolkits for web and database testing, such as JWebUnit, DbUnit and Spring Framework. By making these toolkits data driven, you can do powerful function testing. Automated end-to-end testing of your website is not only possible - it is easy.


DepUnit is designed with the belief that in any complicated system the unit tests build upon one another. In many unit test frame works there is a considerable amount of effort put into allowing the tester to setup and tear down the environment so that the tests can be performed. We believe that this setup and tear down procedure should be a unit test as well. For example a connection needs to be made to the database before unit tests can be performed on the data. The connection process should be a unit test and the other tests depend on it to succeed. With this in mind DepUnit lets you create what we call hard and soft dependencies between tests. DepUnit also allows for clean up tests that perform the tear down of other frameworks. DepUnit is also designed with the idea that data is at the heart of all unit tests. Unit tests usually test a system with some given set of data. DepUnit provides easy mechanisms for passing data into unit tests and passing data from one test to another. DepUnit also provides an easy way to run the same tests multiple times with different data.


djUnit plugin is JUnit TestRunner with the custom classloader. djUnit ClassLoader modifies class in loading to JVM, and runs tests using the modified class. The following functions can now be used easily. djUnit can perform tests of JUnit, and useage is easy(same as JUnit). djUnit uses jcoverage to generate a coverage report of the performed tests, and it can be checked on Eclipse. The results are shown on djUnit coverage view , task list and java source editor


DrJava is a lightweight development environment for writing Java programs. It is designed primarily for students, providing an intuitive interface and the ability to interactively evaluate Java code. It also includes powerful features for more advanced users. DrJava is available for free under the BSD License, and it is under active development by the JavaPLT group at Rice University.


easyb is a behavior driven development framework for the Java platform. By using a specification based Domain Specific Language, easyb aims to enable executable, yet readable documentation.


EasyMock provides Mock Objects for interfaces in JUnit tests by generating them on the fly using Java's proxy mechanism. Due to EasyMock's unique style of recording expectations, most refactorings will not affect the Mock Objects. So EasyMock is a perfect fit for Test-Driven Development.


The Ejb3Unit project automates Entity and Session bean testing outside the container for the EJB 3.0 specification.


Feed4JUnit makes it easy to write parameterized tests for the JUnit framework and feed them with predefined or random test data. It enables you to improve your testing easily.


FindBugs is a program which uses static analysis to look for bugs in Java code. FindBugs requires JRE (or JDK) 1.4.0 or later to run. However, it can analyze programs compiled for any version of Java.


Grester is a Maven2 Plugin for the Jester Tool, written entirely in Groovy. It was born out of a need to quickly test junit tests with Jester from within Maven projects.


GroboUtils aims to expand the testing possibilities of Java. It contains many sub-projects which experiment with different aspects of testing through Java. The popular tools included with GroboUtils include multi-threaded tests, hierarchial unit tests, and a code coverage tool.


GuiceBerry brings the joys of dependency injection to your test cases and test infrastructure. It leverages Guice to accomplish this. It allows you to use a composition model for the services your test needs, rather than the traditional extends MyTestCase approach. GuiceBerry does not supplant your JUnit testing framework -- it builds on top of it (and works around it, when necessary), so you can run your tests normally, from your favorite command line or IDE environment.


Testing framework to test GWT application, without GWTTestCase, running in a standard JVM and using standard tests tools : JUnit, Easymock, reflection ... gwt-test-utils enable Unit Test in a standard JVM by modifying GWT classes on the fly with a specific java agent : all JSNI methods are replace with Java code.


Haste represents an approach to system testing that is philosophically consistent with standard XP unit testing practices. Test code runs in the same address space as the application under test, allowing for ready examination of application state. The fundamental Haste abstractions of Story, Step, and StoryBook provide a framework to implement system tests. Utility classes simplify test development. In addition to acting as XP acceptance tests, Haste tests aid source maintenance and extension, and can play an important role in a release process.


HttpUnit makes easy to bypass the browser and access your site from a program. Written in Java, HttpUnit emulates the relevant portions of browser behavior, including form submission, JavaScript, basic http authentication, cookies and automatic page redirection, and allows Java test code to examine returned pages either as text, an XML DOM, or containers of forms, tables, and links.


JBehave is a java-based framework designed to encourage collaboration between Developers, QAs, BAs, business and other team members through automated scenarios. Behaviour-driven development (BDD) is an evolution of test-driven development (TDD) and acceptance-test driven design, and is intended to make these practices more accessible and intuitive to newcomers and experts alike.


JDepend traverses Java class file directories and generates design quality metrics for each Java package. JDepend allows you to automatically measure the quality of a design in terms of its extensibility, reusability, and maintainability to manage package dependencies effectively.


jDiffChaser is a Java Open Source Software that automates visual GUI comparisons between two versions of a Swing application. jDiffChaser plays previously recorded scenarios and takes a screenshot of the last production version GUI rendering and another screenshot of the current development version. Then it compares both screens, finds the differences between them and lists all in a html report. Of course you can define zones to ignore during comparisons. Scenarios can be played locally on a single host, that means sequentially, or they can be played at the same time on two hosts when real time data is needed by the tested application.


JEasyTest is an Eclipse IDE plugin created to simplify unit testing of code that is hard to test using standard mock objects frameworks, as for example code using legacy code. JEasyTest uses AspectJ load-time bytecode modification "to inject mock invocations" (constructor and static method invocations) in which we are not allowed to use standard mock object tools (this technique is also known as Virtual Mock Objects). JEasyTest has been thought to be integrated with existing mock object frameworks to overcome some of their limitations. Throughout a literate API, the border between the code under test and the test itself nearly disappears and the concept of endo-testing is moved a step forward: the testing context, and only this, becomes a privileged environment from where we can set expectations as if we were inside the code to be tested.


JellyUnit is a Jelly based JUnit testing mechanism. This allows Jelly scripts to be used to perform unit testing which can be particularly useful if you wish to test XML, XPath, SQL, HTTP, JMS or SOAP interactions. JellyUnit works by using the JUnit library in a Jelly script to create JUnit TestSuite and TestCase objects. There are all the usual JUnit assertion tests available such as and . You can use both Jexl and XPath expressions in the tag via either the test or the xpath attributes. Inside these test scripts you can use the full range of Jelly tags such as navigating over XML test data creating multiple test cases based on sample data, performing SQL operations, SOAP calls, HTTP or JMS requests etc.


Jeté is a system and integration testing framework. The purpose of Jeté is to make system testing easier and more broadly accessible while being flexible enough to test existing systems.


Jetif is a regression test framework in pure Java. It provides a simple and flexible architecture for Java unit testing and functional testing, and used for testing in both individual and enterprise software development. It's easy to use, but powerful, and with some important features for enterprise software testing. This project was inspired by JUnit, JTestCase and TestNG. There are several ideas come from JUnit, for example the assertion mechanism and TestListener concept, so it's easy to move to Jetif from JUnit.


JFeature is an open source feature/requirement coverage tool that facilitates focusing on requirements as you develop code. It lets you leverage from standard development practices to get more insight into the requirements covered by the code. JFeature works on top of the well known unit testing framework - JUnit, to identify the requirement coverage in the code. This also makes JFeature useful for projects, which use tools that operate on top of JUnit, such as, Cactus, StrutsTestcase, etc


A Java class library for developer testing with "mock methods". JMockit consists of a single class with a small set of static methods, which allow arbitrary methods and constructors of any other class to be replaced by mock implementations at runtime. This facility can be used for writing unit or integration tests where the code under test is isolated from other parts of the codebase on which calls are made. This approach is an alternative to the now conventional use of "mock objects", as provided by tools such as EasyMock and jMock. The advantage is that no particular design must be followed by code under test. Legacy code can be unit tested without the need for any adaptation. In short, JMockit makes testability much less of an issue, or even a non-issue. Since JMockit depends on the JVM class redefinition mechanism exposed by java.lang.instrumentation, JUnit (or TestNG) tests that use it must be run under a Java SE 5 VM. However, application and test code can still be compiled to older versions of the language.


JMUnit is a Java ME (J2ME) unit test framework based on JUnit. It supports JUnit-like test cases and test suites. Tests can be run in a device, in an emulator or as Ant tasks


JOSIT (Java Observation Simulation Inspection Toolkit) is an open Application Programmer's Interface for instrumenting applications written in the Java programming language. JOSIT seamlessly integrates with any Java application written using Sun Microsystem's standard library of Java graphical objects. JOSIT observes user actions, inspects the state of objects and scripts graphical events. Tools written in other programming languages may communicate with JOSIT via sockets.


JsTester allows validation of javaScript code inside java. It provides a group of assert methods like JUnit's Assert, it also supports the validations described in http://javascript.crockford.com/remedial.html, and the ability to use your own validations (unary & binary predicates). The project provides two ways of creating your tests: by inheritance (JsTestCase), and by composition (JsTester). Use JsTestCase as you would normally use any extension of TestCase. Use JsTester with TestNG or JUnit4 and annotations, or inside another TestCase hierarchy.


JTestCase is a 100% pure Java, open-source microframework that helps in separating test case data from test case units. JTestCase embodies the concept of a TestCase. A TestCase can be seen as combination of one (or more) assert for a specific set of input parameters.


JTiger Unit Testing Framework for Java 2 Standard Edition 5.0 is an open Source solution that provides a robust and feature-rich abstraction to develop and execute unit test cases. Test case metadata and unit test documentation is expressed through Java annotations. Assertions, from the basic to the complex, can be made using the JTiger assertions package rather than having to write the logic for those assertions yourself. JTiger includes rich assertion abilities, ranging from 'assert true' to 'assert adherence to the Object equals method contract on this type', an Apache Ant task, and reporting capabilities in HTML, XML or plain text format. For an example JTiger HTML report, see the JTiger Self Test Report. JTiger provides reassurance of being a robust unit test framework by providing its own self test fixtures that assert 100% class and 100% method code coverage over the JTiger source code.


JUnit is a simple framework for writing and running automated tests for Java.


JUnit extension for system test. JUnitum is developed from ideas of TestNG / Simplium. It provides system test features to simplify and speed up system test cases. The highlighting benefit of JUnitum is that you can use these features without any conflict with your exisiting test development environment.


This project adds a new runner to JUnit and provides much easier and readable parameterised tests for JUnit 4.5 and higher.


Lomboz is an Eclipse plug-in for J2EE developers by extending eclipse JDT. It employs some of the proven open-source technologies. Supporting the complete development cycle: Code, deploy, test and debug.


A tiny framework that makes it easy to write Test Data Builders in Java


Maven is a software project management and comprehension tool. Based on the concept of a project object model (POM), Maven can manage a project's build, reporting and documentation from a central piece of information.

Mock Objects

Generic unit testing framework and methodology for testing any kind of code


MockCentral is an easy-to-use, fully-featured set of tools that provides a new approach to java software testing using mock objects. It enables you to create and access libraries of mock objects defined in xml files external to the testing code, allowing for cleaner test cases and easy mock object organization and reuse.


Java mocking is dominated by expect-run-verify libraries like EasyMock or jMock. Mockito offers simpler and more intuitive approach: you ask questions about interactions after execution. Using mockito, you can verify what you want. Using expect-run-verify libraries you are often forced to look after irrelevant interactions.


Mockrunner is a lightweight framework for unit testing applications in the J2EE environment. It supports servlets, filters, tag classes and Struts actions and forms. Furthermore it includes a JDBC, a JMS and a JCA test framework and can be used in conjunction with MockEJB to test EJB based applications. Mockrunner extends JUnit and simulates the necessary behaviour without calling the real infrastructure. It does not need a running application server or a database. Furthermore it does not call the webcontainer or the Struts ActionServlet. It is very fast and enables the user to manipulate all involved classes and mock objects in all steps of the test. It can be used to write very sophisticated unit-tests for J2EE based applications without any overhead. Mockrunner does not support any type of in-container testing.


MoMEUnit is an instance of the xUnit architecture for unit testing of J2ME applications. It is derived from well known JUnit framework. It is only CLDC 1.1 complied. MoMEUnit includes Ant Integration package. It consists of several fully featured, extensible tasks that simplify use of MoMEUnit framework with Ant build system.


moreUnit is an eclipse plugin that helps you with your JUnit-Tests. Switch via shortcut from the method under cursor and the corresponding testmethod. Create testmethod stubs for method with one shortcut. See which classes/methods are tested at once ...


MultithreadedTC is a framework for testing concurrent Java applications. It features a metronome that is used to provide fine control over the sequence of activities in multiple threads.


NoUnit allows you to see how good your JUnit tests are. It generates a report from your code to graphically show you how many of your project's methods are being tested , and how well.


PowerMock is a Java framework that allows you to unit test code normally regarded as untestable.


RMock 2.0.0 is a Java mock object framework to use with jUnit. RMock has support for a setup-modify-run-verify workflow when writing jUnit tests. It integrates better with IDE refactoring support and allows designing classes and interfaces in a true test-first fashion.


Robolectric is a unit test framework that de-fangs the Android SDK jar so you can test-drive the development of your Android app. Tests run inside the JVM on your workstation in seconds.


ScalaCheck is a powerful tool for automatic unit testing of Scala and Java programs. It features automatic test case generation and minimization of failing test cases. ScalaCheck started out as a Scala port of the Haskell library QuickCheck, and has since evolved and been extended with features not found in Haskell QuickCheck.


With ScalaTest, you can test either Scala or Java code. By integrating with popular tools such as JUnit, TestNG, Ant, and Maven, ScalaTest makes it easy to take your testing to a higher, more productive level in new or existing Scala or Java projects.


STORM is a free and open source tool for testing web services. It is written mostly in F#. STORM allows you to test web services written using any technology (.NET , Java, etc.)

StrutsTestCase for JUnit

StrutsTestCase for JUnit is an extension of the standard JUnit TestCase class that provides facilities for testing code based on the Struts framework. StrutsTestCase provides both a Mock Object approach and a Cactus approach to actually run the Struts ActionServlet, allowing you to test your Struts code with or without a running servlet engine. Because StrutsTestCase uses the ActionServlet controller to test your code, you can test not only the implementation of your Action objects, but also your mappings, form beans, and forwards declarations. And because StrutsTestCase already provides validation methods, it's quick and easy to write unit test cases.

Swing Explorer

Swing Explorer is a tool for Swing developers intended for visual exploring of a Swing-based application internals. It finds all the windows in the explored Swing application and displays their component hierarchies as a tree. Each component in the tree can be displayed in the Swing Explorer's work area and visually inspected. Swing Explorer helps to determine sub-components when user moves mouse over them and provides additional information about currently selected component (layout, size, coordinates, border and other things).


Testability-explorer is a tool which analyzes java byte-codes and computes how difficult it will be to write unit-test. It attempts to help you quantitatively determine how hard your code is to test and, where to focus to make it more testable.


TESTARE is a java testing framework that aims to simplify the test development process for distributed java applications. TESTARE's initial focus is on ejb testing, but its extensible architecture makes it very easy to develop in container testing support for other technologies, such as SERVLETS, JMS listeners, CORBA ORBs or RMI. As such, TESTARE can be used to more easily implement the test driven development for distributed java development efforts.


TestNG is a testing framework inspired from JUnit and NUnit but introducing some new functionalities that make it more powerful and easier to use. TestNG is designed to cover all categories of tests: unit, functional, end-to-end, integration, etc...


"Tests with Parameters" allows you to simply add parameters to your JUnit test methods. TwiP calls such methods with all possible combinations of their parameters... or at least some reasonable subset of commonly failing values in the case of Integers, etc.


UISpec4J is an Open Source functional and/or unit testing library for Swing-based Java applications, built on top of the JUnit test harness. If you are writing a Swing application, you will appreciate UISpec4J above all for its simplicity: UISpec4J's APIs are designed to hide as much as possible the complexity of Swing, resulting in easy to write and easy to read test scripts. This is especially true when comparing UISpec4J tests with those produced using Swing or low-level, event-based testing libraries.


Unitils is an open source library aimed at making unit testing easy and maintainable. Unitils builds further on existing libraries like dbunit and integrates with JUnit and TestNG. Unitils provides general asserion utilities, support for database testing, support for testing with mock objects and offers integration with Spring , Hibernate and the Java Persistence API (JPA). It has been designed to offer these services to unit tests in a very configurable and loosely coupled way. As a result, services can be added and extended very easily.

York Extensible Testing Infrastructure (YETI)

YETI is an automated random testing tool for Java, JML, .NET, C, command-line programs. It is freely available under BSD license.