Win a copy of Re-engineering Legacy Software this week in the Refactoring forum
or Docker in Action in the Cloud/Virtualization forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Need right tool for java coding standards & code review

 
Kather Basha
Greenhorn
Posts: 20
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

for my current j2ee project we are in the process of selecting right tool to define coding standards and to review existing java code.

Kindly help any one to get into right path regarding this.

thanx

Kather Basha.
 
Ilja Preuss
author
Sheriff
Posts: 14112
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Besides a good code formatter (there are several out there, and most IDEs come with one), you don't really need a tool, in my not so humble opinion. What you need is a very basic, informal coding standard that is *in the heads* of your team, and which gets refined while your team closely collaborates on the project (assuming that they are colocated). Pair Programming, for example, is a very good "tool" for propagating a team wide coding standard.
 
Rick O'Shay
Ranch Hand
Posts: 531
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
There's no substitute for a battle-tested and informed software engineer with an interest in keeping up-to-date on best practices but there are plenty of books out there that will help. First carve your requirements in to coding standards (easily automated with tools like Jalopy from Triemax) and code structure (you will need skilled developers and highly regarded books on the subject) and finally development process: Evo or UP or XP.

Those are three separate areas where the code beautifier (formatter) is the least important because it can be automated.
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Some of the static code review tools do a pretty cool job of spotting potential bugs, but most of them primarily critique your indenting and commenting. A good code formatter will take care of indenting, and the "standard" level of commenting they suggest is redundant at best and counter-productive or dangerous at worst. Go with human reviews.
 
Geoffrey Falk
Ranch Hand
Posts: 171
1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Take a look at CheckStyle
 
David O'Meara
Rancher
Posts: 13459
Android Eclipse IDE Ubuntu
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I agree partially with Ilja, you need to 'live' these values and try not to patch it after the fact.

However in our case we use Eclipse wilth a standard set of formatting rules used by everyone (and enforced) and JCSC to check code quality, although code reviews does most of this for us.
 
Stuart Gray
Ranch Hand
Posts: 410
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
If you are into static analysis tools, FindBugs and PMD are fairly good.
 
Ulf Dittmer
Rancher
Pie
Posts: 42967
73
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
With PMD it's easy to add your own rules, something you will want to do sooner or later.
When selecting a tool I find it important that it integrates seemlessly into the build environment, whether that is Ant, Eclipse, NetBeans or IntelliJ. Otherwise it just won't get used as much as it should be.
Other options you might look into are JCSC, Hammurapi, lint4j and jlint. My favorites are PMD and Hammurapi (which produces very nice reports that are cross-referenced with the source code).
 
Stan James
(instanceof Sidekick)
Ranch Hand
Posts: 8791
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I have to admit my comments on tools were based on research a couple years old. A third party is applying Hammurapi to some of our code. I'll keep an open mind until I see what they come back with.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic