But for now, I've got the tool below, which takes a program and spits out a new program with assert statements to guard against bad integer values. For example, if there is a while loop that might spin out of control, this tool might be able to warn you before it happens by checking the relevant variables leading up to the while statement. Anyway, if you have any comments, please contact me. I appreciate feedback. If you know how to create this applet without using deprecated functions, please let me know.
Instructions Click on the button below to show the text windows.
The demo included here only works if your browser supports Java 1.1 or higher. Details You'll notice that this spits out a plethora of comments in addition to the assertions. The third line, labelled VALS , contains the range of valid values for each variable, inclusive. These lines may also contain ranges for each variable, but they are actually equations used to determine the valid range. This may seem a strange idea, but in the realm of abstract interpretation, it can help determine program failures are inevitable before the program gets to that point.