Designing for Testability
Automotive manufactures have long been on the vaunted TDD bandwagon. For years they have harnessed the amazing potential of unit testing, verifying components individually prior to the expensive and time-consuming exercise of assembling them to make a completed vehicle. Integration testing in the automotive world is very expensive and to find that a single component failure has wasted a fleet of test vehicles as well as many months of construction and fabrication is close to unacceptable. However, they have also long faced the question of when and where to design for testability; a line still not clearly defined in any...
Planning for the worst
"The status page we use to report service disruptions in progress is suffering a temporary misconfiguration."
Brilliance!
Technorati Blog Claim
I claim this blog in the name of Stuart Thompson for my new Technorati Profile.
LINQ to Coffee
Nice! A perfect addition to the reference material you keep within reach.
http://www.cafepress.com/linq.225122905
Debugging Into .NET Source Code
Many have “heard” that you can now step into .NET source code when debugging in Visual Studio 2008. For those who have not been doing this since the start of the year, you can find excellent instructions for configuring Visual Studio to get the necessary symbols here.
I highly recommend understanding this process and making it a part of your debugging routine. It often becomes necessary to understand why the .NET framework is behaving in a certain fashion while developing. By stepping into the source code and using the watch window, I’ve saved myself a lot of hours of head-scratching. More often than...
LINQ'd In #1 - Behavior Injection
As part of a continuing set of articles on LINQ, I want to first take a moment to look at how the "natural" syntax of LINQ is turned into executable code. Once we understand how those expressions and compiled we can investigate ways to extend the code that is being executed.
First of all let’s consider a very simple LINQ expression:
from num in Enumerable.Range(1,9)where num % 2 == 0select num
This expression selects the even numbers in the series 1–9. Let’s first break this down into the actual code that is being executed. Behind the scenes LINQ is viewing this expression as a...
Bluetooth Retro Handset
Here’s one for all the folks who had a hard time letting go of “the way things used to be”:
ThinkGeek Bluetooth Retro Handset
Deeper Project Visibility - with NDepend
Software projects, by nature, have a propensity for getting out of hand. No matter how tightly we adhere to our carefully crafted development processes, despite diligent and methodical software designing and refactoring, the elusive software project always seems to manage to get away from us and mask its true nature from our prying eyes. Something close to a bajillion dollars has probably already been spent in attempts to tame the software project and convince it to open up and reveal its inner secrets and with increasing success. It has certainly been my experience that the software projects I’ve worked on in the last...
HttpRequest
Have you ever wondered how an HttpRequest ends up returning a particular header code such as 500 Internal Server Error or 401 Unauthorized? This handy chart walks you through the entire request flow:
HttpRequest Flow Diagram - (Courtesy Thoughtpad)
I think I’m going to print this out and hang it on the wall.
New Array of Anonymous Objects
While coding up a couple of prototype LINQ queries this morning I came across a rather interesting syntax using anonymous types and object initializers. I wanted to show an example of using a where clause upon a property of an object but didn’t want to put a bunch of plumbing around it just to set up the example. In my head an array containing three Person objects would suffice, with each person object having Name and Age properties that I could use in my query. I wasn’t sure if this would compile but dropped it into the wonderful LinqPad and sure enough...
Snippet Compiler
If you haven't used Snippet Compiler before, I highly recommend you take the 60 seconds necessary to download and evaluate it. If you're anything like me it will instantly become an indispensable part of your development toolbox. I've been using Snippet Compiler for over three years now and can't imagine development life without it.
You can download Snippet Compiler here.
For those skeptics out there who would prefer to know what they are downloading first, just imagine a tool where you could type out snippets of C# to test a certain idea and have it compile into a simple...
Expressions, Delegates, and Lambdas, Oh My!
C# 3.0 heralded a new era of syntax candy that was introduced in a large part to support LINQ. The new syntax also brings expanded freedom of expression for developers, however by increasing the number of ways in which similar intentions may be expressed there is additional opportunity for confusion. In order to alleviate some of this confusion I decided to write about some of these new approaches and provide a reference for understanding how they relate to one another.
Anonymous Methods
First up on the chopping block are anonymous methods. Let's look at why these are cool and where you might...