Information Technology Reference
In-Depth Information
The major challenge with extending Wrangler to the EUnit test framework lies
in the interpretation of symbolic representation of test data, and the multiple
roles of atoms in the Erlang language. For example, with EUnit's test data
representation, a single module name, whichisanatom,canbeusedtorepresent
the whole test set from the exported test functions of the named module; so when
the named module is renamed, Wrangler needs to make sure all the related uses
of this module name in the test data are renamed, and also make sure that atoms
with the same name, but not used as a module name are not renamed.
To ensure that Wrangler refactors test data correctly, we designed some invari-
ants which should hold for a refactoring. For example, for each test generation
function, F say, affected by a renaming refactoring, suppose F becomes F' after
the refactoring, then the following invariant should hold:
rename(parse(F())) == parse(F'())
where function parse transforms the test set representation into a normal form,
rename does renaming in the normal form in which each atom's role can be
decided precisely. If the above invariant does not hold for a particular test gen-
eration function, Wrangler will ask the user for manual inspection.
4.3
Wrangler and Eclipse: Integration with Erlide
Another strand of work has been to support the integration of Wrangler into
the Eclipse binding for Erlang, Erlide. Erlide is under active development at
Ericsson, as well as being made available freely to the Erlang community. Wran-
gler is currently a part of the standard Erlide distribution, freely available for
download.
Integration with Eclipse through Erlide provides a number of advantages over
emacs. For example, it has a well-defined notion of project, and so this gives a
scope to refactorings which affect more than one module; it has a well-defined
distribution and update mechanism, which means that users will automatically
pick up the latest version of the tool (should they choose to); it provides multiple
views of a code base, so that users can access refactorings in different ways. In
addition, through its refactoring API, it provides some facilities ”for free” such
as preview of the effect of refactorings (across multiple modules), and through
its interface it is possible to present results of searches or the effect of a multisite
refactoring in a more explicit way than emacs. For instance, search results can
be browsed, and choices for multi-site refactorings be specified through a series
of check boxes.
Future work will see the creation of a new integration structure which relies
more on Erlide. With this development it will be possible to access the refac-
torings through the Outline, Navigator and Duplicated Code views as well as
through the Refactor menu at present. This will in turn simplify the User In-
terface, and eliminate a number of current error possibilities which arise as a
consequence of the form of the interface.
Search WWH ::




Custom Search