Natural/Adabas @ z/OS - Unit Test support?

Hi,

I am looking for a way to create and run automated Unit Tests in Natural/Adabas running on z/OS. I stumbled upon other threads (Utilities for automated unit testing of Natural code SPoD? - Adabas-Natural - Software AG Tech Community & Forums, NUNIT: A Unit-Test-Framework for Natural - Adabas-Natural - Software AG Tech Community & Forums) where NatUnit is mentioned. It is also mentioned that this does not support mainframe (at leas not out of the box because of some used dependencies not available on the mainframe).

So, is there another/better approach about 6 years later available or is still everyone writing his own tools/frameworks/testdrivers? And is there something equal available for mocking dependencies like mockito/jmockit in Java? Or how do you deal with dependencies?

thx and best regards, klemens

Hi,

you can use NatUnit on a mainframe. You have to change the modul

NUREADTC.NSS

.
We simple read the file on Unix, you can change it to an Natural-User-Exit.

The Natural-Development-Department of the Badenia did it and use it on a mainframe, maybe you should contact them.

Best regards,

Markus Wessjohann

Hi Markus,

thx for your reply and for the “link” to Badenia.

Any thoughts about dealing with dependencies? Are there any out of the box (commercial, open source, …) solution for mocking them or mocking database access? We are trying to enable our developers to be able to write and run some sort of unit tests and therefore it would be necessary to mock specific dependencies to specifically focus on parts of the solution and not always “the whole system”.

thx, br klemensl

Hi,

there is no elegant way to do this in Natural, I explained 2 technics here
[url]https://sourceforge.net/p/natunit/wiki/Break%20dependencies%20in%20Natural/[/url]

Another one is to use Steplibs.

All technics are using stub-moduls, not mocks. There is no mocking-Framework in NatUnit implemented.
A lot of unit-testing strategies you can’t use in Natural, so it took me a long time to find the best ones.

The biggest issue on unit-testing in Natural is not the tools, it is the mindset.
If you want to develop with unit test you have a complitly different way to design the natural moduls.
This is very frustrating in the beginning.

happy testing,

Markus Wessjohann

Hi Markus,

thx for that direct link to the two strategies. Thats at least some sort of starting point for thinking about solving the dependency horror.

Vielen Dank :), lg klemensl

PS: I have to agree that besides dealing with the technology issues we have to change our way of coding. But we have to start somewhere :wink:

Hi,

yes I agree, but you should explain this to the developer before starting with unit tests.

Here https://sourceforge.net/p/natunit/wiki/NatUnit%20Tutorial/ NatUnit Totorial I wrote a little tutorial were you can start.

There are some flaws in the tutorial, but I have good experiance with it.

Best regards,

Markus Wessjohann