I'm trying to find good comparison about performance of mstest(VS 2008) and nunit(newest).
I have found only articles about features, not examples about times of execution :/
I would be grat开发者_高级运维eful for help
I have experience with using MSTest and NUnit. From my experience, MSTest is much slower than NUnit. The actual execution of tests may be almost the same, however, the setup and teardown time for MSTest is significantly more.
Note that I have run the MSTest unit tests through the integrated VS GUI, which is probably why it's so slow (compared to the light-weight NUnit GUI). Apparently you can run MSTest through the command line, which may improve the setup and teardown time.
There are other things to consider though. MSTest is missing a bunch of features that NUnit has and NUnit has been around longer is more mature. Also, bug fixes will arrive much faster with NUnit than MSTest (how often are service packs released?).
Also NUnit works without visual studio, which means you can run these tests on a server without needing another VS license. I have read ways to get MSTest running without VS, but it involves copying files, which may or may not violate the licensing terms.
The test runner actually does quite a lot - it has to find all your test classes, and then identify all the test methods before calling them (probably by means of reflection, but possibly not). It also has to assemble and report the results. All of these can be efficient or otherwise, so there could be a noticeable difference in performance especially with a large number of tests in the suite.
精彩评论