Partager via


Improving the Cat Parade (Part 2)

There have been a few blogs that talk about the benefit of focusing hopper runs on individual applications to work out the stability bugs one application at a time. But, there comes a time when testing one by one may not be the best use of resources. Hopper runs are resource intensive (up to 10 devices running pass after pass for days at a time) and if you add several applications into an image, the testing matrics and time requirements become pretty overwhelming.

 

But, no worries. FocusApp is still the right solution for your stability testing needs. Instead of having FocusApp focus on one application at a time, have it iterate between a few of the applications. This will give you less coverage over each individual application, but it gives you the flexibility to balance hopper's resource usage.

The original source for FocusApp is available here: https://blogs.msdn.com/hopperx/archive/2005/11/30/the-cat-parade.aspx

And, here's some quick sample code that shows how I modified the sources to iterate through a list of apps:

 

WCHAR *g_aAppList[] = {
{L"\\Windows\\BubbleBreaker.exe"},
{L"\\Windows\\Solitare.exe"},
{L"\\Windows\\WMPlayer.exe"},
{L"\\Windows\\WMPlayer.exe"},
{L"\n"} //This marks the end of my list
};

 

WCHAR *g_aParamList[] = {
{NULL}, //No parameter for bubblebreaker
{NULL}, //No parameter for solitare
{L"\\My Documents\\My Music\\Really Long Sample.MP3"},
{L"\\My Documents\\My Music\\Another Long Sample.3GP"},
{L"\n"} //Indicate this is the end of the list.
};

 

...

 

    PROCESS_INFORMATION procInfo;
int indx = 0;

 

...

 

        CreateProcess(
g_aAppList[indx], //Launch the next app in the list.
g_aParamList[indx], //Pass the app some parameters.
NULL,
NULL,
FALSE,
NULL,
NULL,
NULL,
NULL,
&procInfo
);

 

        //Increment the count so the next app gets launch in the next iteration.
indx++;
if L"\n" == g_aAppList[indx])
{
//We've reached the end of the list, loop back to the first app.
indx = 0;
}
}

...

 

Notice that I have WMPlayer listed twice in g_aAppList. I did this to show you can launch the same application with different parameters to test different features/functionality. In this particular case, FocusApp will cause WMPlayer to load an MP3 file on one iteration, then to load a 3GP file on the next iteration. This guarantees that hopper will provide some coverage over both these CODECs. Of course, if different parameters don't change your app's behavior, then there's no need to pass it any parameters. In this case, just delete all references to g_aParamList and pass NULL as the second parameter for CreateProcess().

Comments