Geeks With Blogs
// ThomasWeller C#/.NET software development, software integrity, life as a freelancer, and all the rest BlogFeedList.aspx There are 32 entries for the tag BlogFeedList.aspx
dotCover - a new kid on the (development) block

These days, JetBrains (the manufacturer of ReSharper (R#)) released the beta version of a new code coverage tool – dotCover. Here are my first impressions about it…

Posted On Friday, July 16, 2010 11:34 AM

Mocking the Unmockable: Using Microsoft Moles with Gallio

Usual opensource mocking frameworks can mock only interfaces and virtual methods. In contrary to that, Microsoft Moles can ‘mock’ virtually anything. Here's a little overview over this framework, together with a suitable Gallio extension...

Posted On Wednesday, April 28, 2010 1:36 PM

A way of doing real-world test-driven development (and some thoughts about it)

This post started out to be a reply to another blog post about some detail of the red/green/refactor cycle in TDD. It ended up as a fairly extensive description of my own personal practice of doing TDD in C#, featuring quite some VS add-ins and discussing some (real-world) aspects of test-driven development along the way...

Posted On Saturday, April 17, 2010 6:38 AM

A delicious toolbox

As a software developer, I'm especially interested in the various tools that are available to make a developer’s life easier. The knowledge about these tools also forms a substantial part of my professional assets. Most of the links that I bookmarked over the years point to some freely available stuff (e.g. OSS projects), and therefore I decided to make the collection available via Delicious. Maybe it will be useful to other people as well...

Posted On Saturday, February 27, 2010 2:50 PM

Making Selenium 1.0.1 work with Firefox 3.6

Shows how to patch the error that is encountered with the Selenium web testing framework when running it against the latest version of the Firefox browser (3.6)...

Posted On Sunday, February 14, 2010 10:00 AM

It's the maintenance, stupid! (or: Something is rotten in developerland.)

Most people - even the overwhelming majority of programmers - would say that the main activity of a software developer is "writing source code". But this is a fatal misconception - about 75% of all time and money (sometimes even more) is spent on some sort of maintenance activity. Far too little effort goes in the future maintainability of a software product during actual development, which in turn leads to software systems that cause substantial technical and financial problems..

Posted On Wednesday, January 27, 2010 2:03 PM

Integration testing an ASP.NET MVC application without web server or browser

Sometimes, it seems just too complicated or expensive to test-drive a certain component in an ASP.NET MVC context, or it would require the use of some browser automation framework. To make testing easier in such cases, this post introduces a Gallio/MbUnit test fixture that builds on top of a framework for integration testing ASP.NET MVC applications without the need for any browser or server, but still running in the real (non-mocked) ASP.NET runtime...

Posted On Saturday, December 12, 2009 6:25 AM

Integrating a LinFu IoC container with your ASP.NET MVC application

This post shows how an application's LinFu Ioc container can be seamlessly integrated with the ASP.NET MVC framework, enabling Dependency injection and the use of interfaces for controller creation and for viewmodels (both in controllers and views)...

Posted On Monday, December 7, 2009 7:25 AM

Unit testing StyleCop rules

Quite a lot of articles and blog posts can be found on the web, that tell you how to write custom rules for MS StyleCop - but almost nothing exists, that deals with the issue of testing such rules. To do something about that, this post presents an easy-to-use Gallio/MbUnit test fixture that makes unit testing of StyleCop rules a breeze...

Posted On Saturday, November 28, 2009 9:00 AM

Including custom client-side validations in your ASP.NET MVC app

This is a follow-up on my series about validating business objects throughout different layers of a software system - domain, persistence, and (ASP.NET MVC) GUI. It demonstrates how a self-written validation can be incorporated into a web page (using a bit of JavaScript) and how this can be mapped to a custom validation on the domain side...

Posted On Thursday, November 26, 2009 7:00 AM

Validating business objects with AOP (3: UI with ASP.NET MVC + xVal)

This is the third post of a three-part series that discusses the use of the ValidationAspects aspect library for business object validation and its integration in different application layers. This time the (server-side) validation aspects are "translated" to (client-side) validations of ASP.NET MVC application web pages, using the xVal framework to do the mapping...

Posted On Monday, November 23, 2009 4:47 AM

Validating business objects with AOP (2: persistence with NHibernate)

Validation is one of the most important objectives when crafting a domain. Domain objects must be sheltered from invalid property and method arguments. Moreover, it is sometimes necessary to explicitly validate an object's state, for example to enforce business rules. This is the second post of a three-part series that discusses the use of the ValidationAspects aspect library in different application layers to do this, this time looking at NHibernate integration...

Posted On Wednesday, November 18, 2009 7:33 AM

Validating business objects with AOP (1: the domain)

Validation is one of the most important objectives when crafting a domain. Domain objects must be sheltered from invalid property and method argument values. Moreover, it is sometimes necessary to explicitly validate an object's state, for example to enforce business rules. This is the first post of a three-part series that discusses the use of the ValidationAspects aspect library in different application layers to do this...

Posted On Sunday, November 15, 2009 1:57 PM

Including ad-hoc specifications in your test report

A developer might occasionally write down some informal piece of text during development. This post shows a method how such ad-hoc produced content can easily be integrated and referenced in a test report...

Posted On Thursday, November 12, 2009 3:23 AM

Solving 'KataPotter', or: What kind of developer are you ?

From time to time (and when there's room for it, of course), I'm doing a Code Kata to keep my programming fingers flexible and to see myself programming outside the usual business context. Lately, I did the KataPotter , and doing it gave me some valuable insights into my coding process...

Posted On Sunday, November 8, 2009 7:13 PM

TDD is not about testing, it's about how we develop software

I am practicing Test Driven Development (TDD) for some time now, and I hardly can imagine writing software another way nowadays, or could even imagine a reason why I should do so. Time to reflect upon my personal reasons for practicing and being so convinced about this technique...

Posted On Tuesday, November 3, 2009 10:02 AM

Unit testing ASP.NET MVC routes

Sometimes, unit testing/test-driving a certain piece of code is very painful and complicated, because the respective component has lots of dependencies. In such a case we usually decide not to unit test the respective component, simply because it wouldn't pay. The route table in an ASP.NET MVC application is such a component. To help with that, this post presents an easy-to-use base class for a test fixture targeting an ASP.NET MVC application's route table...

Posted On Monday, November 2, 2009 8:29 AM

My technical library is always with me

As a freelancer who is constantly selling his skills on the free market, I always have to be up to date and keep myself informed about the latest technologies - at least cursory. Although you easily can go overboard with that, not doing it is just not an option, if you have to maintain your competence. Continuous learning and continuous improvement are integral parts of a software developer's professional life, and this post is about what I do for it and how I handle it...

Posted On Wednesday, October 7, 2009 5:14 AM

Lazy loading, Inheritance, and Persistence ignorance (part 3)

NHibernate uses lazy loading by default, which is generally a good thing. But when applied to polymorphic objects, this can lead to unexpected behaviour and serious problems - the first two parts of this series talked about that. This post - together with its predecessor - demonstrates a technique to make NH create lazy-loading proxies for a concrete subclass instead of for an abstract superclass, thus avoiding some quite nasty, hard-to-debug and hard-to-understand pitfalls...

Posted On Saturday, October 3, 2009 5:57 AM

Duct Tape Programming? - Certainly not THAT way...

Lately, there was a blog post by Joel Spolsky called "The Duct Tape Programmer", which is very opinionated and caused quite a lot of responses and discussions in the blogosphere. Basically, this post contrasted the duct tape worldview of developing software to the astronaut architect's, forcing programmers to decide between quick-and-dirty solutions on the one side and analysis paralysis on the other. While all objective arguments against that are already made, here are some additional thoughts.

Posted On Wednesday, September 30, 2009 8:25 AM

'dynamic' ? - Be afraid, be very afraid...

One of the new language features, that come with C# 4.0, is the new 'dynamic' keyword. I was totally horrified when I first read about it, because it makes it much too easy to introduce (undetectable) errors into a codebase, can foster bad coding style, and certainly will cause serious maintenance problems. A rant...

Posted On Wednesday, September 23, 2009 6:37 AM

Lazy loading, Inheritance, and Persistence ignorance (part 2)

Previously, I described a problem with O/R-mappers like NHibernate that could possibly break domain code which is relying on type information (this is not only relevant for casting issues!). The problem occurs when NH creates a lazy loading proxy for a polymorphic object, not knowing the exact type of the proxy at creation time. This post presents the first part of a possible way to circumvent these problems and to be truly persistent ignorant - not just physically, but also logically...

Posted On Sunday, September 20, 2009 7:28 AM

Gallio 3.1 is here

A few days ago, a new version of Gallio was released, my favorite Test and Automation platform. Although the official version number suggests only a small progression, it actually is a major upgrade that brings a wealth of new features. This is a first look at the two features that attracted me most...

Posted On Friday, September 18, 2009 9:55 AM

AOP can save you tons of repetitive code

Lately I played around a bit with Aspect Oriented Programming, especially with PostSharp and the ValidationAspects library that sits on top of it. I wanted to see how I could reduce the amount of infrastructural code like e.g. value-checking, which is highly repetitive and error-prone. I must say, I was impressed of what can be achieved...

Posted On Tuesday, September 15, 2009 6:41 AM

Unit testing with built-in NHibernate support

Setting up NHibernate is not one of the easiest tasks, and having to do it for each of your relevant test projects again and again certainly doesn't make it better. So here's a small base class for a test fixture that comes with already pre-configured, ready-to-use NH-support...

Posted On Thursday, September 10, 2009 12:14 PM

Lazy loading, Inheritance, and Persistence ignorance (part 1.5)

A few days ago, I talked about a problem, that using an ORM like NHibernate could bring, when there's inheritance and lazy loading around. Unfortunately, the example in this post turned out to be somewhat unclear, giving the impression that type casting issues are relevant in some way. This is a short follow-up with another example, that hopefully underpins my arguments a bit more precisely.

Posted On Thursday, September 10, 2009 7:53 AM

Automating database script execution

Almost every software project comes with a database. But although this is quite common, managing database related tasks is not very handy from the development point of view. To make life somewhat easier, this post demonstrates a way to automate sql script execution for MS SQL Server, using the Gallio Automation Platform.

Posted On Tuesday, September 8, 2009 5:37 PM

Lazy loading, Inheritance, and Persistence ignorance (part 1)

Recently, I came across a problem with NHibernate (and ORMs in general), lazy loading, and polymorphism. Initially I thought it to be just another one of these fancy technical details that one has to deal with all the time. But now I consider it to be a 'real' problem that can question our entire approach to architectural layering.

Posted On Sunday, September 6, 2009 8:07 PM

NHibernate EnumStringType error, and praise for Open Source

NHibernate's EnumStringType class is a custom user type to realize an arbitrary mapping between an enum in your domain code and a related set of strings in your database. While playing around with it, I stumbled over some strange behaviour that turned out to be a bug in NH's codebase. It took me two days to finally nail down the problem. This is a short recap of my findings, that hopefully prevents some other poor developer souls to get stuck with the same problem...

Posted On Thursday, August 27, 2009 9:20 AM

Keeping your enums in sync with database strings

In some scenarios, you may have a database that contains text data in a column which is restricted to a certain set of discrete values. In such a case it is a good idea to use an enumeration for representing these data in your domain. This post demonstrates an easy and effective way to put this mapping under test.

Posted On Tuesday, August 25, 2009 4:01 AM

About hammers and screws

During the last days and weeks, there's an increasingly heated debate about the performance of NHibernate vs. some other commercial and noncommercial ORMs. While there may or may not be good arguments for both sides, the discussion seems to miss the point...

Posted On Saturday, August 22, 2009 8:10 PM

Keeping your enums in sync with your database

Having an enum in code that corresponds to a database table is a common scenario in enterprise application development. - For example you may have an 'OrderStatus' enum in your business logic and a corresponding database table 'ORDERSTATUS' in your database. In such a scenario the enum-table relation might be at risk to go out of sync. This post introduces a simple but useful unit test fixture, that keeps an eye on this for the entire project lifetime...

Posted On Saturday, August 22, 2009 7:18 AM

Copyright © Thomas Weller | Powered by: GeeksWithBlogs.net | Join free