Open Source Testing Tools for Java Applications


Overview

Open Source testing tools are being used aggressively and there are many tools over the web for Java Applications. These tools are great asset to the development teams and provides many features / services over the quality of applications under development. We can use this as the starting point and focus more efforts on the uncovered areas for better quality.

It’s very important to know the context of development and the right tools for quick benefits. However, heavy usages of these tools lead to misleading data and metrics too. So think twice on what is required for the project and which tools might provide the required data / services.

Services Offered

The following services / features are offered from most of the open source tools

  • Continuous Integration for the builds
  • Unit Testing
  • Code Coverage
  • Source Code Metrics (like size, Complexity, design, dependency)
  • Static Analysis for various bug patterns
  • Test Automation
  • Performance Testing

List of Open Source Tools

Quick Benefits from Static Analysis

It’s very easy to integrate static analysis tool(s) with builds and there quick benefits. The following issues can be uncovered

  • Null Pointer Exceptions
  • Other un handled exceptions
  • Infinite Loops
  • Dead code
  • Compliance with Java Coding standards
  • Code Coverage data
  • Trends  / history on the above checks against previous builds
  • Validations against Java coding guidelines from Sun

The following Metrics can be captured

  • Source Code Metrics
  • Coverage Metrics
  • Dependencies with the Design
  • Code complexity metrics

The Resources listed below helps in implementing the same.

Testuff – The Test Management Tool for small and medium projects


Almost an year ago, I have evaluated some low cost and open source Test Management Tools. Managing the Test Efforts & Test documentation is always an issue for small and medium companies.

The following were my requirements for Test Management Tool

  • Capture the Requirements
  • Design & Prepare Test Cases
  • Map Test Cases with Requirements
  • Link Bug reports with Test Case ID after the test execution
  • Test Execution Reports
  • Version Management for the Test Cases
  • Search Feature

Testuff comes with all the above features and some additional capabilities to record the test execution and link them with the issue tracker. It comes free for single user. Check out the testuff blog for more updates

Explore the Testability aspect for Java Code


The Testability Explorer is an open source project that lets you measure the testability of Java code. This is an interesting idea: a metric not of direct quality, or of testing, or of test coverage, but of ease of testing. Presumably code that is easy to test will get tested, and will therefore be of higher quality, other things being equal.

The following information over Testability Explorer is useful

Trends in Static Analysis – ENERGY for better java code



I have come across yet another static analysis tool for Java programs. ENERGY is a free static analysis tool to measure code quality & presents overall status on the health of source code. Energy comes with a code quality metric by combining the bug patterns on the source code and rates it between 1 to 10.   The tool tries to identify the symptoms via static analysis and then publish a rating. How it works is an interesting insight.


Check the following video to learn more about the tool.

Video thumbnail. Click to play


Technorati Tags: , , ,

My quest towards Code Quality Metrics


 

The term quality might mean different things to different people based on their context of operation and it’s tough to have universal definition for the same.My experiments with software development started over a decade ago & exploring the ways the helps to build & deliver good quality code.The quest towards Code Quality Metrics started with the above objectives.

The discussion around Useful Code Quality Metrics at Linkedin started two months ago. I am excited over the response around the internet to this thread & there are some excellent articles around subject.

In the recent past Agitar comes up with CRAP4J as a code quality metric by combining Cyclomatic Complexity and Code Coverage.

In the process, we do use Static Analysis and Dynamic Analysis to derive the above mentioned metrics. Some more good articles around Code Quality are here

I wish that the info around Code Quality is helpful for my blog readers

Happy Testing…

(more…)

CRAP4J for Java Code Quality


I have been talking about Code Quality through Static Analysis for a while here, here & here. The quality for any application development must begin from it’s gross roots and the Application Code is one of it’s starting point to begin with.Static Analysis techniques help us to identify some metrics over the application code base

  • Cyclomatic Complexity
  • Application Design & Dependency Metrics
  • Exception Handling
  • Infinite Loops
  • Dead Code
  • Performance Issues
  • Programming Language guidelines & best practices in their context

