Menu

About ART

Daniel Dan Kuldeep Kumar

ART is a kind of a pre-processor with cpp-like syntax. ART can do what cpp does, but also extends cpp’s capability to manage software variability and write reusable software in general. ART is an improved version of XVCL xvcl.comp.nus.edu.sg. Users of cpp and XVCL should refer to the section Heritage at the bottom of this page for comparison.

Variability Management Techniques (VMT) help developers manage the base code for families of system variants, e.g., a family of Linux versions running on various platforms, or a family of financial systems used in different companies. VMTs organize and/or instrument the base code for ease of adaptation and reuse during development and evolution of system variants. Examples of popular VMTs: cpp, build tools (make or Ant), configuration parameter files, annotations and many others. As each of those common VMTs has been designed to handle just one specific context and need of variability management, we often see a combination of VMTs used together to manage system variants. However, these techniques are not compatible one with another and require much manual (and error-prone) intervention to work properly.

ART replaces the need for many VMTs with a single well-thought out mechanism that is simple, powerful and fully automated. ART allows you to organize the base code for ease of global configuration of software components, as well as to instrument the source code for customization at any level of details. ART interlinks global configurations with the relevant detailed code customizations and automates their execution.

ART Processor goes through the base code, executing ART commands to generate a required system variant. ART parameters exercising control over the ART processing set separately from the base code components.

Software Product Line (SPL) technology deals with systematic support for developing and evolving families of system variants. ART is a uniform VMT for SPL.

Heritage and Comparison with XVCL

ART was developed by Dan Daniel and Kyi Hein in Software Engineering Lab, NUS, in the team that developed XVCL xvcl.comp.nus.edu.sg. Like XVCL, ART is based on Bassett’s Frame Technology.

For the sake of XVCL users, here is a brief comparison of ART with XVCL:

Syntax: XVCL is a dialect of XML and uses XML trees and parser for processing. ART parts with XML syntax and processing, and offers a flexible, user-defined syntax. ART syntax in this distribution is based on cpp, just because cpp is so widely used and we see many good reasons and benefits for cpp users to try ART. Please check guidelines on this web site how to modify ART syntax. Especially if ART tags conflict with reserved tags in your programs, you will find the ability to easily change the syntax of some or all ART commands useful. Users who applied XVCL to process XML documents will know exactly what I mean.

XVCL compatibility: Each XVCL command has a direct counterpart in ART, with exactly the same meaning. If you translate one-to-one from XVCL to ART syntax, you will be able to process your software with ART Processor with the same results you get with XVCL.

Enhancements:

ART commands under adapt (credit to Daniel Dan): In XVCL, the only command that you can place under
adapt is insert. In ART, you can put any other ART command under adapt. The usual evaluation and overriding rules remain unchanged. You may find particularly useful to place select under adapt.

specifying output files (credit to Daniel Dan): Rather than specifying output file per adapt or per file as it was the case in XVCL, now you have a separate command to control where ART Processor is to emit output.

set-loop (credit to Valentin Weckerle and Vu Tung Lam): while loop using many multi-value variables is quite confusing in XVCL. set-loop construct in ART makes it more robust.

Comparison of ART with cpp

The overall scheme of operation of ART is similar to that of cpp. However, as compared to cpp, ART gives you a better control over the process of synthesizing system variants from the base code, leading to more generic, more reusable base code components. ART’s ability to organize base code in a way that replaces any significant pattern of repetition with a generic, adaptable ART representation, leads to much smaller base code and simpler to work with.

Here is how ART differs from cpp:

  • ART #adapt file command is like cpp #include, except that with ART the same source file can be customized differently in different contexts in which it is reused (i.e., adapted). What kind of differences among those custom versions of a file can and what kind of differences cannot be handled by ART? The answer is – any differences can be handled by ART. There is no technical limits of when and how to reuse source files. However, for reuse to be cost-effective, it is wise to reuse only if specifications of file customizations are reasonably simple.

  • ART variables assigned values in #set commands are like cpp variables assigned values in #define commands, except that ART variable values propagate to all adapted source files (along #adapt links). In addition, this variable propagation is subjected to overriding rules that are supportive to effective reuse. These rules help to keep source files instrumented with ART reusable in as many adaptation contexts as it is useful.

  • ART #while command allows you to define code generation loops. Suppose you have 20 similar source code structures fi in your system (where fi can be a function, class method, class, file, or directory). If the differences among fi are not too extreme, it pays off to define a generic code structure F in ART representation. Then you set up a #while loop to generate 20 instances fi by adapting F. Generated code can be conveniently placed in the directories and files of your choice.

cpp compatibility: Most of the basic cpp commands have a direct counterpart in ART, with exactly the same meaning.