views:

32

answers:

1

I find that when Im building a lot of webservices I tend to create thousands of small "testprograms" whos only purpose is to test the webservice. Yes, if your webservice only takes integers and strings you can use the built in testpage that the webservice serves up, but often you have booleans, userobjects or strongly typed datasets that will be passed in the functions and then you have to create a program that create a dummyobject and fill some default properties for you to test it out.

So my question, is there any program or "add in" out there who can generate a test-winform-program on the fly, just using the webservice as input, that creates code to test the webservice?

Would be nice, because its a (monkeywork) task that is totally non creative, stright forward, time consuming and boring to do.

+1  A: 

While it must be "time consuming and boring" to write those test applications, it must be even more so to have to manually use them again and again.

May I suggest that you write a suite of automated tests to do this instead of writing throwaway GUI-based applications? Although this type of testing is called Integration Tests you can use any unit testing framework to implement such a test suite.

Since web services provide a programmatic API, this is pretty straightforward to do.

It can save you a lot of time being able to run the same tests over and over again without manual intervention.

Mark Seemann
Thanks for the answer. Then I have a follow up question. Are there any program or add-ins that creates those tests out of the webservice?
Stefan
Not that I'm aware of, but given the metadata-driven nature of web services, it's not entirely unlikely. Here's something I'd investigate myself if I had to: Use SvcUtil.exe to generate proxy classes for all your web services - you can do that with a command line script. This will give you a bunch of code files you can compile. Then it might be interesting to let Pex loose on those proxy classes to see what happens. Some manual intervention is probably required, but there may be other options that suit your purposes better.
Mark Seemann