BT

InfoQ Homepage News Test Driven Code Reuse

Test Driven Code Reuse

Bookmarks

Code reuse has been the holy grail of software development for a long time. Historically we've tried to achieve code reuse through abstractions and frameworks, which came with their own technical debt. There is now a novel approach that leverages the power of search tools and automated developer tests to search open-source code for matches against interface and behavior.

Colin Atkinson and his research group, in the Software Engineering Department at the University of Mannheim, have created merobase, a tool that allows the user to search the internet for existing code that matches a given interface (structure).  That’s fine, but not really unique, there are other search engines that perform a similar service – such as Google Code Search.

What distinguishes Atkinson and his students, Oliver Hummel and  Monika Krug, is that they have have added an additional capability – the ability to search not only on structure, but also behavior.  This is accomplished by using tests written by the developer to be part of the search criteria.  All classes that match the required interface are then run against the tests provided.

Monika has written an Eclipse plug-in called FAST (Fully Automated Search and Test) that will automatically parse and query merobase based on tests that you’ve written.  So, you write your tests, right-click on the test class, and automatically retrieve all applicable classes from the internet that match your criteria.

This is a research project currently, but it can easily be imagined how useful this approach can be for large organizations that have tens of millions of lines of code hanging around that can now be searched and reused without the cost of frameworks and abstractions that are difficult to understand, use, and maintain.

 

 

Rate this Article

Adoption
Style

Hello stranger!

You need to Register an InfoQ account or or login to post comments. But there's so much more behind being registered.

Get the most out of the InfoQ experience.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Community comments

  • Your message is awaiting moderation. Thank you for participating in the discussion.

    Cute. I'm wondering though how it tests code on the effects of unspoken leaky abstractions.

  • Re: Cute

    by Luis Garcia /

    Your message is awaiting moderation. Thank you for participating in the discussion.

    That's where AJAX voting stars come in.

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

Allowed html: a,b,br,blockquote,i,li,pre,u,ul,p

BT

Is your profile up-to-date? Please take a moment to review and update.

Note: If updating/changing your email, a validation request will be sent

Company name:
Company role:
Company size:
Country/Zone:
State/Province/Region:
You will be sent an email to validate the new email address. This pop-up will close itself in a few moments.