Friday, January 29, 2016

Code Quality Tools for Java

Code Quality Tools for Java


Sonar:
Sonar is an open platform to manage code quality.
Ref: http://www.sonarsource.org/
Steps for code analysis of java project with Sonar:
1. Download the Sonar Ant Task plugin jar file
http://repository.codehaus.org/org/codehaus/sonar-plugins/sonar-ant-task/1.1/sonar-ant-task-1.1.jar
2. Place the Sonar Ant Task plugin jar file at …\common\tools\apache-ant-1.7.1\lib in source code
3. Add a new target Sonar in ant build.xml for code analysis of project as mentioned below
……
……….
4. Run Sonar target for code analysis of java project
On Windows: newbuild.bat sonar
On other platforms : ./newbuild.sh sonar
5. The code analysis of java project is visible at Sonar Server http://localhost:9000
Reference: http://docs.codehaus.org/display/SONAR/Analyse+with+Ant+Task
Cobertura:
Cobertura is a free Java tool that calculates the percentage of code accessed by tests. It can be used to identify which parts of your Java program are lacking test coverage. It is based on jcoverage.
Ref: http://cobertura.sourceforge.net/
Jalopy:
Jalopy is a source code formatter for Java. It automates and enforces all aspects of source code layout—to meet a certain coding style without putting any burden on individual developers.
Ref: http://www.triemax.com/products/jalopy/
JProfiler:
JProfiler’s intuitive GUI helps you find performance bottlenecks, pin down memory leaks and resolve threading issues.
Ref: http://www.ej-technologies.com/products/jprofiler/overview.html
Checkstyle:
Checkstyle — Besides some static code analysis, it can be used to show violations of a configured coding standard.
FindBugs:
FindBugs — An open-source static bytecode analyzer for Java (based on Jakarta BCEL) from the University of Maryland.
PMD:
PMD — A static ruleset based Java source code analyzer that identifies potential problems.

No comments:

Post a Comment