News

GrammaTech Awarded NSF Research Grant to Develop Aspect-Oriented Unit Testing Solution

Posted on

by

Ithaca, NY — GrammaTech, Inc. announced today that it has been awarded a $496,406 Small Business Innovative Research (SBIR) Program Phase II grant by the National Science Foundation. Under the terms of the agreement, GrammaTech will develop an aspect-oriented unit testing solution.

As software systems become more complicated, the problem of testing them effectively gets harder. Unit testing is a methodology for testing small parts of an application independently of whatever application uses them. Unit testing is important, but it is time consuming and tedious to write unit tests. Furthermore, it is especially difficult to write unit tests that model the pattern of usage of the application they will be used in. It is common for an application to expose a bug in a module that the unit tests for that module missed entirely. A better approach is to monitor the application as it runs its regression tests, and to capture the events at the boundaries of the module of interest. This log of events can then be replayed to a test harness that exercises the module independently of the environment in which it was originally tested.

A system for implementing this strategy needs to analyze the application code, identify the sites that constitute the boundaries of the module, and then essentially rewrite the application code to capture occurrences of such events and log them to a file. If built from scratch, such a system would be highly complicated and expensive to produce. Fortunately, a system can be built by leveraging work done in a field of computing that addresses just this issue–the field of Aspect-Oriented Programming.

Aspect-Oriented Programming (AOP) addresses the problem of separation of concerns in programs. An aspect is defined as a crosscutting property of a program. For example, an aspect might be the property that states that all exceptions must be logged to a file. Traditional programming methodologies require that the code to implement the aspect be replicated everywhere the aspect should be enforced. This makes it tedious and time consuming to do in the first place, or to modify after the fact. AOP is novel because it allows the user to specify the aspect in one location, independently of the target code. An aspect weaver is software that then merges the aspect with the original code.

The unit test problem is one that is well suited to AOP. Roughly speaking, the aspect would specify that all events at the boundary of a module, e.g., a call to a method of a class in that module, would be logged to a file. The weaver would insert the code to do the logging into the application. Then, when the application is run with its own test data, its input and output to the module would be captured.

About GrammaTech:
GrammaTech’s static-analysis tools are used worldwide by startups, Fortune 500 companies, educational institutions, and government agencies. The staff includes fourteen researchers with PhDs in programming languages and program analysis.

Related Posts

Check out all of GrammaTech’s resources and stay informed.

view all posts

Contact Us

Get a personally guided tour of our solution offerings. 

Contact US