COBUnit is a new project I’ve started to scratch another little itch of mine. I’ve been a COBOL programmer since I started over 20 years ago and although I’ve moved on to more modern languages I still get dragged back into the murky world of WORKING-STORAGE SECTIONs and PROCEDURE DIVISIONs. One thing I hate is having to abandon the safety and comfort of my unit tests, so I thought I’d try and get something done about it, hence COBUnit.
Hopefully, I can keep this project alive long enough to produce something useful…
Advertisement
13 April 2009 at 11:41 am |
Hi, How’s it going? I’m interested in ways of testing COBOL programs. This is partly to test those programs, but also as a way of testing non-COBOL routines being called from COBOL. L
13 April 2009 at 12:25 pm |
I’ve not made much progress on this unfortunately. I started working on a pre-processor type of idea where you’d write code in an EXEC SQL type style, something like EXEC TEST ASSERT :WS-VAR1 EQUALS 42 END-EXEC. or something similar. But I’ve not managed to progress at all on this idea. I may not get chance to look at this in much detail over the next few weeks but I’m hoping to get back to it some time in May.
13 April 2009 at 10:08 pm |
I suppose a low-tech way would be with COPY … REPLACING …
copy “assert”
replacing
data-item by ws-var1
value by 42.
13 April 2009 at 10:22 pm |
… or
copy “assert”
replacing ==expression== by ==ws-var1 = 42==.
19 April 2009 at 9:39 am |
Leigh,
I had forgotten about COPY .. REPLACING. Don’t use it at all in my current work but it is a brilliant idea. Simple and wouldn’t need any work to port it between compilers.
I’m trying to put something together now – a website and a few examples – which hopefully may be finished by the end of the week…
19 April 2009 at 3:45 pm |
I knocked up a few copy files to test the idea. I’ve used then in a test program I’ve been asked to write. I’m looking forward to seeing your versions.
Regards,
Leigh
17 July 2009 at 7:49 am |
Hi,
There is a new initiative about testing in COBOL, you will be able to find more details on google code site: http://code.google.com/p/cobolunit/
27 May 2011 at 11:02 am |
Just stumbled over your blog today. You might be interested to know that we have launched a unit test unit tool some months ago that is especially aimed at testing cobol programs.
However, it is not a framework, but rather a tool which is designed to allow for unit testing without the need to write programs or scripts. We appreciate any comments. We are currently working on a presentation demonstrating how exactly it is intended to be used. Basically, cobol structures (copybooks) are parsed, then you define the interface to be tested. Finally you enter input data plus test output criteria which decide upon success or failure.