JMock is a library that supports test-driven development1 of Java2 code with mock objects3.
Mock objects help you design and test the interactions between the objects in your programs.
The jMock library:
* makes it quick and easy to define mock objects, so you don't break the rhythm of programming.
* lets you precisely specify the interactions between your objects, reducing the brittleness of your tests.
* works well with the autocompletion and refactoring features of your IDE
* plugs into your favourite test framework
* is easy to extend.
This library allows you to use JavaBeans-style property matching for arguments when using EasyMock. Property matching is based on commons-beanutils as documented in Standard JavaBeans.
This article demonstrates a brand new open source library for unit testing, called Unitils. Unitils helps you in writing simple and maintainable unit tests with JUnit or TestNG . It glues together some widely used test libraries like DbUnit and EasyMock and offers integration with Spring and Hibernate . Unitils encourages applying good practices and unit testing guidelines. The ideas behind the code are based on the authors' concrete experience on enterprise projects.
Unitils offers following features
* Equality assertion through reflection, with options like ignoring Java default/null values and ignoring order of collections
* Support for database testing involving test data management with DbUnit, automatic maintenance of unit test databases and automatic constraints disabling
* Hibernate integration features such as session management and testing the mapping with the database
* Integration with Spring, involving ApplicationContext management and injection of spring managed beans
* Integration with EasyMock and injection of mocks into other objects
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.
Test metric tool can be used:
1. As a learning tool which flags causes of hard to test code with detailed breakdown of reasons.
2. To identify hard to test hair-balls in legacy code.
3. As part of your code analysis-toolset.
4. As a tool which can be added into continuous integration that can enforce testable code.
This is a very simple integration of Spring and FitNesse. FitnNesse is a Wiki-based framework to implement integration tests. Fit as well. This framework uses HTML files as input and output for the integration tests. Therefore the tests can be written using Word or Excel instead of a Wiki. This makes usage much easier and can be critical for success or failure.
This framework offers new classes that you can inherit from to implement or Fit FitNesse Fixtures. These Fixtures are then autowired to Spring Beans. So the Fixtures just need to implement set-methods. These are automatically called by Spring with a Spring Bean of the right type. This way Dependency Injection also covers the Fitnesse tests.
UTF-X is a unit testing framework for XSLT. UTF-X strongly supports the test-first-design principle with test rendition and test validation features allowing you to visually design your test before you start working on the stylesheet. UTF-X was originally built to test XSLT stylesheets used in an XML publishing system so it has good support for DTD validation, XHTML and XSL:FO stylesheets.
Unitils is an open source library aimed at making unit testing easy and maintainable. Unitils builds further on existing libraries like DBUnit and EasyMock 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 and Hibernate. 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.
Currently Unitils offers following features:
* General testing utilities
o Equality assertion through reflection, with different options like ignoring Java default/null values and ignoring order of collections
* Database testing utilities
o Automatic maintenance and constraints disabling of unit test databases
+ Support for Oracle, Hsqldb, MySql, DB2, Postgresql and Derby
o Simplify unit test database connection setup
o Simplify insertion of test data with DBUnit
o Simplify Hibernate session management for unit testing
o Automatically test the mapping of Hibernate mapped objects with the database
o Manage transactions during unit testing
* Mock object utilities
o Simplify EasyMock mock object creation
o Simplify mock object injection
o EasyMock argument matching using reflection equality
* Spring integration
o ApplicationContext configuration and easy injection of spring managed beans into a unit test
o Support for using a Spring-configured Hibernate SessionFactory in unit tests.
The project started begin 2006 from an Ordina J-Technologies discussion group on unit testing. The result was a list of guidelines and Unitils emerged in an attempt to write code to support these guidelines.
Documentation
The developer edition provides ALL of the capabilities of the server edition but limits console and terminal connectivity to the first 45 minutes of a managed JVM's processing. Snapshots taken before the expiration time can still be analyzed offline in the console and the console will reconnect to the JVM once it has been stopped and started.
The key to agility is being able to modify code easily and safely. The problem is that many Java applications are too brittle to extend and enhance easily. Attempts to fix or extend - no matter how carefully done - can introduce more bugs and more complexity.
With a full suite of characterization tests generated by JUnit Factory you can bring your legacy code under control. Download our free plug-in for Eclipse to get started.
JRat is the Java Runtime Analysis Toolkit. Its purpose is to enable developers to better understand the runtime behavior of their Java programs. The term "behavior" includes, but is not limited to performance profiling.
While JRat is still in beta, without adding code to your application it can...
# accumulate timing statistics (a few ways)
# create trace logging
# track rate methods are called over time
# track the response time of methods over time
TestLink is a open source web based TEST MANAGEMENT and test EXECUTION system under the GPL license (i.e. free to use). The tool enables quality assurance teams to create and manage their test cases as well as organize them into test plans. These test plans allow team members to execute test cases and track test results dynamically, generate reports, trace software requirements, prioritize and assign.
The tool is based on PHP, MySQL, and includes several other open source tools. We support interface to Bug tracking systems as is Bugzilla or Mantis.
In what I hope will be the first of several articles about Guice, a new lightweight dependency injection container from Bob Lee and Kevin Bourillion from Google, this article examines the simplest and most obvious use case for the Guice container, for mocking or faking objects in unit tests. In future articles I will examine other, more ambitious areas where it can be used, including dependency elimination in large code bases.
There are a number of open-source unit testing tools available. So why another one?
Well, this one addresses a specific need - an easy way to test XML-based servers. If you have a server that communicates with clients via XML messages, you can end up putting a lot of effort into using one of the unit-testing frameworks to test all the messages. Just think of all the code needed to set up communications, construct messages, and verify responses.
A simple alternative is to document XML messages and expected responses, without having to write any code. Let XmlMessageTest send each XML message to the server, verify returned messages against expected results, and produce a simple report of test results.
XmlMessageTest is written in Java and should be able to run any Java-enabled platform. It's been tested on Windows XP and Linux. It can be easily integrated into your build process.
Canoo WebTest is a free open source tool for automated testing of web applications.
It calls web pages and verifies results, giving comprehensive reports on success and failure. The White Paper provides an overview of the features and the design rationale. Detailed information is provided in the Manual Overview as well as the Install and Troubleshooting guides.
Dependometer is a java based analysis tool for java projects.
Features are:
Use a logical architecture description in terms of Layers and Subsystems and their physical mapping (n Packages implement a Subsystem) and check logical architecture violations.
* Analyze the dependency architecture between Layers, Subsystems, Packages, Compilation Units (Java files) and Types (Classes and Interfaces)
* Calculate a bunch of metrics for all elements - this includes metrics from John Lakos, Robert C. Martin and Craig Larman
* Analyze cycles between elements
* Define thresholds and receive feedback upon their violation
Simulate via simple refactoring definitions and cutting unwanted dependencies changes to the physical structure possibly enhancing refactoring.
Create a complete HTML presentation via xslt. This provides browsing capabilities from Layer (logical element) to Compilation Unit (physical element) for a discussion which physical elements cause the logical architecture to break.
Phantastic!
"EclEmma is a free Java code coverage tool for Eclipse, available under the Eclipse Public License. Internally it is based on the great EMMA Java code coverage tool, trying to adopt EMMA's philosophy for the Eclipse workbench:
* Fast develop/test cycle: Launches from within the workbench like JUnit test runs can directly be analyzed for code coverage.
* Rich coverage analysis: Coverage results are immediately summarized and highlighted in the Java source code editors.
* Non-invasive: EclEmma does not require modifying your projects or performing any other setup.
The Eclipse integration has its focus on supporting the individual developer in an highly interactive way.
The update site for EclEmma is http://update.eclemma.org/."
What if you were able to discover potential problems in your code prior to building it? Interestingly enough, there are Eclipse plugins for tools such as JDepend and CheckStyle that can help you discover problems before they are manifested in software. In this installment of Automation for the people, automation expert Paul Duvall provides examples of installing, configuring, and using these static analysis plugins in Eclipse so that you can prevent problems early in the development life cycle.
Luntbuild is a powerful build automation and management tool. Continuous Integration or nightly builds can be easily set using a clean web interface. Executed builds are well managed using functions such as search, categorization, promotion, patching, deletion, etc. It also acts as a central build artifacts repository and download area for your whole team.
There are many Continuous Integration systems available. This page is an attempt to keep an unbiased comparison of as many as possible of them. The goals are:
* Make it easier to choose an appropriate CI tool for your project.
* "Healthy competition aid" for the people involved in the development of these various CI systems.