BWAA, the Busy Wait Analyser for Ada is an analysis tool, based on static control flow analysis methods, that targets the detection of busy waiting.
From the abstract of my thesis:
"Busy waiting occurs whenever a process repeatedly checks a condition until it becomes true without influencing that condition itself, thereby effectively wasting system resources and introducing the risk of system failure due to race conditions. Hence, busy waiting is considered bad programming practice and can be avoided by the use of higher communication facilities.
In the development of critical systems, for which correctness and robustness are of vital importance, software quality assurance is of great value. However, it is difficult and impractical to manually discover busy waiting in existing program code, which is why a static analysis tool is needed for that purpose."
BWAA uses the CFG-based datastructures provided by Ast2Cfg.
Many code optimisation and analysis techniques depend on the representation of a program in form of a control flow graph. Ast2Cfg is a library that enables the user to retrieve the control flow graphs for a given Ada program. It uses ASIS to get the abstract syntax tree. The control flow graph is then generated by Ast2Cfg in linear time, during a single inorder traversal of the syntax tree. However, with Ast2Cfg it is not only possible to generate simple CFGs. In fact it is a whole framework for the construction of powerful CFG-based representations of arbitrary Ada programs. The generated data holds extensive information about the original Ada source, such as visibility, package structure and type definitions and provides means for complete interprocedural analysis.
The Cfg2Dot program we developed along with Ast2Cfg is a good example of how to use Ast2Cfg. It uses Ast2Cfg to generate the control flow graphs for a given program and outputs them in dot format. This file can be viewed directly with an appropriate application, or may be converted to some other graphics file.
In order to study the abstract syntax trees provided by ASIS we developed Ast2Dot. It transforms the abstract syntax trees to dot files. This files can then be viewed directly or may be converted in various other formats.
The Busy Wait Analiser is an earlier project that aims at the detection of busy waiting in Java programs. Because it is pretty hard to detect busy waiting in existent code there is the need for a static analysis tool, which tells exactly where and how busy waiting is employed. BWA basically is a command line tool which outputs class name, method name, the source line number of the busy wait loop and the busy wait variable. For more information see the separate project site.