Tuesday 19 February 2013

Scaling up with Agile



One of the  things about Agile that has intrigued me for years is how does it scale up to a truly enterprise scale. It is therefore, really interesting to see how main players in in the industry like Microsoft are using and reaping the benefits of Agile for its mainline products. I found the following video  of Dean Leffingwelll explaining scaling Agile project as very insightful. The video is about an hour long but it's well worth it in my opinion.


One of the key points from the talk is that how Agile needs to be implemented top down and how the top-management needs to "have their bacon" in the Agile projects as well. Over the last few years, I have had the privilege of working in some really good Agile projects where Agile makes catering changing priorities rather easy. But, I have seen the dark side where using Agile methodologies resulted in mayhem and a series of partially completed deliverables.

Using Agile doesn't mean that the "destination" is not known. A programme / project would still need a business case (why), specification (stories in Agile) and an acceptance criteria. 

Wednesday 6 February 2013

An exception occurred while invoking executor 'executor://mstestadapter/v1': Object reference not set to an instance of an object.


I have been meaning to blog about this error for a few days. Only got around to do so now. Recently, after a changeset was checked in, we starting seeing the following exception in our Team Build 

An exception occurred while invoking executor 'executor://mstestadapter/v1': Object reference not set to an instance of an object.

On the face of it, we couldn't find spot anything obviously wrong in the changeset. The solutions compiled correctly on local machine and all the tests executed successfully when ran from Visual Studio. However, in the team build the unit tests would fail.

Since, we are using TFS 2010 and our test include Visual Studio 2012 functionality, we are using the VSTest activity of TfsBuildExtensions to execute our unit tests. Behind the scenes, the activity executes the vstest.console.exe process passing all the test assemblies as command line parameters. This means that all our unit tests are executed in a single process in a single test run.

Looking closely, we spotted that some of our assemblies were targeted to .Net 4.0 and some of the assemblies were targeted to .Net 4.5 and we were using Entity Framework 5.0 in both these assemblies. Entity framework includes different versions of its library for assemblies targeting .Net 4.0 as compared to .Net 4.5. This is what the problem was. If a version of Entity Framework dll is already loaded to the process, the other version of the library could not be loaded and this is what caused the error. The solution is to run tests in different test runs.

I have create a simple project to demonstrate this issue. You can download from here. The error is very obvious if vstest.console.exe is executed from command line.