views:

255

answers:

5

I am coding a client-server application using Eclipse's RCP. We are having trouble testing the interaction between the two sides as they both contain a lot of GUI and provide no command-line or other remote API.

Got any ideas?

+2  A: 

I have about 1.5 years worth of experience with the RCP framework, I really liked it. We simply JUnit for testing...

It's sort of cliche to say, but if it's not easy to test, maybe the design needs some refactoring?

Java and the RCP framework provide great facilities for keeping GUI code and logic code separate. We used the MVC pattern with the observer, observable constructs that are available in Java...

If you don't know about observer / observable construct that are in Java, I would HIGHLY recommend you take a look at this: http://www.javaworld.com/javaworld/jw-10-1996/jw-10-howto.html, you will use it all the time and your apps will be easier to test.

mmattax
+1  A: 

As a former Test & Commissioning manager, I would strongly argue for a test API. It does not remove the need for User Interface testing, but you will be able to add automated tests and non regression tests.

If it's absolutely impossible, I would setup a test proxy, where you will be able to:

  • Do nothing (transparent proxy). Your app should behave normally.
  • Spy / Log data traffic. Add a filter mechanism so you don't grab everything
  • Block specific messages. Your filter system is very useful here
  • Corrupt specific messages (this is more difficult)

If you need some sort of network testing:

  • Limit general throughput (some libraries do this)
  • Delay messages (same remark)
  • Change packet order (quite difficult)
Christian Lescuyer
+1  A: 

Have you considered using a UI functional testing tool? You could check out HP's QuickTest Professional which covers a wide varieties of UI technologies.

Motti
+1  A: 

Hi , we are developing one client-server based application using EJB(J2EE) technology, Eclips and MySQL(Database). pl suggest any open source testing tool for functional testing . thanks Hitesh Shah

A: 

Separate your client-server communication into a pure logic module (or package). Test this separately - either have a test server, or use mock objects.

Then, have your UI actions invoke the communications layer. Also, have a look at the command design pattern, using it may help you.

David Rabinowitz