Friday, January 09, 2009   
  Search   
 
Register  Login  
Forums  
     Minimize  

Welcome to MeraWindows forums.

Thank you for being at the Microsoft Windows Community Site. You may have to register before posting in forums. It's absolutely free. After registering, you can get all the benefits available to our registered members, you can access our Downloads section, you can participate in contests, etc. You can post in forums in English as well as in Hindi, in fact we encourage you to use Hindi in your posts. If you have any problem with registration or login, please contact us.

     
  


 
  Microsoft Windows Forums  News & Feedback  Latest News  Is Java Full of 'CRAP'?
Previous Previous
 
Next Next
New Post 10/4/2007 3:13 PM
User is offline Ramesh Kumar
2871 posts
www.itsmyWindows.com
Forum Guru








Is Java Full of 'CRAP'? 

Is Java Full of 'CRAP'?

At one point or another, every developer has looked at a piece of code and said aloud (or to themselves), "This is crap." Until now, however, the definition of what actually constitutes bad code has not been an exact science with a proper formula or analytics.

Thanks to the efforts of Alberto Savoia, founder and CTO of Agitar Software, there is now a statistical measure to monitor Java code. Called crap4j, CRAP is an acronym for Change Risk Analyzer and Predictor.

Savoia said that code complexity and a lack of testing lead to code that is difficult to maintain and enhance. Actually determining how inefficiently complex a piece of code might be, on the other hand, is what the CRAP score is all about.

"Even though the name is humorous, CRAP is meant for a very serious purpose," Savoia told InternetNews.com. "There is no standardization for code quality. Our goal is to come up with a metric for code quality that people would use."

The basis of how crap4j determines inefficient complexity is by measuring how much complexity there is in the Java methods included in a particular piece of code. Too much complexity in the form of too many branches in Java code methods is not a good thing, Savoia said.

The CRAP formula also tries to determine whether there are automated tests for the code, since untested code is also an indicator of CRAP. "The more branches, the more pieces of code [then] the harder it is to maintain," Savoia said.

The general idea is that the higher the CRAP score, the greater the effort a developer will need to deal with in order to maintain the code. That said, the CRAP score is not necessarily an indicator of code security.

"The reality is that no metric is infallible," Savoia said. "Having a low CRAP score doesn't mean you don't have bugs; but having a high CRAP score means you've got a sloppy development. A high CRAP score likely indicates you've got problems in more than one area."

Though the crap4j effort has been spearheaded by Savoia and his company Agitar, he expects no direct financial gain from the effort and intends on running the project as an open source endeavor. The crap4j tool itself is an Eclipse plug-in, and Savoia noted that the plan is to move the source code over to the Eclipse Foundation, of which Agitar is a member.

"It will be more fun if others pick CRAP up," Savoia said. "The metric should not be controlled."

For Savoia, the CRAP effort is all part of his own crusade to improve code quality for all.

"Software is such a black-box thing, and for the industry to be open about the degree of testing -- and hopefully by trying not to have their code labeled as 'crappy' -- we can improve software."

Source: InternetNEWS


it's my Windows
 
New Post 10/4/2007 7:22 PM
User is offline Piyush Gupta
1834 posts
www.piyushworld.com
MW Addict


Re: Is Java Full of 'CRAP'? 

Ya it is CRAP


Read Forum Guidelines before posting

 
Previous Previous
 
Next Next
  Microsoft Windows Forums  News & Feedback  Latest News  Is Java Full of 'CRAP'?


   Get Your Own E-Mail Account @MeraWindows.com Minimize  
New Page 1 New Page 1
Show your cool quotient with @merawindows.com email account