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
- Introducing CRAP4J
- The Code C.R.A.P. Metric Hits the Fan – Introducing the crap4j Plug-in
- Junit Factory’s Code C.R.A.P metric
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.
The usual route to mcsd is preceded by 1Y0-308 closely following 642-873. Professionals who have done 220-603 know about this.


[...] the recent past Agitar comes up with CRAP4J as a code quality metric by combining Cyclomatic Complexity and Code [...]
[...] Whitebox Testing (4) « CRAP4J for Java Code Quality [...]
Hi … I like this post. nice post with the required details thanks for this post you can get lot more sources from http://www.macrotesting.com it will be useful for u thank you…….
cheers
sakthi
[...] the recent past Agitar comes up with CRAP4J as a code quality metric by combining Cyclomatic Complexity and Code [...]
[...] and merging them to have a better metric. We can see the pattern from Agitar by coming up with CRAP4J. Here is one more vendor coming up with the tools on Code Quality and Static [...]
I spent a lot of time reading your blog, it’s awsome