Actionscript Code Dependency Metrics mit Asycle

Keine Kommentare

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.

Vorheriger Beitrag
Twitter – das brauch ich nicht, oder DOCH?
Nächster Beitrag
Spring’s @Transactional does not rollback on checked exceptions

Related Posts

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.


FlexUnit 4 und TeamCity

We switched from FlexUnit to funit which seemed much more lightweight and came with out-of-the-box TeamCity support. Then FlexUnit 4 came up and IntelliJ IDEA 9 was released including a built-in FlexUnit runner. That alone would have been reason enough to switch over again, but additionally FlexUnit 4 seems to be a huge improvement over the 0.9 predecessor.


Schreibe einen Kommentar

Deine E-Mail-Adresse wird nicht veröffentlicht. Erforderliche Felder sind mit * markiert.

Bitte füllen Sie dieses Feld aus
Bitte füllen Sie dieses Feld aus
Bitte gib eine gültige E-Mail-Adresse ein.
Sie müssen den Bedingungen zustimmen, um fortzufahren