in

Platinum Bay

Peace, Love, and...

This Blog

Syndication


.NETicated

MSTest Digest #1

A couple weeks ago, I became engaged with some folks on Twitter about their specific complaints about MSTest. I received five complaints, some of which I sent off to Microsoft. I’d like to share the answers and Microsoft’s response in hopes of creating more awareness around the tool’s capabilities.

Artifact Cleanup – When tests are run, artifacts such as test results and the (optionally) shadow-copied assemblies are left behind. For a team running many, frequent tests, this can quickly eat up disk space.

In Visual Studio 2008, a new option was created to help alleviate this problem. Under Tools > Options > Test Tools > Test Execution, there is a new setting called Test Result Management which contains a numeric option to limit the number of old test results. For tests executed as part of an automated Team Build, the results should always be scorched by Team Build as they are subsequently stored in the Team Foundation database.

image

Extensibility: Creating custom MSTest attributes is a bit more drawn out than most would like.

Microsoft has simplified the ability to create custom test types by allowing inheritance from existing MSTest attributes. This builds on the Unit Test base and allows you to customize any part (initialize, cleanup, execution) of the test being run.

Transactions – NUnit has an option for Transactional tests, which automatically rollback after the test is run.

This is not provided out of the box. You can either code up the transaction manually (http://www.jimbodriven.com/2007/11/on-unit-tests-seed-data-and.html), or use the extensibility points to create your own test type to handle this.

Data-driven Testing – In NUnit, there is a RowTest attribute which allows data to be specified to use in testing (http://mjeaton.net/blog/archive/2008/11/03/getting-started-with-nunits-rowtest.aspx).

Microsoft is looking into this for future releases. For now, take a look how to achieve this in the current releases. This method has the added benefit of not having to recompile tests to change test data.

Accessibility: It was suggested that MSTest should be available as a standalone, free product, similar to NUnit, MBUnit, xUnit, etc.

Microsoft is looking into this for future releases.

 

So of course my next question is, what else don’t you like about MSTest?

Comments

February 19, 2009 7:00 AM

Pingback from  Dew Drop - February 19, 2009 | Alvin Ashcraft's Morning Dew

 

February 23, 2009 10:16 PM

Link Listing - February 23, 2009

 

February 23, 2009 10:16 PM

ASP.NET ASP.NET ListView: Displaying Hierarchical Data [Via: Adam Pooler ] ASP.NET Dynamic Data Resources...

 

September 28, 2009 7:42 AM

Creating parameterized tests for one. These are hugely useful for tests that have a complexity of testing input (such as any method that parses out a complex deta structure, and you need to test it using multiple inputs)

More importantly, and slightly on a bigger level, the use of hierarchical tests. In other words, a test that for it to pass, it means sub-tests need to pass.

This notion would allow for a BDD approach of specifying a testable requirement, but allowing for the specifications of what it means for that requirement to be met using multiple other tests. For example, you could have a "ShouldProcessAnOrder" test, which has three sub-tests "WhenProcessingAnOrder_ShouldVerifyPaymentDetails", "WhenProcessingAnOrder_ShouldSendOfAnOrderEmail", and "WhenProcessingAnOrder_ShouldLogOrderRequest".

 

May 21, 2010 4:08 AM

Pingback from  P15 P1500 Van New Autoaccessories4less, P1500 Boiler Digital Omap 3430

 

May 21, 2010 5:27 AM

Pingback from  Plymouth Sapporo Auto Parts, Sapporo Bumper Used

 

May 21, 2010 7:32 PM

Pingback from  Toyota Camry Prius Ford Escape Hybrid, Ford Escape Fender

 

May 21, 2010 11:31 PM

Pingback from  Columbia House Cd Codes, Used Bmw 745 Columbia Sc

 

May 22, 2010 3:32 PM

Pingback from  Custom Get Mercury Sable, Torino Headlight Door Cover Mercury Cougar 70 Mustang

 

May 23, 2010 6:20 AM

Pingback from  New Chevrolet Express 2500 Honda, Express 2500 Part Youtube Chevy Ii - 0.rkwrh.com

 

May 24, 2010 8:15 PM

Pingback from  1960 Chevrolet Biscayne Adoption, 1969 Chevrolet Biscayne 4 Door Sedan - 99.jordanbrandallamerican.com

 

May 25, 2010 8:52 PM

Pingback from  2004 Corvette Horsepower, Corvette 2nd Hand Review - 429.tgrconversions.com

 

May 31, 2010 2:40 AM

Pingback from  1981 - 2003 @ 1964 Ford F100 Specs, Ford F100 Pickup Trucks Sale - 345.ja3ra.com

 

Leave a Comment

(required )  
(optional )
(required )  
Add

About Steve

Steve Andrews is an independent consultant, INETA speaker, and Microsoft MVP for Visual Studio ALM. He has been working in technology for over ten years focusing on custom application development and Application Lifecycle Management. Steve is also Microsoft and IBM certified and a community fanatic having led sessions at nearly 100 events across North America. When he's not developing software solutions or engaging with the community about software technology, Steve is a closet singer and songwriter and plays the guitar and keys. Occasionally, Steve even gets to sleep. Occasionally.
Powered by Community Server (Commercial Edition), by Telligent Systems
© Platinum Bay | Some Rights Reserved Creative Commons License

Disclaimer: The information in this weblog is provided "AS IS" with no warranties, and confers no rights. This weblog does not represent the thoughts, intentions, plans or strategies of my employer. It is solely my opinion. Feel free to challenge me, disagree with me, or tell me I'm completely nuts in the comments section of each blog entry, but I reserve the right to delete any comment for any reason whatsoever (abusive, profane, rude, or annonymous comments) - so keep it polite, please.