Coding and Dismantling Stuff

Don't thank me, it's what I do.

About the author

Russell is a .Net developer based in Lancashire in the UK.  His day job is as a C# developer for the UK's largest online white-goods retailer, DRL Limited.

His weekend job entails alternately demolishing and constructing various bits of his home, much to the distress of his fiance Kelly, 3-year-old daughter Amelie, and menagerie of pets.

TextBox

  1. Fix dodgy keywords Google is scraping from my blog
  2. Complete migration of NHaml from Google Code to GitHub
  3. ReTelnet Mock Telnet Server à la Jetty
  4. Learn to use Git
  5. Complete beta release FHEMDotNet
  6. Publish FHEMDotNet on Google Code
  7. Learn NancyFX library
  8. Pull RussPAll/NHaml into NHaml/NHaml
  9. Open Source Blackberry Twitter app
  10. Other stuff

Adventures With NancyFx - NHaml ViewEngine Integration Part I

It's been a long time coming, but at last NHaml4 (the downright awesome .Net port of the equally awesome Haml view engine) is getting mature enough to start putting to use. Before I officially release NHaml4 onto the world, I want to make sure that the new engine's flexible enough for general use, so I'm looking at integration with both MVC.Net and (my favorite of the open source web platforms) NancyFx as "must haves" before the release.

NancyFx was actually the platform that initially sparked my interest in NHaml, I never seem to stop hearing praise for its codebase, so let's see how easy this integration's going to be.

More...


Permalink | Comments (1)

Unit Testing Good Patterns #4 - Know When Not to Test

This week's been aaaallll about automated testing for me. On Monday, I attended Preston Codejo, looking at unit testing in Ruby. I was there as a Ruby novice, there were a couple of TDD novices, so some great discussion around the merits of TDD. My working week has been spent sneaking SpecFlow and acceptance testing into a new project at work, and yesterday I spent a few hours watching one of Uncle Bob's Clean Coders videos with some colleagues. As usual, my DRL posse had some really interesting thoughts around it - more discussion around the merits of testing followed.

And then there's a bit of discussion on Twitter about TDD not being the silver bullet some would tout it, I speak very highly of TDD as a practice. Some would describe me as a bit of a zealot, so in the interest of balance, I want to make a confession.

More...


Permalink | Comments (0)

NHaml - Lessons From Adopting an OSS Project

Hi all,

Some weeks ago now, I blogged that I've adopted the open source NHaml project over at GitHub, I'm now an administrator. I also mentioned that I was looking to get an initial release out sometime in December. Since then I've been beavering away at the thing, we're now most of the way through December, it feels like it's time for a status update.

In this post, I'll be talking a little about the project as I picked it up, lessons learned in my first baby steps adopting an established OSS proect, the decision to go with a (almost) rewrite, TDD and why I feel this is important stuff, and a few other odds and ends.

Incidentally, I in no way whatsoever mean to sound like I'm having a dig at previous contributors to the project, the stuff I'm putting into the project now owes massively to these earlier contributors, I'm trying to evolve as many of their existing ideas as I can. 

More...


Permalink | Comments (0)

Living With Tests - Some Gems Courtesy of Toughtworks' Dan Moore

A few weeks ago I was fortunate to watch a presentation given by Dan Moore, at the Thoughtworks office over in Manchester. The guy giving the talk was my sort of geek - I got the impression that he wasn't a lover of giving presentaitons, but he did love the tech enough that he just had to share it. I've been there! There were a few good little nuggets I took from the talk, that looking on my to-do list I really wanted to blog about, for example page objects, the "mysery guest", making test fail elegantly, etc, so without furher ado, here we go.

More...


Permalink | Comments (0)

Unit Testing Good Patterns #3 - Know Your Moq Argument Matchers

Having spent some time working with Moq, I've found that understanding the argument matchers bundled up in the "It" class is pretty useful stuff. The "It" class is a static class with a few methods on it that are used to tell Moq about the arguments it should expect to receive from your code.

This post is going to be a fairly in depth run through of the core two It methods - It.IsAny<T> and It.Is<T>(a => a....) - followed by a quick skim through the less used It.IsInRange and It.IsRegex methods.

More...


Permalink | Comments (0)

Testers Aren't Devs! - Build Product-Specific Test APIs, and No Stinkin' Selenium IDE

As some of you may know, for some months now I've been digging into automated testing. Unit testing, Selenium testing, coverage tools, specification testing, I'm lovin' it. But the tools aside, I have come across one problem which I've both seen first hand and heard plenty about second hand. Testers are not developers, nor are developers testers! You can't sit your testers in front of a blank visual studio solution and expect them to fly, and on the other hand your devs don't want to test, they want to be off building cool stuff! So what's the solution?

More...


Permalink | Comments (0)

Creating a Simple Build Pipeline with Jenkins/Hudson and NAnt

Hi all,

Anyone who's following the FhemDotNet twitter account (at the time of writing that will be... me) may have noticed a flurry of tweets the last few days.  I've been experimenting with ways to improve the build feedback and performance I'm getting from Jenkins, using multiple build jobs and the "Copy Build Artifacts" plugin. I've now got the ability to check in a code change, Jenkins will run a build job, and then fire off two test jobs simultaneously (unit tests and integration tests), tweeting passes and fails for each of the three jobs, and giving me quicker and more detailed feedback along the way.

It took a fair few stabs to get it right, so best I share my learnings.

More...


Permalink | Comments (3)

Should Unit Tests Live in Production Projects?

As I'm doing more and more work with unit tests, I'm beginning to have some pretty unconventional ideas around the way we organise our test code and production code. My latest thoughts? I'm seriously considering putting all of my unit tests in my production projects and wrapping them in compiler conditionals so they're not included in release assemblies.

These aren't the worst suggestions I've heard - some people are even advocating including your unit tests in your production classes, just tagged at the bottom, I'm not sure I'm quite that far gone, but I'm getting there.

More...


Permalink | Comments (4)

Unit Testing Good Patterns #2 - Fluent Builder Pattern in C#

Hi all,

Today I'd like to share my experience with the builder pattern, and how it can radically improve the brevity and readability of your tests. Don't you just hate unit tests that have a whacking big "Arrange" section, one that fills up your whole monitor screen? While it's not a magic bullet, the Builder pattern can help with this.

Simply put, the Builder pattern involves creating static classes with static methods designed to new-up instances of your business-entity classes, populated with common and typical data. Used with some extension method goodness, we'll also see how easy it is to create builder classes using nice fluent interfaces.

More...


Permalink | Comments (0)

Unit Testing Good Patterns - Stop Putting String Literals in Code!

Hi all,

A short one - and it's actually a tip I've picked up from a co-ninja in the office (much kudos due to @datoon83). When doing some work with unit tests, we've discovered an anti-pattern we've applied throughout our application, which is to hard-code messages into our source code.

The simple lesson - don't use string literals in your application codeuse Resource files instead! There are plenty of examples where we've done it, things like exception descriptions, audit  notes, user confirmation messages, etc.

More...


Permalink | Comments (0)