Typically when doing simulation (irrespective of tools used) for performance testing, maintaining mix is very important. Usually performance performance testing can’t simulate 100% of production workload. Typically performance tester will choose few test cases and mix for simulation which can put system under test(SUT) to 80% of production workload. Letz take a banking example. Say for example xx bank wanted to test their new core banking application for performance.
We can’t simulate all test cases for testing performance. So choose the test case which user does it often. As a performance tester, I would choose the following test cases and mix as follows.
1. Login/Logout – 85%
a. View account balace - 80
b. Mini statement – 5
c. Detailed statement - 3
d. Fund Transfer - 10
e. Add payee - 2
2. Casual browsing without login -15%
Choosing wrong mix/test case might screw the entire engagement
In loadrunner, simulating the above test case is very easy using groups. In webload, the same can be simulated by using multiple agenda. I usually do that writing driver script which I am more comfortable with. Here is how skeleton driver script might look like.
function InitAgenda()
{
IncludeFile(“alltransactions.js”);
}
wlLocals.globalMix=getMix(); // Get Mix function has to return 1 for 85% and 2 for 15% of time when it is called.
switch(wlLocals.globalMix){
case 1:
wlLocals.innerMix=getMix1() //getMix1 function has to return 1 for 80%, 2 for 5%, 3 for 3%, 4 for 10%, 5 for 2 of time when it is called
Login();
switch(wlLocals.innerMix)
{
case 1: ViewAccountsStatement();
break;
case 2: MiniStatement();
break;
case 3: DetailedStatement();
break;
case 4: FundTransfer();
break;
case 5: AddPayee();
break;
default: ErrorMessage(“Invalid inner mix : “ + wlLocals.innerMix);
}
Logout();
break;
case 2:
casualBrowsingTestcase();
break;
default:
ErrorMessage(“Invalid global mix” + wlLocals.globalMix);
}
In real testing, the driver script will be much more complex then above. Also getMix and getMix1 function has to be implemented properly and it has to tested carefully or else it will screw the entire test.