We hope that you have sucessfully installed Swat4j-Plugin for Eclipse either by using downloaded zip or update site(Download page).
Swat4j - Verifying installation
1.) After installation you must be able to see the following menu in Eclipse IDE along with other menu items.
2.) Click on Help --> About Eclipse SDK, to see the Swat4j feature button along with other features. Click on the Swat4j - button to see the further information about the plugin.
Congratulations! you have successfully installed Swat4j Plugin for Eclipse.
First Swat Analysis
- Open your Java Project in Eclipse IDE
- Using the Package Explorer View and Right Click on your Project Node.
- In the Context Menu choose Swat4j -> Analyze. to analyze with default configuration.
- Swat4j poses a dialog asking you to choose the packages/files you want to analyze(Note: Evaluation copy analyzes only 30 files).
- Click Finish and let Swat4j Engine do its analysis, normally your selections would be analyzed within minutes.
- You should see an analysis report at the end of the swat4j analysis process.
- The analysis is done and now you can start reflecting on the results it has produced.
1. Metrics View, displays the results of the software metrics which are automatically calculated. By default this view shows the results at Project level. The view is synchronized with Package Explorer View and shows the results of the selected object(package/file/class/method), it also shows the peer comparison, displaying the Minimum, Maximum and Average of the same type of object.
Swat Index, a sub tab of Metrics View shows Minimum, Maximum and Average for the same metric across composed object. For e.g. Cyclomatic Complexity for a 'Package' in Swat Index would display the Min/Max/Avg of all 'Methods' under the selected package.
The difference between the Metrics and Swat Index tab is that Metrics tab display the results in comparison all similar objects (which are analyzed) and Swat Index displays the results in comparison with composed objects.
2. Best Practices View, displays the results of rules which are violated for the selected object(Synchronized with Package Explorer View). The rules are classified under seven categories and the 'Conformance Graph' tab displays the percentage of conformance for a particular category, which calculated using No. of Rules Violated / No. of Rules in the Category.
The category 'Potential Bugs' is unique and very interesting as it displays the violation of rules which searches for simple mistakes made by the developer and such mistakes could be show stoppers.
Click on a rule in this view and navigate to the location of violation using the up/down arrow buttons.
3. Flowchart View, displays the control flow graph of the selected method(Synchronized with Package Explorer View). Click on the graph objects to navigate to location in the source.
4. Quality Model View, displays the quality conformance results of the selected object(Synchronized with Package Explorer View). The chart depicts the selected goals expected Vs attained conformance level(range 1 - 10). The details of predicates which qualify the goals are listed in seperate tabs. The results are based on the current Quality Model Configuration, which can be viewed by Right Click <Project> in Package Explorer -> Swat4j -> Configure Quality Model.
5. Notes View, displays documentation related to the currently selected metric/rule in above views.
6. Reports, To generate reports(PDF) click on the "Generate report" icon placed in the views. (Adobe Reader is required to see the generated pdf).
7. Swat4j Outline View,provides outlining of the currently selected objects (file/class), it can be used for navigation.
Quality Analysis Perspective
Swat4j provides a 'Quality Analysis Perspective' to enable graph based analysis of the software metrics and reflect on the results generated by the Swat Analysis. The perspective provides correlation and distribution graphs of important metrics. The perspective consist of the following views.
1. QA Filter View, displays the projects for which Swat Analysis results are available, it serves a filter criteria for the graph which are generated, filtering is possible at levels individual package or project(default).
2. Quality Analysis View, displays the pre-configured swat analysis definitions, Right Click on the definition [ Nodes at the third level, for e.g. 'Maintainability Index Distribution] and choose the type of graph to generate.
3. QA Charts View, displays the graph/chart requested from Quality Analysis View. Click on the element of interest in the graph to see the cases(QA Cases View).
4. QA Cases View, displays the cases or the origin of the graph being displayed in the QA Chart. Click on a case will open the file in the respective editor.
Quality Model Editor
The Quality Model Editor is a unique capability of Swat4j, which enables you to define a quality model based on available predicates(Software Metrics & Best Practice Rules).
1.) To open the Quality Model Editor, Right Click on Project <Node> in the "Package Explorer View' and Choose 'Configure Quality Model' to see the default quality model configuration which is used for the Swat Analysis.
2. The first tab "Quality Goals' displays the quality goals and their expected conformance in scale of 1 to 10, where 10 being the best quality expectation.
3. The second tab' Predicate Configuration' displays the available predicated across five levels (Method, Class, File, Package & Project) and their relationship with goals. When several predicates contribute to a goal, their contribution can be emphasized using the weight and Threshold.
4.) When you save a quality model, Swat4j may request to reanalyze your project for additional predicates which was not analyzed prior. If you have not any new predicate then you can right away use the 'Quality Model View' to see the updated Expected Vs Attained Quality Levels.