Test Driven Development in Visual Studio 2010 Team Foundation Server

by Dmitry Kirsanov 27. December 2011 14:50

Team Foundation Server 2010This is the 3rd post in a series of articles about Visual Studio Team Foundation Server 2010 for developers. And this time it is about test driven development. Previous one is available here.

 

Test Driven Development is the concept, which dictates creating unit tests before actually writing the code. To help you to understand this, let’s assume that you are writing the calculator program. And that whole calculation process is done by a separate class named Calculator with functions such as “Addition”, “Subtraction”, “Multiplication” and “Division”.

Now, according to Test Driven Development process, you should first create the test project, and write your tests for each of these functions. Since you know what result should be given for what input (like – “2 + 2 = 4”) you can make your tests to assert, that if you are running the Addition function with parameters of 2 and 2, the result is 4. If the result is different or exception occurs – the test is failed. More...

Team Foundation Server 2010 For Developers part 2 - Advanced Source Control

by Dmitry Kirsanov 4. December 2011 11:03

This is my second post about Microsoft Visual Studio 2010 Team Foundation Server for Software Developers. The previous one is here.

Now that you know how to submit your code to the source control, associate work items and use that information in your daily work, it’s time to learn the rest two things we skipped in the first part. The Branching and the Shelving.

Team Foundation Server is an Agile-oriented platform, and therefore many of it’s concepts supports the existing models of Agile Software Development. One of such models is Source Code Promotion Model, which basically means that your code moves through 3 stages – development, testing and production.

A word of warning: each model of Agile is a double bladed sword. It expects you to meet the conditions which will make this model effective, and if you fail to comply – you’ll get ineffective implementation, which could ruin your software development efforts. In case of Promotion Model, make sure you have a dedicated team of testers – not just developers from other project who came to rescue, but professional testers who are not doing any development. If you don’t have dedicated testers – forget about Promotion Model. More...

Security through obscurity

by Dmitry Kirsanov 8. November 2011 11:46

Rather short note for pen-testers.

Sometimes you have software which is contacting some web services – especially interesting when it’s about transferring files.

Sometimes some software packages, especially custom ones, made for a small number of customers, may have web services open for consuming by that software.

Pay attention to it. Sometimes there are exposed functions which could be exploited in a way that developers were not able to imagine.

For example, during my most recent pen-test, I was able to put files, delete and execute on server using only functions of exposed web service. Needless to say, I wouldn’t need any hacking tools or social engineering to penetrate networks of their customers as well.

This topic is rather omitted in CEH and similar courses, but with some base knowledge of programming you could kill the whole family of rabbits with one shot.

Also, as a side note about pen-testing. I noticed that even when you’re using simplest technique, a “no-brainer” one, customer will call you “hacker” or “genius” just to not call their developer or system administrator an idiot.

Team Foundation Server 2010 Test Manager Lab 5 - Web Load Testing

by Dmitry Kirsanov 1. November 2011 11:39

Next part in a series of Team Foundation Server 2010 Labs. Previous is available here (Lab 4, Test Runs).

This time it’s about Web Load Testing. When you are developing ASP.NET web application, it’s paramount to make sure your application is able to handle the required amount of requests, or at least you need to know the exact cap of your application for scalability planning. If your IT infrastructure is working according to ITIL / ITSM, you need to know what you need to scale out your application and how to do it right.

We are going to find the bottleneck in our application and refactor it when needed, so sudden success of our website will not mean eminent failure (see Slashdot Effect).

This Lab is longest so far (1h 17m) and contains materials which are valuable even if you don’t have TFS installed. You may perform Web Load tests using Visual Studio 2010 Ultimate and virtual machine with IIS installed, but that’s a good topic for another article.

And now – enjoy and don’t forget to watch it in full screen HD!

Team Foundation Server 2010 Test Manager Lab 5 - Web Load Testing

Team Foundation Server 2010 Test Manager–Test Cases and Shared Steps

by Dmitry Kirsanov 31. October 2011 15:33

This screen cast of interactive virtual lab describes the feature of Test Cases and Shared Steps in Team Foundation Server 2010’s Test Manager.

