INCLUDE_DATA

Quick Testing Tips Your daily feed of short software testing tips…

5Apr/09Off

Random number generation tools

When testing software that relies on number inputs, it's easy to get caught up and use the same kinds of numbers over and over. To add variability, (and increase your chances of discovering something interesting) use tools to create numbers for you to test. Random.org has a lot of options available online.

In Ruby, all you need is to call the "rand" method in IRB. ex. try typing rand(32), rand(100), rand(1000) in IRB. Other programming and scripting languages have similar functionality.

In Excel 2007, try the RANDBETWEEN function: =RANDBETWEEN(-100,100)

Posted By Jonathan Kohl
Filed under: Free Tools Comments Off
Comments (1) Trackbacks (1)
  1. Most “weak” random number generots are able to set their initial status. E.g at perl we have ‘rand(x)’ which results the number [0,x[. If you have to be able to repeat same sequence of numbers every time you test, you can set the initial state with command srand(y). When ever ‘y’ is same, it outputs same sequence of numbers. This is useful way to create reproducable random data without recording the actual data. I’d use this way for fuzzy testing.

Categories

Authors

Pages

Blog performance enhanced by PHP Speedy Blog performance enhanced by PHP Speedy