Archive | Visual Studio RSS feed for this section

Using Test Impact Analysis in Visual Studio 2010

8 Nov

A tweet this morning from David O’Hara about wanting something on the lines of Autospec for Visual Studio motivated me to look into the Test Impact Analysis feature in Visual Studio 2010. Test Impact Analysis allows you to see what unit tests have been impacted by your latest code changes. This means that you need to run only the affected tests rather than the whole test suite to ensure that you have not made any breaking changes. This is clearly a big productivity win, especially if you have a big test suite.

I created a small Calculator Class and corresponding unit tests to work with. Here’s what you need to do to get started with Test Impact Analysis.

  1. Open your project in Visual Studio 2010 and open "Test Impact View" window (Test->Windows->Test Impact View). You should see something like this.
  2. Enable test impact data collection by clicking on the link in the "Test Impact View" window. You can also do the same by going into Test->Edit Test Settings->Test Settings->Data And Diagnostics->Test Impact.
  3. To generate baseline data, you need to rebuild your solution and run all tests in your test projects. You can do this using the "Test View Window". Your "Test Impact Window" should now look like this.
  4. Make code changes that you are working on. Since I am just testing here, I modify my Add() method to do multiplication instead of additon. Now when I Save the code and Rebuild the project, the "Test Impact Window" automatically updates to show what tests need to be re-run. In this case, I need to re-run my "AddTest". I do so using "Run Tests" link in the "Test Impact View" or the keyboard shortcut Ctrl +R,Y.
  5. Running "AddTest" causes it to fail since I introduced a bug in the last step.
  6. Since my test failed, it still shows up under "Impacted Tests". I now fix my Add() method, rebuild my project and rerun the unit test. My unit test passes and the "Test Impact View" becomes empty again, indicating that my code is in good shape and safe to check in.

While this is not as powerful as running affected unit tests automatically in the background like AutoSpec does for Ruby, it’s defintely a step in the right direction. I can totally see this becoming a part of my workflow.

A couple of other things

  • Since Visual Studio only recognizes MSTest unit tests, I am not sure if this would work with other frameworks like NUnit. If you know of a way to do so, please leave a comment.
  • The Test Impact Analysis feature is available in Premium and Ultimate versions but not in the Professional version. See this for feature comparison between different versions.
  • I tested this with Beta 2 of Visual Studio 2010.

Working with Visual Studio on a Mac

15 Aug

When I recently purchased a Macbook Pro, I had a couple of options to set up my .Net development environment on there. I could use a Virtual Machine based solution such as Parallels or VMware Fusion, or run Windows natively using BootCamp. My first preference was to stay inside the Mac OS if possible. I spent some time researching which product other developers are having more success with and Fusion seemed to be  more stable and responsive for the majority of them. I downloaded the trial version from their website and took it for a spin, and have been really happy with it.

I have used both XP and Windows 7 in a VM with Fusion, and the performance has been pretty flawless. I allocate both processors, 40 GB of hard disk space and 2 GB of RAM to a VM. Some of my peers have long been advocating the advantages of developing using VMs, and now I totally get how cool this way of working is. I can create and restore snapshots at any point of time, create a new VM to try out any beta software, and keep my development environment isolated from softwares/utilities that it does not need (avoiding software bloat). I am using a Windows 7 VM right now for the most part and playing around with Visual Studio 2010 on it. I intially found the Unity feature in Fusion (it gives the illusion of running Windows apps natively on the Mac OS)  to be really cool, but I don’t really use it much. I have dedicated a Space to my VMs, and tend to work in full screen mode.

If you end up going the same way as me, I would recommend looking at multiple vendors before purchasing Fusion. I bought if off Amazon, and it cost me $23.49 (including a $10 mail-in rebate). Other sites,including VMware, offer it for upto $80.

Get free Visual Studio 2008 and .NET Framework Training kit

27 Feb

Get it here.

This kit includes presentations, labs and demos.

Now only if I could find time to go through this :( .

Registration for VS2008, Sql Server 2008 and Windows Server 2008 launch event now open

21 Jan

Registration for the “Heroes Happen Here” MSEvent has now begun.
You can find out more here.

Not only do you get to test drive the new products and meet the experts, but you also get free promotional versions of all 3 products. Its happening in Denver on March 20 at the Colorado Convention Center.

This is really cool, looking forward to this one!!! See you there.

-Latish Sehgal

Debugging Dot Net Source Code in VS2008

16 Jan

Its here!! You can now debug the dot net source code in VS 2008. Read more about this in Shawn’s post.
I am still not sure how beneficial this will be in day to day programming, but i guess it will be helpful in troubleshooting sometimes. Especially when it looks like we have found a bug in the framework :) (For the record, i never found a bug in the framework).
-Latish Sehgal

VS2008 released

19 Nov

linky
Yay for javascript intellisense..


Rss Feed Tweeter button Facebook button