background image
<< Types of Selectors | The Data Entry user group >>
<< Types of Selectors | The Data Entry user group >>

Random without replacement

278
Chapter 10 - Designing Performance Testing Suites
s
Parallel
­ Distributes its test scripts or scenarios to an available virtual tester (one
virtual tester per computer). Typically, you use this selector in functional testing.
The items are parceled out in order, based on which virtual testers are available to
run another test script. Once an item runs, it does not run again.
A parallel selector distributes each test script without regard to its iterations.
s
Random with replacement
­ The selector runs the items under it in random order,
and each time an item is selected, the odds of it being selected again remain the
same.
Think, for example, of a bucket that contains 10 red balls and 10 green balls. You
have a 50% chance of picking a red ball and a 50% chance of picking a green ball.
The first ball selected is red. The ball is then replaced in the bucket with another
red ball. Every time you pick a ball, you have a 50% chance of getting a red ball.
Because the ball is replaced after each selection, the bucket always contains 10 red
and 10 green balls. It is even possible (but unlikely) to pick a red ball every time.
Similarly, the Random with replacement selector is not guaranteed to run every
item in it, particularly if you have set one test script to run more frequently than
another. In other words, if your bucket contains 19 red balls and one green ball, the
green ball might not be selected at all.
s
Random without replacement
­ The selector runs the items under it in random
order, but each time an item is selected, the odds change. For example, think of the
same bucket that contains 10 red balls and 10 green balls. Again, the first ball
selected is red. However, the ball is not replaced in the bucket. Therefore, the next
time you have a slightly greater chance of picking a green ball. Each time you
select a ball, your odds change.
Therefore, if the first 10 balls selected are red, the odds of the next 10 balls being
green are 100 percent. Similarly, the Random without replacement selector runs
every item in it, as long as the number of iterations of the selector is greater than or
equal to the number of items in the selector.
s
Dynamic load balancing
­ With dynamic load balancing, items are not selected
randomly. Think again of the bucket that contains red and green balls. You have
assigned an equal "weight" to each ball. If the first ball that is selected is red, the
second ball selected is always green. This is because with each ball, or test script,
selected, the system "dynamically balances" the workload to approach the 50-50
weight that you set. You can set other weights that are not 50-50. The key point is
that the next test script to run is not selected randomly; it is selected to balance the
workload according to the weight that you have set.