To understand Swat Analysis it will be useful to understand "static code analysis" which servers as an enabling technique of Swat Analysis.
Static code analysis refers to the technique of analyzing software without actually executing it or analyzing the source code of applications to derive information.
At its core static code analysis attempts to reverse engineer the structural and relational information of the software artifacts.
A simple but a very useful technique to automatically extract information about the software and its components.
* Static code analysis can extract useful information automatically from source code. Such tools can re-sources this information to people.
* Project management teams have very little information about the modifications made in source code, code analysis could provide information automatically.
* Tools could relieve developers from redundant code related tasks.
* Static analysis can be used to improve quality of code.
* Having the information about source code upfront gives a space to mitigate risks and/or prepare contingency plans.
* Static code analysis enables the flow of “useful information about source code” which is otherwise remains unused.
* Example 1: A tool can analyze source and report on percentage of comments (excluding comment header). Maintainable code must have 20% of comment, so if your code comment percentage is less its not going to be easy to maintain.
* Example 2: A tool can analyze source and create dependency graph, which can be used for impact analysis.
Swat4j uses static code analysis to analyze Java source code. Swat4j analysis includes
- a.) Understanding individual source code elements structurals and relation informations.
- b.) Automatically calculates software metrics.
- c.) Enforces best practices rules and find locations of violations.
- d.) Helps generate automatic flowchart.
- e.) Analyzes for bug pattersn and reports the location of the potential bug.
- f.) Calculates and provides input of Quality Model evaluation.
Capabilities of Swat Analysis.
- 1.) Selective analysis, analyze files of interest for you.
- 2.) Incremental build, subsequent analysis complement the analysis already done.
- 3.) Can run in background, without causing major responsiveness problems.