BT

Facilitating the Spread of Knowledge and Innovation in Professional Software Development

Write for InfoQ

Topics

Choose your language

InfoQ Homepage News Test Driven Code Reuse

Test Driven Code Reuse

This item in japanese

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

BT