TFS, MSBuild and Code Coverage
When you have a testing framework in place you of course want to test it each build. But of course, you also want to know much code your tests are covering, a.k.a. CodeCoverage. It is in a way quite easy to accomplish in your build script. The only catch is the complete lack of documentation. Benjamin Day led the way (he he - it rhymes). What you need to do is two things: First configure the tests to run. This is easily done by adhering to good naming standards (all test assemblies ending with tests.dll). Then you can add create an item group called TestContainer, like below. This will run through all your tests. <ItemGroup> <TestContainer Include="$(OutDir)\%2aTests.dll" /> </ItemGroup> Secondly (and here is the secret) you need to specify that the tests are to be run under code coverage. The easiest way to do this is to setup a .testrunconfig-file...
Galenskaparna - hits from the past
This is a great song from a great old show - Macken.
I just love his way of taking out the worst in life.
Exclude generated code from code coverage result in Team System
One thing that have irritated me with the code coverage tool in Visual Studio 2005-8 is that you can’t exclude things from the code coverage result. For example - in VB.NET the MySettings-class is generated for each assembly that is created. The code in it is automatically generated and you shouldn’t change it (it even says so in a comment from the tool…). However it is counted when the code coverage result is calculated. The same thing applies for proxy-classes to web services for example. This gives an incorrect picture on how much of your code that is tested. But now I’ve found an attribute that might help: <debuggernonusercode()> This attribute tells the compiler that the code that is decorated with the attribute is not written by the user and should not be step into during debugging sessions. So when the testing tool encounters the attribute it will simply not...
How to get equivalent proxy-classes to implement a shared interface
After reading the great patterns book i was talking about earlier i soon ran into a problem that at first seemed pattern-like but was not after some examination. The case that we are integrating against a back end AS400 system, via Microsoft Transaction Integrator. The “problem” is that the department that is responsible for the integration is creating a web service for each program (“method”) we are accessing. I brushed on this in an earlier post about naming those web services. A lot of the stuff we are sending back and forth are equivalent but not the same, for example an header that all methods expect. They are equivalent but not the same since they are located in different namespaces, since the header are generated once for each web service. So what we wanted was to create an interface that all the headers could implement. To create the interface was...
Great Silverlight 2.0 Tutorial
Everybody who knows me knows my feelings on doing complex WebGUI. In short i think it is stupid - and also i have never met a developer yet who can show me a robust and simple way of managing the events of a web page. It is always, always fixes like; hidden fields, setting stuff in prerender etc etc. So my personal opinion of this is - don’t do it! Web is for simple stuff. The moment a request about a tab control or thing posting back is being said I would raise a big warning flag. You’ll get into trouble. (Of course I can only speak for ASP.NET, and love to be convinced otherwise). Luckily there is help on the way. You could either stick with simple HTML and use [ASP.NET MVC](http://weblogs.asp.net/scottgu/archive/2007/10/14/asp-net-mvc-framework.aspx) which removes all the crazy event-handling from the ASP.NET WebForm model. Basically this solution could be called...
Design patterns II
During the last three weeks or so I’ve been reading a great book,
Head First Design
Patterns. Now i have
As i said
earlier; This is
the best, funniest and most informative IT-related book I’ve ever
read - and that is quite a few if you count my years at the
I have tried to wrap my brain around Design Patterns many times but
failed, often due to the very academical language that is used
when you speak about such abstract thing. I cannot count the
number of times i got an “aaah”, “so it was this simple?” or
“finally!”-feeling while reading this book.
Now if the Head First team only could
put out some .NET stuff and I’ll be buying lots
and lots of those.
Sweet brass bander
I can’t withhold this sweet picture. It is from the Youth Brass Band
Championships in Great Britain held last weekend. Note
that she’s not even holding a normal cornet, it is smaller than a
regular cornet. But she is still playing a singing E. What a
Sprint demo, cold and speed
back - yesterday was a day with speed since we had to prepare the Scrum
demo we’re going to hold today. And as frosting on the cake i caught a
cold (kind of).
Well, nothing to do about that - the sprint demo today will be running
smoothly even if i am a bit
slower than usual.
The night at the shelter was quite quiet (:)) for me. I got to go to bed
at around 2345 and woke up 7 hours later without a single disturbance,
part from a soar throat. A very small contribution from me.
The demo was a success! The product owner said that she wanted to do
“the wave”, which was quite a good reception, don’t you think.
A night at the shelter
Tonight i am sleeping at the Salvation Army shelter for homeless in
Stockholm. It is a very good way for me to take part the most important
work that the Salvation Army does, and that i am embarrising seldom
Feels fine for now - i hope i don’t mess things up, though. There are a
lot of things to keep track of and the people i am serving are used to a
certain standard and certain ways. I hope i don’t let them down.
Bye for now - i’ll get back to you after the night.
More Black Dyke live video
God - they are producing at an unprecedented speed right now.
Here are another concert, with some truly great music:
http://video-2.leedsmet.ac.uk/View.aspx?ID=1171 (The Engima