The Ramblings of Two Microsoft .NET Developers, TFS, and Visual Studio ALM Guys --- "Yes, we are both named Ed."

Test Categories and Running a Subset of Tests in Team Foundation Server 2010



Disclaimer:  I’m writing this at a time when only Beta 1 is available for Visual Studio Team System 2010 so the information may have changed by the time it has been released.  I have included links to the relevant MSDN articles which should remain valid after release time so just double-check.

This small little additional feature is actually one that I have been looking forward to for a long time.  In Visual Studio Team System and Team Foundation Server 2010, you will now be able to limit your test runs to specific test categories with a new command-line option on MSTest.exe and therefore in Team Build 2010 which calls MSTest.exe automatically for you.

Back in the day… You would need to create test lists (.VSMDI files) in VSTS 2005 and VSTS 2008 to basically “categorize” your automated unit tests by putting them into different lists.  One handy thing about them is that the lists could be hierarchical which helps out at build time.  When you wanted to run a specific subset of tests either locally using MSTest.exe or in Team Build, you would just specify the .VSMDI file to use and then the test list you wanted to run.  Not too bad, but it’s a pain to keep up with those test lists.  Serious pain.  However, the thing that I hated absolutely most about them is that you could only edit the .VSDMI files if you purchased Visual Studio Team Suite or the Tester Edition.  So that means that if you have just the VSTS Developer Edition then you are pretty much out of luck.  For most places that I have seen, it’s usually the developers maintaining those test list files not the testers.

For this reason I actually prefer and will be recommending the Test Container and Category approach going forward in 2010.  Test Containers are essentially files that contain tests in them.  For example, unit tests (and other compiled tests) are stored in .dll files and ordered tests are in .orderedtest files.  I like this approach.  In automated builds I just want to specify which files contain the tests that I want to run and then if I want to limit the test run to just a subset I can just list which categories to run. 

A great example of this is what I call the “BVT” category.  These are the tests that you have identified to be your “smoke” tests that make sure a build is okay.  If these tests fail then you’ve probably got a bad build.  (BVT = Build Verification Tests) So I would limit the test runs on any CI or even the new Gated Check-In builds to just those BVT tests.  Quick & dirty verification is really all you need for those builds leaving a more extensive automated test pass to happen during the nightly or weekly build.  If you’re not familiar with the new Gated Check-In feature in TFS 2010, check out Brian’s blog post or Patrick’s blog post for more information.  It’s a killer feature.

This does rely on one thing though… each “developer” of an automated test needs to make sure they add the correct attribute(s) to their test methods.  You don’t have to keep up with maintaining the .VSDMI files any longer but you do have to make sure you mark each method appropriately.

You can even use test categories with the new types of automated tests available in 2010 like Coded UI Tests.  It doesn’t just have to be unit tests.

How to Specify a Category in an Automated Test

This part is pretty easy.  You just add as many TestCategory attributes to the test method as you need.  Here’s an example in C# using multiple test categories for a test method called DebitTest:

[TestCategory("Nightly"), TestCategory("Weekly"), TestCategory("Monthly"), TestMethod()]
public void DebitTest()
{
}

Alternately, you can select a test in the Test View tool window and then set the category by using the Properties tool window in Visual Studio and it will add the appropriate attributes to the methods for you.

image

How to Specify which Categories to Run in an Automated Build with Team Build 2010

Okay… this part is easy too. :)  Build definitions now have build properties that can be exposed to the end user in the Build Definition Details dialog or in the Queue Build dialog.  This is handy because you could by default not set a filter to run under normal circumstances (triggered or default manual builds) or you can change it when manually queuing a build if you want that build to run differently.  Either way it’s the same for setting the categories.  If you’re using the default build process workflow that is available out of the box, then just scroll down through the property list until you reach the Testing section which includes a build property called Test Category.  Leave it blank if you want to run all tests or specify the categories you’d like to limit it too:

image image

