Actionscript Code Dependency Metrics mit Asycle

No Comments

The dependencies betwen packages must not form cycles. Since packages are the granule of release, they also tend to focus manpower. Engineers will typically work inside a single package rather than working on dozens. This tedency is amplified by the package cohesion principles, since they tend to group together those classes that are related. Thus, engineers will find that their changes are directed into just a few package. Once those changes are made, they can release those packages to the rest of the project.

Before they can do this release, however, they must test that the package works. To do that, they must compile and build it with all the packages that it depends upon. Hopefully this number is small. – Robert C. Martin

This sounds reasonable and most developers with other backgrounds are already familiar with structural analysis tools (ClassycleJDependNDependLattixSonarJSotograph Structure101, and others). Unfortunatelly, there is no comparable tool for Actionscript developers.

Since we use Adobe Flex as the primary RIA framework for the Catalysts Platform, we had the aspiration to apply the same structural rules that we defined for our backend code on the client code as well. On the backend side, which in our case is mostly Java, we use Classycle to check and enforce dependency rules. Classycle is a freely available Open-Source tool that can be easily integrated into our build environment based on Apache Ant. It also has a simple syntax to define dependency rules that can be checked with an Ant task and thus be enforced by the continuous integration server, in our case TeamCity.

As the Classycle rules are mainly language independend we strived for a solution to apply the existing backend rule definition file to our Actionscript codebase. Luckily Classycle is an Open-Source project and well enough architectured to extend it. Gathering the code statistics and applying the rules is performed in two distinct steps so that we only had to come up with a solution to generate the very same statistics out of the Actionscript sources and feed them into the Classycle analyzer. By relying on metaas as an Actionscript parser this was a snatch. Metaas provides the whole source codeas a structured object graph, generating the statistics is just a matter of counting the class references in that graph.

That derivate tool, which we call Asycle, is publically available hereFeedback and bugreports are welcome.

Previous Post
Twitter – das brauch ich nicht, oder DOCH?
Next Post
Spring’s @Transactional does not rollback on checked exceptions

Related Posts

AsFlavor: Structure101g for Flex and Actionscript

Together with “The Structure Guys” from Headway Software we developed an Actionscript “flavor” for their latest Structure101 product family member Structure101g(eneric). AsFlavor makes the same esteemed structural and architectural analysis functionality available to the Flex and Actionscript community, that is well known to Java and C++ developers since years.

Read More

21. Wissensspritze: Actionscript Strukturanalyse mit Structure101g

Structure101 ist im Java Umfeld schon länger als mächtiges Werkzeug zur Sourcecode-Strukturalanyse und Überwachung bekannt. Mit Structure101g bietet Headwaysoftware eine generische Variante dieses Tools, die mittels geeigneten Plugins beliebige Daten analysieren kann. Diese Wissenspritze widmet sich Structure101g für Actionscript, das von Headwaysoftware und Catalysts gemainsam entwickelt wurde.

Read More

Leave a Reply

Your email address will not be published. Required fields are marked *

Fill out this field
Fill out this field
Please enter a valid email address.
You need to agree with the terms to proceed