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.


The usual route to mcsd is preceded by 1Y0-308 closely following 642-873. Professionals who have done 220-603 know about this.

Share and Enjoy:
  • Print
  • Digg
  • Sphinn
  • del.icio.us
  • Facebook
  • Mixx
  • Google Bookmarks
  • Blogplay
  • Blogosphere News
  • DZone
  • FriendFeed
  • LinkedIn
  • Reddit
  • StumbleUpon
  • Technorati
  • Tumblr
  • Twitter
  • Share/Bookmark
6 Comments Post a Comment
  1. [...] the recent past Agitar comes up with CRAP4J as a code quality metric by combining Cyclomatic Complexity and Code [...]

  2. [...] Whitebox Testing (4) « CRAP4J for Java Code Quality [...]

  3. sakthi says:

    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

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

  5. [...] 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 [...]

  6. unlock codes says:

    I spent a lot of time reading your blog, it’s awsome

Leave a Reply




Twitter Updates

Recent Trackbacks

Google Search