The Source for Java Technology Collaboration
User: Password:
Register | Login help    

Search

Online Books:
java.net on MarkMail:


Monika Krug

Monika Krug has been programming literally half her life, since taking a Turbo Pascal programming course at age 12. After some years she switched to Java, which she certainly does not regret, as Java is still the finest programming language around in her opinion. In 2001, she started studying mathematics and computer science at the University of Mannheim, Germany, and expects to complete her diploma thesis about software engineering in 2006. She works as a tutor (instructor for practice sessions for the undergrad students) at the university, where she enjoys watching over the Java projects of the younger students. Currently she is enjoying a 6-month internship at SAP.

 

Monika Krug's blog

FAST - Fully Automated Search and Test, an Eclipse plug-in

Posted by monika_krug on September 13, 2007 at 1:19 PM PDT

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:

Stack(
  push(int):void;
  pop():int;
)

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.

Related Topics >> Eclipse      
Comments
Comments are listed in date ascending order (oldest first)
Syndicate content