1

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?

ratty
  • 13,216
  • 29
  • 75
  • 108

2 Answers2

4

May be running separate sets of nunit tests across machines can help you.

Deepansh Gupta
  • 593
  • 4
  • 9
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
  • will you provide some examples to implement mocks in my test cases – ratty Aug 12 '11 at 03:21
  • 1
    If 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