I’m doing an in-house talk on Test-driven development using C# and Microsoft Visual Studio 2005. Half the audience will be Natural main-frame developers. Therefore I’d like to know if Natural-development in either SPoD or Eclipse supports test-driven development? Or stated differently: are there utilities for automated unit testing of Natural code in either SPoD or Eclipse?
I’ve posted this question in both the SPoD and the Eclipse groups.
If you use Natural Business Services, we have support for unit tests in Visual Studio .NET, SPoD and Eclipse. For Visual Studio .NET and Eclipse this comes in the form of generating NUnit/JUnit test classes. For SPoD, Natural Business Services provides a non-coding Unit test utility that allows you to define calls to business services (which in turn are Natural subprograms). You can define input data and success critieria (complex tests can even use regular expressions to assert failure). Let me know if you need any more information.
From the little I’ve read on Natural Business Services (and please forgive me if I’m wrong), this can be used as a way of “SOA enabling” existing Natural subprograms buy adding (several) extra layers. We’ve done similar things with the EntireX Communicator wrapper for .Net.
To me it seems to be overkill to introduce Natural Business Services, if this is done only to make test driven development possible. And I guess you’ll often have several layers of Natural subprograms where you only want to expose the top (service) layer. The lower layers should be private to the service and as such not the first choice to expose via Natural Business Services?
Is it possible to test such low level Natural subprograms automatically along the lines of NUnit without introducing Natural Business Services?
Your understanding of Natural Business Services is correct. To answer your questions, you could service enable the lower levels by creating smaller private services that are for testing only. They can be grouped so that they are separate from your public services. You still need NBS to do this though, and I don’t really see a way to test via NUnit without it or some other way of calling your subprograms (such as the EntireX Communicator Wrapper as you mentioned).