Since there is still no MOC for TFS 2010 (although it has a number of 50430) the only resources you have for now are lectures of TFS gurus and virtual labs. Fortunately, usually that’s enough to pay attention to recorded lab session in order to understand the subject.

So, as always, enjoy the view and don’t forget to switch to Full Screen HD in order to see anything.

Team Foundation Server 2010 Test Manager Test Cases and Shared Steps

Team Foundation Server Quality Assurance Lab 2 - Test Plans

by Dmitry Kirsanov 31. October 2011 14:34

When I learn new material, sometimes it’s enough to me to see system in action to understand the principles behind it’s logic. Especially when it is self-descriptive lab like this one. Team Foundation Server 2010 is very complex but extremely valuable engine to energize your software development division, and one of it’s key features is automated testing.

With TFS automated testing you can automatically deploy virtual machines with required configuration, deploy the latest build of your software and test it for various scenarios. When bug is found, TFS (automatically) creates bug record in it’s centralized system, attaches screencast (video) of the incident and developer can work on solving that bug immediately.

Once you start working with TFS in your .NET software development, you can’t imagine life without it.

This lab is about creating and working with Test Plans, and while  there is no astrophysical concepts in it, the topic is usually hard to understand at first. The reason for that is quite simple – when you need to create schema for actual work, it’s harder to learn then performing the “real” action, as the necessity to do so doesn’t look as obvious, as, say, compiling your application.

Well, enough talking, enjoy the view! (And don’t forget to switch to HD!)

To see part 3 of this lab, regarding Test Cases and Shared Steps, click here.
Previous Lab (Test Manager Overview) is available there.

Running Windows 8 on local virtual machine

by Dmitry Kirsanov 21. September 2011 11:06

Just to repeat what I’ve said in my Twitter recently – now you have the ability to run Windows 8 Developer Preview on your VMWare Workstation. One week ago VMWare released Workstation 8.0, which doesn’t crash and indeed works quite well with Windows 8. Microsoft Virtual PC, as well as earlier versions of VMWare, still crashes.

After installation, you may notice that Start menu is changed by what is called Metro. If you prefer the “old” style Windows 7 menu, you can switch to that by switching one setting in Registry Editor.

In case you are using mouse, rightclick the taskbar, choose Task Manager, go to File and choose New Task. Now type regedit and click OK.

In Registry Editor, navigate to HKEY_CURRENT_USER\Software\Microsoft\Windows\CurrentVersion\Explorer
There will be setting named RPEnabled. Doubleclick it and change it’s value from 1 to 0.

Now enjoy your start menu.

Visual Studio 2010 Test Manager Overview

by Dmitry Kirsanov 14. September 2011 16:17

A little demo about how to use Test Manager from Visual Studio 2010 Test Professional / Team Foundation Server.

This one is the first of a series and doesn't either have or require any sound. Ideal for those who are using it as a reference during the work with real environment.

Play it full-screen for a “better experience”

This is a typical lab from Microsoft Official Curriculum. Don’t know how you, but I usually enjoy seeing things done as much as doing them, whether it is a lab or a computer game.

Browser Wars, 09/2011

by Dmitry Kirsanov 8. September 2011 23:06

As a web developer, I do care about browsers performance a bit less than typical web surfers do. I care more about the supported functionality. Whether my website can be viewed on this browser or another and how it will behave.

However, typical web surfers care more about speed and resources of their computers, so when I hear that people prefer Chrome to Firefox, this means my website should look well in that browser as well.

So here is a relative chart of today’s most popular web browsers after testing on my notebook. All numbers are totally relative, but tests included both graphics and data manipulations, the same for each test.

BrowserPerformance08092011

I don’t want to comment on it, as I find these results quite reasonable, but would like to look at the difference between MSIE 9.0 and MSIE 10.0. As you may notice, the Internet Explorer 10’s performance is promising.

So what did I understand from this graph? First of all, I will continue measuring performance of my applications using MSIE 9. And will make sure they are compatible with Chrome 13. And if that’s worth the effort, I will display demos using either MSIE 10 or Chrome. You can keep tracking the performance of browsers on your own equipment using PeaceKeeper website.