Java developers have for a long time been able to enjoy the benefits of high-quality code coverage tools, both payware and open-source. Code coverage tools are an integral part of a developer's quality-assurance tool box, and are especially important in determining what parts of a code base are covered by unit tests.
Coverage tools have of late started to crop up in client-side environments as well, as the latest version of Flexcover, the open-source Flex code coverage tool, demonstrates. Flexcover 0.5 provides a modified version of the Flex compiler that inserts additional code in the compiled code to track code execution. The resulting coverage data can be viewed in a variety of ways, including Flexcover's desktop coverage viewer:
Flexcover is a code coverage tool for Flex, AIR and AS3. It incorporates a modified version of the AS3 compiler which inserts extra function calls in the code within the SWF or SWC output file. At runtime, these function calls send information on the application's code coverage to a separate tool; The modified compiler also emits a separate "coverage metadata" file that describes all the possible packages, classes, functions, code blocks and lines in the code, as well as the names of the associated source code files...
Flexcover now computes both line coverage and branch coverage. In branch coverage conditional code paths rather than lines are counted. Many developers feel that branch coverage is a much more accurate measure of coverage, and it is able to detect coverage issues that occur within a single line of code such as compound conditionals with || and &&, or conditional expressions using the ?: operator.
Other features of Flexcover 0.5 includes an simpler integration framework: Instead of relying on Ant configuration files, the new mechanism makes it easy to assemble a custom Flex SDK with the modified compiler, and then use that SDK to generate coverage information. One advantage of this approach is that it works with any development environment, such as FlexBuilder.
What do you think of the general state of Flex development tools?