Saturday, 28 April 2012

Creating Standard Environments in Visual Studio ALM 11

What’s new in Visual Studio Team Lab Management 11? Well, IMHO the most important new feature is the Standard Environments capability.

As far as today, if you wanted to use VSTLM you were forced to use Hyper-V and System Center Virtual Machine Manager to get the full flavoured Lab Management. Other kinds of machines could have been used, but it was not that automated and integrated.

Today with VSTLM 11 you can use whatever you want reaching almost the functionality of the Hyper-V and SCVMM equivalent! (with some exceptions we're going to see).

The only prerequisite is to have a Team Foundation Server 11 (Express, Basic, tfspreview.com, whatever…) with Team Build installed and configured.

We have to install the Test Controller…

lab0lab1lab2

…and we have to configure the Test Controller (default configuration at least, which is by setting the linked Project Collection):

lab4lab5

That’s it! Obviously you won’t get the automated provisioning and all it’s related to SCVMM, but now you can use VMWare, Xen Server, physical machines or what you want with no hassle!

Let’s see how to create a Standard Environment:

lab6

lab7

I insert the machine name, the credentials for the test user (it must be a local administrator on the test machine) and what role does it ‘impersonate’ (it can be: client, server, web server, web client, domain controller, database server).

If I need them, I can use some tags:

lab9  lab8

Then I have to configure the capabilities for the tests I want to execute (unit tests, Coded UI tests, etc.)

lab10lab11

Now it does some checks on prerequisites:

lab12

lab13

And then, it installs the needed agents and prepares the machine to be used. It takes some minutes, don’t worry Smile

lab14

Finished!

lab15

Now I can use it for my Build-Deploy-Test cycle.

Limitations: I can use only Windows Server 2008, Windows Server 2008 R2 and Windows 7 as a guest OS. For now, there’s no support for Windows 8 and Windows Server 2012, it will be supported by far in RTM or RC (I still don’t know).

The machines must be in a Active Directory domain, because you need a trust relationship with the Test Controller in order to automatically install the agents. In a later post we’re going to see how to workaround this and use workgroup machines Smile

Last but not least, here’s the MSDN documentation.

Monday, 16 April 2012

Run alternative unit test frameworks from Visual Studio 11

With Visual Studio 11 the whole set of testing features has been trashed out and remodelled upon a completely new shape.

If until Visual Studio 2010 you had as a default and mandatory choice MSTest (apart from the fact that you could patch-and-try another test framework, but that was not for mainstream developers IMHO, and moreover it was out of the IDE itself) from Visual Studio 11 on you can choose whatever testing framework you want.

The magic running underneath is quite simple. If before MSTest was just the way to do, now the whole test runner and all the testing tools rely on a brand new pluggable layer, which means you can plug-and-play (it sounds so Windows 95ish, isn’t it? Smile) NUnit, xUnit.NET, and all the frameworks that will provide a plugin to integrate in Visual Studio 11.

This is true on a test project, but even inside a test class!

To add support to other test framework is astonishingly easy: you just have to add them via NuGet:

image

image

Then you can remove the Microsoft.VisualStudio.TestTools.UnitTesting reference from your code, add the NUnit (or whatever) one, and start writing down tests as you always did with your favourite testing franework.

Tuesday, 10 April 2012

Excluding actions on certain software using Microsoft Test Manager

The possibility of doing Exploratory Testing (as I mentioned in my last post) includes some times where you have to use certain tools without being recorded by the MTM recorder.

You can configure selective exclusion in MTM just by selecting Local Test Run under Test Settings in Manual Runs on Test Plan’s properties:

image

Then opening it you’re going to find out, under the Data and Diagnostics tab, the Action Log flag.

image

Clicking Configure, you can specify certain applications for which you do not need recording actions:

image

Thursday, 5 April 2012

Tips for Exploratory Testing in a real world consultancy scenario

As the name itself suggests, Exploratory Testing is made to explore.

One of the best scenarios you can use it is in the early phase of a consultancy.

Imagine it, you’ve being called to fix some bugs and improve a web application. A deep look at the code is mandatory but…why not to add a lap around the web application itself, in order to quickly understand where principal bottlenecks may be located.

So, to do that, open MTM, connect to the related Team Project on Team Foundation Server, and create a new Test Suite for your Exploratory Testing (XT from now on) run.

image

Then start the session:

image

While you’re testing your application, you can use other softwares (fiddler, for instance).

Once you’ve done with it, you can attach whatever form of log or file (via a Network Share or a URL) to the Test Plan to make it more explanative as well.

image

It enables new scenarios based on exploration, really useful for developers hired on a need.