views:

55

answers:

2

We are in a process of automating the most of known issues(for regression testing) that can be automated. However, we do find memory leaks through third party software. However, I do not know the way to automate the memory leak test that we found and fixed them.

Is there any advise on it?

+1  A: 

Generally the best way is to only do the thing that you think causes the leak, and, well, watch the memory only go up.

But of course, you need to test that doing "nothing" over that period of time, doesn't also cause memory to go up.

Because of this, and the generally confusing complicated nature of tracking down leaks (especially in 3rd party software) it can be pretty hard to write an automated test for it.

It depends on your environment, really. Perhaps it is possible to build an environment where you always start from scratch (i.e. a virtual machine) but it may not be possible.

Personally, I'd have a seperate, but still partially-automated, system for detecting the leaks, and run it "every so often". If it's 3rd party, you'll only need to do it when you add a new version of the software.

Noon Silk
A: 

Memory leaks become obvious when you run the program for a long time. Setup a test machine for long running tests, where the program is started once and then runs for several days without a restart. Have a defined set of regression tests, which is executed over and over again. When the memory consumption reaches some threshold the tests are considered as a failure.

Example: For a web application, you start it and then fire up regression tests (which simulates user input) over and over again for several days. Script these tests and add it to a continuous integration environment.

This is a different approach than usual regression tests, where you just start the program one time for each tests or test suite.

Theo Lenndorff