i have to run more than 400 integration test cases to run every day i will take more than 5 hrs to run. how can i cut down the nunit execution time into half? Is there any way to do this?
Asked
Active
Viewed 244 times
1
-
Are you using Mock Objects? Stubs? Please give more details. – Sean Thayne Aug 12 '11 at 03:09
-
i dont have any about it is mock objets or stubs – ratty Aug 12 '11 at 03:12
-
@ratty: If the code you are testing uses [Dependency Injection](http://en.wikipedia.org/wiki/Dependency_injection), then inserting mocks or stubs becomes much simpler. If you wrote the code under test, you might want to look into it. – Merlyn Morgan-Graham Aug 12 '11 at 03:42
-
How you run tests? MSBuild/Continous Integration Server/Visual Studio/NUnit console? – sll Aug 12 '11 at 08:53
-
im running using nunit console – ratty Aug 24 '11 at 08:08
2 Answers
4
May be running separate sets of nunit tests across machines can help you.

Deepansh Gupta
- 593
- 4
- 9
-
-
1have a look here http://stackoverflow.com/questions/3313163/how-can-i-run-nunit-tests-in-parallel – Rob Gray Aug 12 '11 at 03:14
-
Unless the processor is multicore, you would not get any advantage of running multiple threads as at a given point of time only one thread would be executing. – Deepansh Gupta Aug 12 '11 at 03:22
-
+1; This is the only sure-fire way to make a reduction in execution time, with no knowledge of the code under test. – Merlyn Morgan-Graham Aug 12 '11 at 03:46
3
Sounds like you need to refactor your code and tests and introduce mocks. 400 test cases testing classes with mocked dependencies probably shouldn't take 5 hours; maybe 5 minutes. That's a broad assumption on my part though.
In my experience, when tests takes a long time to run, they're more integration tests than unit tests. Perhaps this is your intention. If it is not, have a think about how you can better isolate each test case.
If you're only responsible for QA and can't change the code, I'm all out of ideas on actually speeding up NUnit.

Rob Gray
- 3,186
- 4
- 33
- 34
-
-
1If the OP can't change the code, sometimes they can *reconfigure* the code. For example, if the code is database-agnostic (uses something like `NHibernate` correctly), then they might be able to replace their across-the-wire DB access with an in-memory DB. Need a lot more details on the app architecture to make any suggestions like this, of course... – Merlyn Morgan-Graham Aug 12 '11 at 03:44
-
@ratty no-can-do. mocks are dependent on seams, which are specific to your code under test. – Rob Gray Aug 12 '11 at 04:53