Sonntag, 13. Mai 2007

cross-artifact queries

While extremely useful in themselves, the tools discussed in the previous entry are limited to querying source-code artifacts only: configuration files, plugin.xml, etc. are left out (precisely, those for which checks such as referential integrity would be most useful). Examples of referential integrity for Struts and Eclipse Workbench plugins are provided by Michał Antkiewicz here (not in OCL, unfortunately, although OCL has enough expressive power to encode the consistency he considers)

Software artifacts, once available as instances of Ecore-based model, can be queried with OCL. Some useful links for this task:
  1. an Ecore-based metamodel of Java (without OCL well-formedness rules) has been contributed by Mikael Barbero (INRIA) and can be found here (for a tree-based visualization follow this link)

  2. the MM above can be used in conjunction with this plugin, which instantiates such metamodel for a compilation unit of choice (using the JDT infrastructure)

  3. more sample code for querying the “raw” AST offered by the JDT can be found in ASTView. In order to understand in detail the type information of a given Java file, these tutorial slides prove extremely useful.

Querying a Java AST is usually cumbersome given its detailed nature. As in databases, having a stock of parameterized queries (to filter only those items useful for the task at hand) goes a long way towards improving usability.

It looks to me that until the following critical mass is necessary:
  • libraries of metamodels (with WFRs)
  • plugins to parse software artifacts into those metamodels
  • pre-defined queries for repetitive tasks on those metamodels
  • efficient mechanisms to evaluate queries, author them, and to visualize their results
in order to realize the whole potential of software repositories. Wow, that sounds like a "research agenda" ... spooky!

"Watch this space!" :)

Keine Kommentare: