First, install and use Checkstyle
(i) Installation
(1) First download the Net.sf.eclipsecs-updatesite_6.5.0.201504121610-bin from the official website and unzip the files in the Chekstyle.
(2) Then extract the compressed files in the Checkstyle file, the two folders inside the plugins and features the following files are copied to the Eclipse directory corresponding to the plugins and features directory, restart Eclipse.
(3) In Eclipse, select Windows->preferences->checkstyle
(4) Click New,type Select External configuration file, location Click Browse, select Checkstyle.xml file Import,
(5) In your project, right-click on properties to find Checkstyle Select the name you have just configured, and apply on it
(ii) Use:
(1) Select the project file, right click Select Checkstyle, select Check Code with Checkstyle
At this point, you will see the original file changes. The original file will appear in the non-compliance where the yellow color! The mouse pauses at the exclamation point, can see the information prompt.
Second, findbug installation and use
(a) Download
(1) First to the official website to download the latest version findbugs http://findbugs.sourceforge.net/downloads.html, download and unzip, and then copy the Unzip folder to the Eclipse installation directory ( My Eclipse installation directory d:\ Software installation \eclipse\eclipse) under Plugins directory:
(ii) Use:
(1) Write a program with the wrong Java code, test it,
(2) Right click on the source file, select Findbugs-->find Bugs (for example):
A Bugs Two warnings icon appears on the left side of the source code (e.g.)
(3) Open error display window-->show View-->other-->findbugs-->bug Explorer (e.g.) displays the cause of the error
Third, then, follow the prompts for code modification installation and use Sourcemonitor to detect the complexity of the code
(a) Sourcemoniter introduction
Sourcemonitor is a free software that runs under the Windows platform. It can measure code written in multiple languages, including C, C + +, C #, Java, VB, Delphi, and HTML, and output different code metrics for different languages.
Like other code measurement tools, Sourcemonitor only focuses on the code and provides timely feedback to the coder, which is not a project management tool and does not focus on the implementation of the project from functional analysis to design coding, to testing the whole process.
(ii) installation
Download and install Sourcemontor from official website, after installation
(iii) Use
(1) The new project is shown as follows:
(2) Select the development language, such as Java,
(3) Fill in the new file name and select the path,
(4) Select the path of the project source code,
(5) Make this checkpoint, select default.
(6) test results,:
Four: summary
This article describes how to install and use test tools such as Styletype, FindBugs, and Sourcemonitor, respectively. Different tools have different roles, but the same can help programmers more understanding and specification to modify their own code to improve their coding level, timely and accurate to find a series of problems such as bugs. I will be better in the future wide and frequent use of them to improve their technical level!
Install and use CHECKSTYLE/PMD with Findbug && install and use Sourcemonitor to detect code complexity