"Since the recursion was now unwinding did the other
solutions then come at a rapid pace?"
I've included an attachment which shows that the solutions
occurred in two instances of some 32,000+ each. Thus when
they came they came at a rapid pace considering the much
longer amount of time they did not come at all. You will not
that I opened and closed the file for each successful pattern.
Thus I could monitor the results as they occurred.
"Ah. User prescribed rules lets the 'tester' calculate what the
correct answer should be."
No. The tester simply sets a range, a sequence of contiguous
and non-contiguous values, some lying outside the boundaries
of a desired result, others on, and others inside. The tester
knows (or should) whether an answer is correct or not. Thus
he has expectations. He simply compares the results against
his expectations.
Actually it gets somewhat deeper than that. Supposed I have
a field for an inventory count, say "inv_cnt". Suppose I have
a rule that says it can't be negative and that it can't exceed
some upper limit say 99,999. A normal fullword binary integer
of 32 bits allows values into the millions. Let's suppose that I
state all this as "dcl inv_cnt fixed bin (32) unsigned
range(0...99999);".
This means I'm turning over to the software to inject the
necessary code to verify that any change to the value of
inv_cnt stays within this range. I've given it the rule in the
"range" clause. Now I don't have to remember it. Moreover I
can't get hurt if at some moment I have forgotten it. I've got
this software assistant that never gets tired or ever forgets a
million, zillion rules.
Now supposed I select by marking in some manner the "dcl"
statement, indicating to the tool that I want to test the
statement. The tool will respond by asking me for a value. If
I respond with "-15", it will respond "false". In short it will not
allow me to enter a value outside the range specified.
I could, for example, have two fields interdependent on each
other based on their values. Say if one field can have a value
of 3 or 7 that the other can only have a value of 9. I can in a
data declaration state this as a rule:
dcl field1 char(1) range(select(field2) when(3|7) then 9);
dcl field2 char(2) range(select(field1) when(9) then (3,7));
Now I can take any expression involving field1 or field2, where
either is the target of an assignment statement, select it and
have the tool ask me for the range of values I want it tested.
When I execute the test it will only return the true instances
of the sets of values that it generates.
Now I not only do not have to write all the test source to
implement the rules, but I have also minimized what data
values or ranges I have to submit and can guarantee that they
exhaust the possibilities.
"For me that would be interesting."
The VisualAge Cobol and PL/I compilers come with an analysis
tool that does a graphical representation. I will seek out some
non-trivial example to illustrate the iterative process of
testing from the inside out to completely test the code. There
is an open source one for C that I may have time to try on
HPCalc.
Content Type: application/octet-stream
File attachment:
sol_mtrx.txt
>> Next Message >>
Return to [ 16 |
February |
2003 ]
The Southern California OS/2 User Group
P.O. Box 26904
Santa Ana, CA 92799-6904, USA
Copyright 2001 the Southern California OS/2 User Group. ALL RIGHTS
RESERVED.
SCOUG, Warp Expo West, and Warpfest are trademarks of the Southern California OS/2 User Group.
OS/2, Workplace Shell, and IBM are registered trademarks of International
Business Machines Corporation.
All other trademarks remain the property of their respective owners.