September 90 - Aranda: a new case of CASE
Aranda: a new case of CASE
John Pattenden
Introduction
Aranda is a Computer-Aided-Software-Engineering (CASE) tool that does not
fit into either of the two general categories of CASE products. Tools in the
first category use notational systems to support one or more development
methodologies for structured analysis and specification. Notational systems,
such as bubble diagrams, are used to represent processes and dataflows. These systems require software engineers to learn a new set of paradigms before they can actually start doing anything useful and may not be well suited to some projects, particularly those that are more evolutionary than engineered.
The other category of tools are code generators, which can be useful for rapid prototyping but which tend to produce code that is difficult to maintain.
Aranda takes an entirely different approach. It's an object-oriented CASE tool designed to aid in the comprehension and reuse of existing code. It may, in fact, be the first CASE tool designed with object programming in mind. This should not be surprising, since Aranda was written using MacApp.
Aranda will generate information about existing source code, making it an immediately useful tool, especially in the case of MacApp with its large library of pre-existing code that needs to be at least partially digested by the working MacApp programmer. Aranda provides the user with several different ways of viewing code, both graphically and as text. All Aranda's views are hypertext-linked to aid navigation through the code jungle.
Aranda is based on a meta-programming model described in a paper, "Software maintenance using metaprogramming systems," which was presented at the 1987 Conference on Software Maintenance in Austin, Texas by Brian W. Terry and Rob Cameron of Simon Fraser University. In this model, Aranda parses all source code into a "project" and then generates and maintains an abstract tree of the code. Unlike a compiler-style parser, Aranda keeps the basic structure of the source code intact, allowing context-sensitive references to the code to be made after parsing.
The down side of this approach is that Aranda cannot handle some code that a compiler can. The case I ran into most often was with compiler directives, particularly the include statement. However, if you follow the conventions used in MacApp for compiler directives and generally maintain good programming form there should be no problems.
This tree structure is stored in a database along with the original source code which, although converted to Aranda's internal format, can still be viewed in its original form. After all the code has been parsed, a project window appears with a series of icons, each of which represents one source file that has been parsed; this represents a window into the database. (If you can't spot the file that you want, you might have to do a "Clean up windows," since Aranda sometimes places its icons outside the viewable area of the window).
From this "top level," folders can be created to help organize files and reports. There are a series of navigation tools provided on a screen palette which make navigating through folder hierarchies and reports quick and intuitive. With a large body of code-inevitable with MacApp-the ability to logically file associated items together in a simple intuitive fashion is a key factor in making the system useful as a whole.
Using Aranda
The first step into the code is to apply the Contents tool to the source file(s) that you wish to investigate. (Incidentally, I used the the IconEdit tutorial program for the source code in all the following diagrams.) The way tools are applied throughout Aranda is to first select an Identifier (see below) and then apply a tool to it.
Contents report
The Contents report provides a graphical view of a source code file, portraying the relationship between Identifiers, which are defined by Soft-Set as Procedures, Functions, Classes, Types, Variables, Parameters, Methods, Constants and Include files. The graphic reports can be reduced or expanded in detail and filters may be used to only show desired identifiers. Different shapes represent different types of identifiers, which quickly become familiar and easily recognizable.
Classes tool
The Classes tool lets you show the entire inheritance tree, all the way back to TObject, and in general provides a quick overview of any particular class hierarchy. All of these reports are context-sensitive, so a graphic object representing any identifier can be clicked on to provide a selection, and then an action appropriate to that identifier can be taken.
Notes
Notes lets you place the contents of other reports into a text format that is useful for archival documentation. These Notes reports are very useful, not only for after-the-fact documentation but also in the design and implementation stages, where a project leader might generate a note on a routine he needs and include references to other pieces of code that are to be used-the programmer who is implementing the new routines can then use Aranda's hypertext capabilities to investigate the other routines involved. PICTs and text can be pasted and positioned in Note forms, along with icons which reference other reports. You can thus create a flowchart and have the source code for the report available for viewing at the press of a button.
Notes are ideal for the software engineer who is a little slack in documenting code-a not uncommon occurrence. Aranda has a series of built-in Note reports for various identifiers which can be customized and extended as desired. The really nice thing about this type of report is that it is dynamic-keeping documentation up to date would otherwise be a time-consuming task and more often than not wouldn't be accurate anyway-so that getting a report "from the horse's mouth" in this fashion is a significant step forward in helping to make maintenance easier.
Flowcharts
A flowchart of a method, function or procedure can be generated in seconds by selecting the identifier and applying the Flowchart tool. This ability to graphically represent a routine's execution structure can be extremely helpful in figuring out what a routine does, particularly if you haven't written it. The full expression of any of the statements in the flowchart can be viewed with a Command-click. As with all the reports, the flowcharts are printable; the only thing I would have liked to see is the ability to get the entire expression on the printout. This applies to copying the charts as well.
Other tools
Other tools include an Imports tool which shows all externally defined identifiers that a selected routine imports. "Used By" shows all the identifiers that use a selected identifier, while "Modified By" displays all the routines that modify a selected identifier by direct assignment; this does not include variables whose values are modified as VAR parameters.
The source for any identifier can be quickly found using the Source Code tool. Once the contents of a source file has been established, the code can be analyzed in a number of ways using context-sensitive tools. The source is active in the sense that any identifier in the Source Code report can be selected and a report pertinent to it generated. This is a handy feature if you are tracing code through its calling chain to find bugs or understand logic.
Source-code editing is not available at this time, although code can pasted into other applications. Soft-Set is working towards editable source that can be added to the parse tree on the fly and then displayed graphically to show how it effects the rest of the program.
Each of these reports adds an icon and an explanatory title to the project window or the folder from which it was initiated; double clicking on the icon will regenerate the report. All the reports in Aranda are generated on the fly, guaranteeing that they will always be up to date as long as you have added the latest versions of any source files that have changed. Aranda aids you in this potentially tiresome pursuit by adding a "show newer" checkbox to its standard-file like dialog to add or update files in the database.
To help improve performance Aranda will in fact keep track of the last several reports that were generated (it implements a virtual memory scheme which can suck up a few megs), so switching between reports that you have just viewed is not slowed down at all by regeneration. However , if the report is not cached in memory it does have to be regenerated, which in the case of a "Used By" report can take several minutes and in some cases much longer.
The good news is that most reports take only a few seconds; to graphically generate the entire MacApp class hierarchy takes about a minute. All the reports can be cut and pasted into Notes or other applications, so if you are inclined towards huge wall charts there is plenty of scope here-it's just a matter of pasting it into your favorite CAD package and plotting it out. One problem with this, however, is the limit on Aranda's Scrap: the entire class hierarchy of MacApp needs a bit of disassembly work to get it exported out of Aranda.
If Aranda sounds at this point like a glorified browser, you would be at least partially correct: at its crudest level, Aranda makes an excellent companion to Mouser [Ed: now MacBrows] and is more accurate in tracking identifier usage. Using Aranda as a browser is a lot like using MacApp to do a "hello world" program: it does a fine job but its full potential is nowhere near being tapped.
Aranda comes with an 80-page manual that is well thought out and includes explanations of commands, a reference section, and a tutorial. While the tutorial only touches the surface of Aranda's capabilities, it does give a good first look at how to get into the program. Soft-Set is working on application notes which will demonstrate more in-depth techniques for applying Aranda to source-code documentation techniques.
How I use Aranda
I've been beta testing Aranda for more than six months and am now using the 1.01 release. We've mainly used it with an 80,000-line program written largely by people who are now unavailable [Ed: is that mentally or physically?] The software controls a series of remote hardware devices in real time; the overall system has to have a friendly user interface and control refrigeration, lighting and air conditioning in large buildings such as supermarkets. We also have the simultaneous ability of communicating with the hardware/software via modem to change settings on the fly.
Aranda has at times proven invaluable to us in tracking down how or why certain thing are happening in a very complex system which by definition has to avoid modes. We are now moving into the object programming arena, and since Aranda is a tool that can handle either procedural or object code, that versatility is a key feature in allowing us to easily change environments and even programming languages and yet let us keep the same code management tools.
MacApp is still a reasonably large mystery, but in Aranda we now have a tool that can help us find out what goes where and why. My reason for investigating Aranda over a year ago was because of the system I mentioned above; Aranda has done a very good job of retroactive documentation, made necessary by the loss through theft of our original documents. Just having the ability of finding every place a routine is used or a variable is modified has been an enormous help. These, by the way, are the kind of basic operations we found ourselves doing most often, more then generating Notes from various identifiers. The balance of power shifts somewhat with a MacApp-based system, but no matter what kind of programming environment is being used, some of the same questions are going to be asked.
MacApp and Aranda make a powerful combination because although design specifications and documentation are available, the code was still written by someone else whom you can't just call up and ask questions of. Any tool that can speed analysis of code is a powerful friend to have.
Aranda is the kind of tool that will be used differently by different people and different sized teams, and this is indicative of its versatility. It's more of a revolutionary than an evolutionary tool. It allows millions of lines of pre-existing code to be digested, maintained, and even more importantly, reused. In the next few years Aranda and other tools will become as integral a part of the software development environment as compilers are today. I'm only surprised that it's taken so long for software engineers to start making tools for themselves that are as powerful as those they make for almost every other industry.
Enhancements
One feature missing from this release of Aranda is multiple windows. Fortunately there are simple intuitive navigation tools for moving between various reports and up and down folder hierarchies. Soft-Set is planning to release a multiple window version of Aranda in November, which will greatly enhance the usability of the program. We should see a C version early in September and a separate C ++ version about a month later. (The reason for separate versions is because of a difference in reserved words between C and C++.) Other improvements on the horizon are interactive tabular views of reports, automatic updates of an entire project through a single command, improved speed, and new testing tools including a Coverage Analysis Profiler. In the works also is a COBOL version for those unfortunate souls still using it.
Summary
If you have an aversion to painstaking manual documentation of code, need to bring people up to speed on a project, are about to dive into some serious maintenance, or are just plain writing code, Aranda is worth a look. Aranda can be used effectively at most stages of the software life cycle, particularly where reuse of code is a factor. It provides an excellent way of exploring existing code and bringing new members of a project up to speed quickly.
Aranda is currently available for Apple's MPW Pascal and Symantec's THINK Pascal compilers. All of my own testing has been under MPW. Aranda runs under both Finder and MultiFinder; a 68020 or 68030 Macintosh with a minimum of two megabytes of RAM is required.
Aranda is available from:
Soft-Set Technologies, Inc.
1847 W. Broadway, #301
Vancouver, B.C. V6J 1Y6
Phone: (604) 734-1622
Fax: (604) 733-5294
AppleLink: SoftSet
Pricing is $645 and discounts are available for purchases of multiple units. Educational institutions get a hefty discount and a special student version for projects of less than 5,000 lines of source is available for $50. A limited-life demo disk is also available for $19.95.
Soft-Set provides free tech support for 30 days and free updates for 12 months following purchase.