It’s all about systems – even if you’re testing only a component

Earlier this year I bought a brand new computer and wanted to play what turned out to be one of my favorite games of all times. However, it also turned out that this new computer of mine came with a pretty bad graphics card. It did work but the performance was so bad that even full screen…


MIX09 announced

Don’t make any plans for March 18-20 next year (or cancel the plans you’ve already made) since that’s when MIX will happen once again in Las Vegas. The MIX09 website is already online and if you liked what we showed you this year you will love the cool new stuff that’s coming up next! This posting is…


I Am The Seattle Code Camp (And So Can You!)

I have to admit something embarrassing: I’ve never been to a code camp! So, I thought, before people start making fun of me because of this, I’d better sign up for the Seattle Code Camp v4.0 which will be held on the third weekend next month in… Redmond of course (but I guess Seattle Code Camp just…


Which Microsoft virtualization solution to use for software testing

I have to admit the title is a bit misleading this time since – if you ask me – there is only one answer: Hyper-V! It is the first Microsoft virtualization product to support 64-bit guest operating systems, SMP for some guests (see Supported Guest Operating Systems for a full list) and with Enlightened I/O…


A poor man’s approach to testing with databases

Say you are working on software that accesses a database server and you need to test it. To some extent you’ll probably try to not actually hit the database with your tests by using a mock. However, this is not always possible, especially when we’re dealing with integration/acceptance tests which need to verify the system…


Pimp your VSTT exception tests

Writing unit tests in VSTT is great since it comes with a nice unit testing framework and the test tools are neatly integrated into Visual Studio. There is one exception though: Exception testing (yes, that pun was intended). Consider the following example: public class Foo {     private object[] _array;       public Foo(object[] array)…


Unit testing non-public types using reflection

Let’s say you want to unit test the following class: using System;   internal class Foo {     internal Foo(object parameter)     {         if (parameter == null)             throw new ArgumentException();     }       internal int ReturnZero()     {         return 1;     } }   First of all, besides being pointless, it is buggy….


How would you test a… C# code generator with Visual Studio Team Test

Introduction I spent some time this week thinking about how to test a code generator that generates C# code and is itself written in C# (so it’s once again all about managed code). At first I thought about how to verify the generator output directly. Since the output is C# code – which ultimately is just…


Compiling code at runtime, C# 3.0 and "Compiler executable file csc.exe cannot be found"

Compiling code at runtime is incredibly easy thanks to the CSharpCodeProvider class. But as always, there is a catch. Let’s say you have the following code snippet somewhere in your shiny new VC# 2008 project: CSharpCodeProvider codeProvider = new CSharpCodeProvider(); CompilerResults results = codeProvider.CompileAssemblyFromSource(new CompilerParameters(), @”     public class Foo     {         public int…


Transitionals – About a little piece of Acropolis that wanted to become open source

While Microsoft is certainly not an open source company there are some instances of code drops from, and open source projects started by teams at Microsoft that are released under licenses which comply with the definition of open source as defined by the Open Source Initiative (OSI). One well-known example is the Windows Installer XML…