mardi 22 septembre 2015

How to load test an application that uses a stored procedure without a modifiable test environment?

hope someone knows a better way of doing this.

In my current project, I have developed a system that loads some info from database at startup. This info is loaded using a stored procedure. I would like to load test the app by providing different loads of data to look for bottlenecks/memory leaks or just check what's the maximum load the system can handle.

The problem I have with this is that I cannot change the database in the test environment. That data is fixed (refreshed from time to time with data from production actually, replacing sensible info of course) so the load test would only give me how the system reacts when given that specific load.

To overcome this I thought of adding a test implementation for the stored procedure so at least that class can create random data based on configuration values.

With this approach I would need to be intrusive with my code. My production code would include a test implementation and the only way I can think of to choose between them is based on profiles. The configuration for the test would also need to be included as part of the war file which I think shouldn't be there. I may be able to avoid this by pointing a test class to a specific path where I can store the config but I would need to check whether I'm even allowed to do this in the environment and that would also force me to create yet another test class for the test profile. Then I don't know whether I would be able to change the active profile through system properties or by including it when starting up the application as everything is done through deployment requests that execute fixed deployment scripts so I may have to deploy the project with the test profile active and redeploy it after that to change it back.

Has anyone suffered this situation before and found a better solution for it?

Thanks.

Aucun commentaire:

Enregistrer un commentaire