Home  |  About  | Last |  Submit  |  Contact
AllQuests.com

Previous Question:  New Shopping Directory  Website ReviewsNext Question:  Xbox Announcement Tommorow [Its Pacman] post #45  Xbox 360

Question Testing and debugging what slips through ( CodeGuru Forums General Developer Topics )
Updated: 2008-08-12 06:10:49 (0)
Testing and debugging what slips through

look at the following code (VB.NET)
Code:
Dim VarKey1 As Byte Dim VarKey2 As Byte Dim VarKey3 As Byte 'Generate new random keys Randomize() VarKey1 = CByte(255 * Rnd() + 1) VarKey2 = CByte(255 * Rnd() + 1) VarKey3 = CByte(255 * Rnd() + 1)

There is one helava big bug in that code .... and it has the probability of 1:85 in happening ....

In development and testing we executed the complete function about 1000 times already...

Today we were doing a quick speed test, just to see what sort of execution times the code has.. We recursivly called the function 1000 times,and on the 50th execution we hit a problem... "Overflow Error" ....
Look at the code again ... do you see it ???? ....

255 + 1 = 256 = More than a byte,the right code is: 254 * Rnd() + 1 ...

funny thing is this error did not occur on any of the 1000 previous executions, but as soon as we pushed it a little the crack opened up ...

Some bug's need you to push the code HARD to find them ...

Gremmy...

Previous Question:  New Shopping Directory  SitePoint Forums  Website ReviewsNext Question:  Xbox Announcement Tommorow [Its Pacman] post #45  PS3Forums  Xbox 360

- Source: Testing and debugging what slips through CodeGuru Forums General Developer Topics
- Previous Question: New Shopping Directory SitePoint Forums Website Reviews
- Next Question: Xbox Announcement Tommorow [Its Pacman] post #45 PS3Forums Xbox 360





AllQuests.com


Best dedicated servers   Top dedicated servers   Cheap dedicated servers   Linux dedicated servers   Windows dedicated servers   Unmetered dedicated servers