JAutodoc is an Eclipse Plugin for automatic adding Javadoc and file headers to your source code. It optionally generates initial comments from element name. Starting with Release 1.3 of JAutodoc it is possible to define Velocity templates for Javadoc and file headers.
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
TestabilityExplorer.org records the testability scores for many open source and commercial Java libraries.
The compiled bytecode for the library is analyzed and metrics are calculated for the testability of individual classes. Those classes fall into one of three categories - 'excellent', 'good' and 'needs work'. Generally speaking, injectability, mockabiliy and composition are good, and static state is bad. Figures are recursively calculated, but only inside the jar in question.
The metrics are a calculation of the skill of the development team in making their classes testable. You cannot use these metrics to say that Tomcat is better than Jetty or vice versa, as the features of each are not taken into account. These metrics will also not tell you whether a particular library will be easy to use or not. It just tells you how dedicated the development team was to making testable software. As we track the changing figures overtime, we can see whether the team in question was dedicated to improvement or not.
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.
To someone who is new to unit testing, the idea of mock objects can be confusing to say the least. I have covered in previous tutorials how to use various mock object frameworks (EasyMock and jmockit). However in this tutorial, we will focus on the concept of mocking in general. What is a mock object? What is it used for? Why can't I mock object XYZ? Let's look into these questions and maybe clear a bit of the air on the use of mock objects.
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.
Mock is a widely used technology in unit test domain. It shields exteral and unnecessary factors and helps developers focus on the specific function to be tested.
EasyMock is a well known mock tool which can create mock object for given interface at runtime. The mock object's behavior can be fine defined prior the test code in the test case. EasyMock is based on java.lang.reflect.Proxy, which can create dynamic proxy class/object according to the given interfaces. It has the inherent limitation from the Proxy. It can create mock object for given interface only.
Mocquer is a similar mock tool as EasyMock. With the help of Dunamis Project, it extends the function of EasyMock to support mock object creation for both class and interface.
With Marathon you capture user interactions on the applications and also insert assertions to verify that correct processing is taking place. The generated raw script can be refactored to modules for efficient reuse and maintainability. Replay the scripts either manually or integrate Marathon into your build process for automatic execution of the test suites.
Fitnesse for Eclipse Plugin
Add Fit and Fitnesse support to your Eclipse tooling environment!
The FitNesse for Eclipse Plugin enables developers to more easily use the FitNesse and Fit frameworks from within the Eclipse environment.
AtUnit minimizes boilerplate code in unit tests and guides test development by enforcing good practices.
* mark exactly one field with @Unit to indicate the object under test.
* mark fields with @Mock or @Stub to obtain mock objects
* inject your tests, and your test subjects, using your favorite IoC container
Mock Objects Integration
AtUnit integrates with JMock or EasyMock to provide mock objects:
* obtain a JMock context simply by declaring a field
* annotate fields with @Mock to obtain JMock or EasyMock mock objects
* annotate fields with @Stub to obtain a JMock or EasyMock stub object
... or you can use your own mock objects plug-in with two easy steps:
* implement the MockFramework interface
* annotate your tests with @MockFrameworkClass(MyMockFramework.class)
Container Integration
AtUnit integrates with Guice or Spring to take all of the work out of dependency-injected tests.
With Guice:
* never see the Injector, never write bootstrapping boilerplate!
* @Inject test class fields without even defining a Module
* declaratively obtain mock objects with @Inject @Mock
* if you need more binding flexibility, simply have your test class implement Module
With Spring:
* annotate fields with @Bean to get them from the Spring context
* fields annotated with @Bean which do not appear in your Spring context are added to it automatically! (This includes @Mock and @Stub fields.)
* AtUnit looks for a Spring XML file with the same name as your test, or you can specify the location yourself with @Context("filename")
* Most of the time, you don't even need a Spring XML file!
You can easily plug in other containers in two steps:
* implement the Container interface
* annotate your tests with @ContainerClass(MyContainer.class)
SONAR is a code quality management platform, dedicated to continuously analyze and measure technical quality, from the projects portfolio to the class method.
Codestriker is an open-sourced web application which supports online code reviewing. Traditional document reviews are supported, as well as reviewing diffs generated by an SCM (Source Code Management) system and plain unidiff patches. There are integration points with CVS, Subversion, Clearcase, Perforce, Visual SourceSafe and Bugzilla. There is a plug-in architecture for supporting other SCMs and issue tracking systems.
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/."
iValidator is a framework for XML-based test automation of complex test scenarios. iValidator is completely written in Java. The framework is available under an open source licence.
For those of you who've got into it you'll know that test driven development is great. It gives you the confidence to change code safe in the knowledge that if something breaks you'll know about it. Except for those bits you don't know how to test. Until now XML has been one of them. Oh sure you can use "<stuff></stuff>".equals("<stuff></stuff>"); but is that really gonna work when some joker decides to output a <stuff/>? -- damned right it's not ;-)
Feedback is vital for the practice of Continuous Integration (CI) -- in fact, it's the life blood of a CI system. Rapid feedback enables speedy responses to build events that require attention. Without feedback mediums like e-mail or RSS, builds in a broken state have the tendency to stay broken, which defeats the purpose of CI in the first place! In this installment of Automation for the people, automation expert Paul Duvall examines various feedback mechanisms that you can incorporate into CI systems.
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.
JayWalker is an open-source build and deployment analysis tool which interrogates a Java application's compiled artifacts and generates static and interactive graphical reports from it. In turn, a software professional can interpret and use these reports to improve software quality and to understand the current state of the software application in question.
Although there are quite a few dependency analysis tools on the market, JayWalker is different because:
* It walks the class files rather than the source files
* It can interrogate nested archives (i.e. a JAR within a WAR within an EAR file)
* It can detect a variety of conflicts that can be identified at build and deployment time in an effort to minimize runtime dependency errors.
* It can be incorporated into a continuous integration solution so conflicts can be identified as they are introduced into source code control rather than addressing errors at runtime.
* It can be run standalone via the commandline on a system which just has a JRE installed
* Other dependency tools are package or class specific. JayWalker has support for archives, packages, and classes.
* Report attributes can be toggled on or off
* Walking across classlist elements can be done in several different ways:
o Deep (default) - recursively follow all paths
o Shallow - recursively follow paths up to and including a boundary element
o System - recursively follow paths up to a boundary element which is not part of the deployment, but is provided by a server or environment.
Jumble is a class level mutation testing tool that works in conjunction with JUnit. The purpose of mutation testing is to provide a measure of the effectiveness of test cases. A single mutation is performed on the code to be tested, the corresponding test cases are then executed. If the modified code fails the tests, then this increases confidence in the tests. Conversely, if the modified code passes the tests this indicates a testing deficiency.