Posted by monika_krug
on September 13, 2007 at 1:19 PM PDT
I have written an Eclipse plug-in named FAST for Fully Automated Search and Test, which supports developers with test-driven reuse. It parses JUnit test cases and downloads classes matching the test case from the Internet and tests automatically if the downloaded classes pass the test. It is available at http://www.javaschubla.de/2007/eclipsefast/
Traditionally, agile development methods and reuse have been considered opposite concepts, even though they both aim for the same goals: higher quality and higher productivity in software development. But actually they are optimal for using together, because test-driven development is an integral part of agile methods.
The FAST (Fully Automated Search and Test) plug-in to Eclipse supports the Java developer in test-driven reuse (also known as "Extreme Harvesting"). It contributes a context menu to JUnit test cases and a view.
So you write your JUnit test case, let's say for the sake of simplicity a StackTest. Now instead of coding the Stack, right-click on the StackTest in the package explorer (or any file matching *Test.java) and choose the FAST menu.
A view comes up. The plug-in guesses that when your test case is named StackTest, the class under test is probably named Stack. If it isn't, modify this field. Then press the button below to parse the JUnit test case.
A query will be created that might look something like this:
If you like, you can edit the query. Then press the next button to send it to Merobase.com , a source code search engine that supports interface-driven search. The results are shown in the table below.
The classes found have the right interfaces (method signatures), but one still needs to test them to be sure they really do the right thing. Click the next button to download the classes. Each will get its own project. The test case will be copied into each. An adapter class is generated if needed, and package and import statements are added. The downloaded classes contain a comment about their download URL and date.
As the last and fifth step, either inspect the downloaded classes yourself and run the JUnit test case on them, or have the plug-in test all of the downloaded classes for you.
I would be very happy about feedback. Did it work for you? Do you think it is useful and can be used in real development? Or any other comment you can think of.