The above information will be useful and it’s easy to get the same via Test Framework with a single click.

Code Coverage along with a bunch of unit tests is one widely used technique to help regression testing for the dev & test teams.

Now it’s good to see that Agitar combines Code Coverage & Cyclomatic Complexity to derive risk metrics for Java Code Base. They call it as a code Change Risk Analyzer and Predictor (i.e. CRAP) for Java.

Though it’s a prototype and see how the industry receives the same, i see it as a good initiative on the code quality front and might be a metric going forward for white box testing.

Some useful links for CRAP4J

Update on Oct 23rd

Now we have a dedicated site for CRAP4J. This contains latest news, forum discussions and many more. I would say that this a good resource for Code Quality lovers & the good news is that they are designed to be open source tools.

Crap4j is a Java implementation of the CRAP (Change Risk Analysis and Predictions) software metric – a mildly offensive metric name to help protect you from truly offensive code.

The CRAP metric combines cyclomatic complexity and code coverage from automated tests (e.g. JUnit tests) to help you identify code that might be particularly difficult to understand, test, or maintain – the kind of code that makes developers say: “This is crap!” or, if they are stuck maintaining it, “Oh, crap!”.

The best way to learn more about CRAP and Crap4j is to check the various articles, newsgroups and blogs about them.

(more…)

What Jar – Solution to NoClassDefFoundError


As a Tester & Developer, it’s pretty common to see NoClassDefFoundError. It’s not that easy always to figureout the required jars for the application.

Whatjar comes with a lot of search capabilities to identify and download the required jars.

Whatjar is a high-performance, search engine written using Java and MySQL to index and search Java JAR contents. Its primary goal is to provide a tool to help the developer find the JAR file required when faced with a class not found exception. In addtion to act as searchable resource of open source java jars.

Whatjar is free, there is no cost to upload a jar or to search our existing database of JARS.


Open Source Test Management Tools


 

In this post, i will share my views & findings with Open Source Test Management Tools. Usage of tools in the Test Management is becoming the basic need & It will be tough to manage the activities associated there with out any support from the tools.

 

The commercial tools in this segment are costly and may not fit into upcoming organizations budget. So i have been looking at Open Source Test Management tools. In the last week, I have evaluated some open source test management tools.

 

The following are my requirements for Test Management Tool

  1. Capture the Requirements

  2. Design Test Cases

  3. Map Test Cases with Requirements

  4. Link Bug reports with Test Case ID after the test execution

  5. Test Execution Reports

  6. Version Management for the Test Cases

  7. Search Feature

The following tools are evaluated after the initial screening.

The above tools work with Apache, MySQL & PHP. Both the tools looks promising and the Test Link has some additional benefits in-terms of better reports and linking with popular issue trackers.

 

JavaNCSS – A source code metrics suite for Java


I have been working on Java Projects for quite some time and interested in exploring the source code metrics like size and complexity across project not specific to perticular package or class and looking after LOC (Line of Code) counters to capture some metrics of the source code.

Explored some tools and found that JavaNCSS is a good match for the context of sizing metrics on Java. JavaNCSS is a command line utility which measures some standard source code metrics for the Java programming language. The metrics are collected globally, for each class and/or for each function.

The following are some of the advantages that i have seen

  1. Support for Ant Tasks, so easy to integrate with build process
  2. Reports can be in Text, XML, HTML etc
  3. Support for Stylsheets and easy to get nice HTML reports
  4. Metrics at each level Package / Class / Method
  5. Cyclomatic Complexity Number
  6. List the number of packages / classes / functions / LOC counter at each level

 

Further Reading:

  1. JavaNCSS Home
  2. LOC Counters for C++ / Java on Joel Software Discussion group
  3. SLOC on Wikipedia

Twitter Updates

Recent Trackbacks

Google Search