According to the MSDN documentation for the Test Category switch, you can combine multiple categories in different combinations instead of just specifying one category.  Very handy – here’s some examples:

  • /category:group1 runs tests in the test category "group1".

  • /category:"group1&group2" runs tests that are in both test categories "group1" and "group2." Tests that are only in one of the specified test categories will not be run.

  • /category:"group1|group2" runs tests that are in test category "group1" or "group2". Tests that are in both test categories will also be run.

  • /category:"group1&!group2" runs tests from the test category "group1" that are not in the test category "group2." A test that is in both test category "group1" and "group2" will not be run.

  • What I’m not sure about is whether you can specify test categories when using the old Upgrade Build Workflow template .xaml file… I’ll check on that and then update the blog post.

    It’s worth noting that if you are going to use the test category method to limit test runs, you must use test containers.

    Limiting Test Runs Based on Test Priorities

    If you noticed in the screenshot above from Team Build, you can also limit your test run to tests that are in a specific priority range.  How do you specify the range for your test methods?  You can use the Properties window when selecting a test in the Test View tool window or you can add the Priority attribute manually to the test method.  After that you just specify the range of priorities to use in the test run.

    [TestCategory("Nightly"), TestCategory("Weekly"), TestCategory("Monthly")]
    [TestMethod()]
    [Priority(1)]
    public void DebitTest()
    {
    }

     

    Additional Note:  It appears that the product team is actually encouraging people to move away from the old .VSDMI approach in favor of categories.  Check their note out:

    NoteNote

    Test categories are recommended for use over the test lists functionality from earlier versions of Microsoft Visual Studio Team System Test, unless you have to create a check-in policy which requires a test list. For more information about check-in policies, see How to: Add Check-In Policies.

     

    Take care and happy testing,

    Ed Blankenship



    Workflow TFS Custom Work Item Control



    Now this is really cool!  There is a really cool visualization when using Team System Web Access that shows the workflow of the work item that I thought would be really cool if we could have in the Team Explorer client inside Visual Studio.  Well thankfully, Michel Perfetti (author of Fissum) just released a custom work item control that does exactly what TSWA does…

    clip_image002

    Remember, you can have different work item form layouts based on what client it is going to be loaded in so you could specify a layout for “WinForms” that would be the only one that would load this custom control.  Check out Neno’s blog post about this topic for more information.

     

    Check it out on CodePlex:  http://tfsworkflowcontrol.codeplex.com/

     

    Ed Blankenship



    Boosting the Cell Phone Signal in Your Home with zBoost



    It’s been a little quiet around here for me because I’ve been in the process of moving to Charleston, SC.  I think I’m settling in well and have a little more time off before I start my new Visual Studio Team System consulting job at Notion Solutions.  So far Charleston and James Island has been really great.  Lots of great stuff to do including restaurants, the beach, and lots of parks.  As much as I love Texas, it’s really good to live in a costal city.

    I just moved into my new homeCharleston Home and if you’ve been following me on Twitter you’ll know that the only thing that has been tough in the new house is the cell phone reception and Wi-Fi signals inside.  If you’ve ever had that problem, you know it can be a real headache.  (If I haven’t called you back it’s probably because I don’t even know that you have called recently :) !)  I really think they put metal mesh or steel plates in the walls and between the floors when they built this house!

    I believe @willia4 says it best:

    image

    The hunt was on to solve this problem and a few friends had suggested a newly available product called zBoost that creates a cell zone inside your home.  I was quite skeptical but after starting to look it seemed to be a realistic possibility.  After visiting the local Radio Shack and not finding it, I decided to look online and found it on Amazon.  A good thing about these products is that they also work with multiple phones & devices inside so you don’t have to worry about it only helping one device at a time.

     

    I spent some time comparison shopping  between buying direct and several online electronic shopping sites and noticed that Amazon had the best deal and about $100 off of retail.  Be careful about which one you order since there are three different models.  Two of the models only work with one set of frequencies but the model I chose is the “dual” frequency model that will work with both spectrums and nearly all the cell phone frequencies in the US.  If you order the single-frequency models you’ll save about $100 on other sites but Amazon had the dual-frequency model for the same price as the single-frequency models!

    Cell-Phone Frequencies

    • PCS 1900 MHz: Sprint and T-Mobile
    • CEL 800 MHz: AT&T and Verizon
    • For more information about the cell phone frequencies used in your area, check out:  Wireless Advisor

    Installation

    So the one thing that you’ll notice immediately (and the only thing I didn’t like about it) is that there are a lot of requirements for the installation to get it working well.

    • To capture the best signal, place the Signal Antenna as high as possible and position it vertically, keeping it at least 2 feet away from any metal.
    • The location of the Signal Antenna should be at least 15 feet higher than the Base Unit Antenna.  (If this is not possible, maximizing the horizontal separation between the two antennas is advised.)
    • If you have extra slack in the cable leftover, don’t let it be near the base unit.  Find the middle point in the line and collect the slack there.
    • Put the base unit closer to the middle of the house and avoid putting it next to an external wall. 
    • Before permanently fastening or bolting the antenna, be sure to check the signal strength in that spot using your cell phone and checking out how many bars you get.  That’s the most you’ll be getting from the cell zone created around the base unit inside.
    • Be sure to use the dedicated coax cable that they provide in the box instead of using the existing coax cabling that may be already installed in your house. For one, the cable provided in the box is RG-6 coax instead of RG-59 coax which is most often used for the TV coax cabling installed in houses.  RG-6 provides lower signal loss than RG-59.  The other more important factor is that you need a dedicated run between the antenna and the base unit so that the signal is not being shared for other things as the TV coax cabling is used in a house.

     

    Attempt #1

    The first attempt was to attach the antenna to a rafter in the attic and then run the coax to the base station in one of the rooms upstairs.  The initial installation check worked out well and the lights on the base unit ended up being happy.  Cell phone reception upstairs was just great.  As I started walking downstairs, I quickly noticed the signal drop very similar to what I had been seeing with my wireless router signal loss downstairs.  I swear there must be some steel plates between the floors that is causing some problems.

    This wasn’t going to work.  At home, I end up spending most of my time downstairs in the living room, master bedroom, kitchen, dining room, etc.

    Attempt #2

    Honestly, just take this route.  It’ll take some more time and possibly put you in some danger but just bite the bullet.  You’ll definitely appreciate the result in the end!

    I decided that the base station needed to go downstairs and probably in the living room where the signal needed to be the strongest since I spend the most time in that room.  So the best solution available was to attach the Signal Antenna to the roof, run the coax cable down the side of the house and then up through the floor of the living room, and put the base unit in the living room closer to the middle of the house.  Thankfully there was already a hole drilled through the living room floor so the cable was just run through it.

    Bingo – the signal was amazing downstairs.  Five bars  in the living room and four bars everywhere else downstairs.  Interestingly, going upstairs now there are three bars.  I don’t know the explanation but I’m just really glad it is all working!

     

    More Powerful Antennas Available

    If you feel the need to turn the juice up, you definitely can with the optional accessories and better antennas available that help you expand the coverage zone to nearly 10,000 feet.  They are available on the Wi-Ex site or through Amazon.

     

    And before anyone thinks that I actually installed this, I’ll just stop now and thank my friends (specifically Nathan) for helping out.  I’m not really the “handy” type of guy so it’s helpful to have friends who are :)  So here’s to five cell phone bars in the living room now…

     

    Take care,

    Ed Blankenship

    Posted in


    Technical Editor for New Silverlight 3 Book Released!



    There’s a new book that I was able to contribute to as a Technical Editor that was released.  Following the Silverlight 3 official RTW release, you might want to hop in quickly and start learning about all of the awesome new stuff available.  I knew each of the authors personally and you’ll enjoy reading & working through all of the examples in the book.  Have fun!

    Disclaimer:  That’s my personal opinion.  I don’t receive any royalties off of the book sales.

     

    Ed Blankenship



    PowerPoint Slide Deck for Real World TFS Sessions



    Just wanted to take a few seconds to post the slide deck I’m using for my Real World TFS sessions.  I’ll post a link to the recording of the MVP TV session earlier today when it’s made available!

     

    Ed Blankenship



    MVP TV with Ed Blankenship on July 15



    Also really excited about doing my first ever MVP TV set up by the Microsoft MVP program.  Hope to see you there!  We have an extra thirty minutes at the end so be sure to bring your questions.

    MVP TV: Real World TFS: Tips for a Successful Team System Implementation

    Wednesday, July 15th, 2009 | 9:00am – 10:30am (PDT, Redmond time) or 12:00pm – 1:30pm (EDT, New York City time)

    Targeted: This Product Group Interaction is open to  all Developer MVPs in all Technical Expertise and  public audience.

    So you’ve decided that Visual Studio Team System & Team Foundation Server is going to bring your organization added value (because it will :)) but what do you do now?  Please join Ed Blankenship as he covers the 2.5 years of successful implementation of VSTS and the experience of that journey at Infragistics, the world’s leading maker of software development tools.  The session intends to cover each phase of the implementation of all affected areas for a smooth adoption:  Version Control, Builds, Work Item Tracking, global deployment, moving multiple teams, training, automated testing, migration from legacy systems, and integration with other systems and TFS.  The goal will be to go through at a high-level of what it takes to make you successful by learning from the challenges and obstacles overcome.  We’ll also look in the future with VSTS 2010 and see how strategic planning will help make a successful adoption of the new features in the upcoming 2010 release.  The session is led by a Microsoft MVP (Team System) & Champ who has been in the trenches during the whole implementation.

    Prerequisites:  A healthy attitude in learning from other peoples challenges and a strong desire to make real change within your organization!

    About Ed Blankenship: Ed is a Microsoft MVP, Microsoft Certified Application Developer, and works as the Release Engineering Manager at Infragistics, makers of the world's leading presentation layer tools and components. His expertise consists of Microsoft Visual Studio Team System and Team Foundation Server. He is also a technical evangelist for Rich Client applications (primarily Windows Forms & Windows Presentation Foundation.) He has been a technical editor for several Silverlight books, an article author, and has spoken at various user groups, events, and conferences.

    PJ Forgione has invited you to attend an online meeting using Live Meeting.
    Join the meeting. (Link: https://www.livemeeting.com/cc/mvp/join?id=NP5FQZ&role=attend&pw=A49410Y0D )
    Audio Information
    Computer Audio
    To use computer audio, you need speakers and microphone, or a headset.
    Telephone conferencing
    Use the information below to connect:
    Toll-free: +1 (866) 500-6738
    Toll: +1 (203) 480-8000
    Participant code: 5460396

     

    Ed Blankenship

    Speaking at NYC VSTS User Group on July 28



    While I’m up in New Jersey working at the Infragistics headquarters office, I’m going to have the privilege of speaking at the New York City VSTS User Group on July 28, 2009 at 6:30 PM.  Come see me if you’re in the area!  Because of security concerns at the building, you do need to register ahead of time if you’re planning to attend.

    VSTS User Group

    Real World TFS: Tips for a Successful Team System Implementation

    Description:
    So you've decided that Visual Studio Team System & Team Foundation Server is going to bring your organization added value (because it will :)) but what do you do now? Please join Ed Blankenship as he covers the 2.5 years of successful implementation of VSTS and the experience of that journey at Infragistics, the world's leading maker of software development tools. The session intends to cover each phase of the implementation of all affected areas for a smooth adoption: Version Control, Builds, Work Item Tracking, global deployment, moving multiple teams, training, automated testing, migration from legacy systems, and integration with other systems and TFS. The goal will be to go through at a high-level of what it takes to make you successful by learning from the challenges and obstacles overcome. We'll also look in the future with VSTS 2010 and see how strategic planning will help make a successful adoption of the new features in the upcoming 2010 release. The session is led by a Microsoft MVP (Team System) & Champ who has been in the trenches during the whole implementation.

    Presenter: Ed Blankenship

    Bio:
    Ed is a Microsoft MVP, Microsoft Certified Application Developer, and works as the Release Engineering Manager at Infragistics, makers of the world's leading presentation layer tools and components. His expertise includes Microsoft Visual Studio Team System and Team Foundation Server. He is also a technical evangelist for Rich Client applications (primarily Windows Forms & Windows Presentation Foundation.) He has been a technical editor for several Silverlight books, an article author, and has spoken at various user groups, events, radio shows, and conferences.

    Date/Time:  07-28-2009 6:30 - 8:00 PM

    Location: Microsoft Offices in NYC at 1290 Avenue of Americas, 6th Floor

    Click here to Register

     

    Ed Blankenship



    Going Down Under – New Opportunity with Readify



    Dear Reader,

    I have decided to accept a Senior ALM Consultant position with the premier Australian consulting company, Readify.Australia Flag

    It’s always a tough decision to move on from a company you’ve really enjoyed being at.  I’ve really enjoyed the work that I have had the opportunity to do at Infragistics.  There are so many really great people at Infragistics that I truly will miss working with and hope to see in the future.  Some of my really good personal friends have been fellow colleagues at Infragistics which just shows you the type of culture that we have.  I’ve had an amazing team that I’ve worked with as the Release Engineering Manager and they have been truly able to make a positive change for the organization.  They’ve always been there to help make miracles and put in those really really long hours at release crunch time.  So really, I need to tip my hat to each of them for just being awesome:  Brian, Geoff, Kareen, and Jason.

     

    I’m really excited about this new opportunity.  I never would have thought in my wildest dreams that I’d be living abroad but the idea grew more and more on me as this opportunity came up.  I hear Australia is a beautiful country with an amazing culture.  I’m not currently planning for this to be a permanent move whatsoever but everyone I talk to about it says that I’m not going to want to come back! :) 

    I’ve heard about Readify for several years now as a Visual Studio Team System professional any time I hear about Australia & TFS/VSTS/ALM.  I’m really looking forward being able to visit multiple customer sites again and coming up with solutions to their ALM problems.  It’s been a while since I’ve been an ALM consultant so I’m looking forward to the variety.  Even more, as an MVP I’m looking forward to a whole new set of venues to get involved with the community on a new continent.  I think I’m going to have a busy schedule!

    There are tons of different things for me to solve as an American citizen living abroad.  It’s interesting that Grant Holliday just made the opposite move almost a year ago and I plan on doing the same thing as he has and try to write about the differences between the two countries.  Hopefully you’ll find it as interesting as I did with Grant’s story.

    I’m planning a really simple move:  packing up a few suitcases of clothes and jumping on a plane.  Hoping that works out well for me! :)

     

    I have decided to continue working with Infragistics until the beginning of August to wrap things up and hopefully train my replacement.  I guess the cat is out of the bag with the official job opening announcement on our website listed under Research & Development.  That position is listed to be the back-fill headcount for my current position.  Finally – I’d like to ask you to help us out:  If you’ve heard about our TFS instance and VSTS implementation from some of my user group talks or the Radio TFS episode and are interested (or know someone awesome who might be) in continuing this exciting work, please let me know!  You can send me a quick note to ed at infragistics dot com or use any of the contact links from my blog website.

     

    Take care!

    Ed Blankenship



    Radio TFS Interview – Using TFS at Infragistics with Ed Blankenship



    I’m up really early this morning.  I’m about to head to the airport to spend my Independence Day weekend in the Carolinas for some much needed beach vacation and visit with friends.  Thankfully, I didn’t miss Martin Woodward letting me know that the latest Radio TFS episode was made available just a few moments ago that includes my interview about our use of TFS and Visual Studio Team System at Infragistics.  It’s a longer episode than normal so it’s perfect if you’re going to be spending some time at the beach like me and listen to a fun talk.  We both really enjoyed chatting for this episode so we hope you enjoy it as well!

    Using TFS with Ed Blankenship

    In this episode we sit down and chat with Ed Blankenship about the use of Team Foundation Server at Infragistics. Ed has had some interesting challenges and experiences in running their TFS instance.  Additionally they have done some fairly advanced integration work which we discuss in detail.  This is a double-length show, so hopefully plenty of stuff to enjoy if you are sunning yourself on a beach somewhere.

    Ed is the Release Engineering Manager at Infragistics, makers of the world's leading presentation layer tools and components.  He is also a Microsoft MVP in Visual Studio Team System.

         Play Now: Using TFS with Ed Blankenship

    As the Release Engineering Manager, he leads the Release Engineering Department which is responsible for automated builds, creating product installers, packaging source code for customers, source configuration management/version control, metrics, release management, work item tracking, licensing enforcement, and development of internal productivity tools.  The department also is responsible for TFS Operations & Maintenance.

    Ed has been a technical editor for the Wrox Silverlight 1.0, Silverlight 2 Developer's Guide, and Silverlight 2 Bible books, author of numerous articles, and has spoken at various user groups, events, and conferences.

    Links from the show:

    As usual send any feedback to radiotfs@gmail.com.

     

    Feel free to let me know if you have any questions based on the Radio TFS chat.  I’m more than happy to get them answered for you!

     

    Take care,

    Ed B.



    Speaking at the Team System User Group Virtual Edition – EMEA Meeting in June



    Come join!  Here’s the website and the details.

    Website:  http://www.tsug-ve.com/

    JUNE EMEA Meeting
    Meeting Date: Thursday, June 18th, 2009
    Time: 10:00AM PDT/SLT (18:00 UTC)
    Location:  Microsoft Island in Second Life

    Real World TFS:  Tips for a Successful Team System Implementation

    OK, you’ve decided that Visual Studio Team System & Team Foundation Server is going to bring your organization added value (because it will :)) but what do you do now?  This session will cover the 2.5 year successful implementation of VSTS and the experience of that journey at Infragistics, the world’s leading maker of software development tools.  The session intends to cover over each phase of the implementation over all of the affected areas for a smooth adoption:  Version Control, Builds, Work Item Tracking, global deployment, moving multiple teams, training, automated testing, migration from legacy systems, and integration with other systems and TFS.  The goal will be to go through at a high-level what it takes to make you successful by learning from the challenges and obstacles overcome.  We’ll also look to the future with VSTS 2010 and see how strategic planning will help make a successful adoption of the new features in the upcoming 2010 release.  The session is led by a Team System MVP & Champ who has been in the trenches during the whole implementation.

    Prerequisites:  A healthy attitude from learning from other’s challenges and a strong desire to make real change at your organization!

     

    Take care,

    Ed B.

    Posted in Community | Speaking | TFS | VSTS