It has been five years since I first used NUnit and have used it with great success on almost every project since then. This post briefly reflects the pros and cons of Automated Developer Testing I experienced.

. Zero Defects can be the norm
Given a serious amount of control on projects I insist on ~100% coverage for the most complex pieces. Every time this happened the complex code was delivered with zero (or very close) defects. Admittedly before NUnit I received a lot of praise of stable code and attention to detail, but with with NUnit we can even redesign working code to be more maintainable and still release with almost 100% stable code. Redesigning for maintainability is not practical without a suite of automated tests – it normally requires a complete rewrite.

. 100% Coverage is for Fools
Sometimes creating Automated Tests make prefect sense, and sometime it costs more time than it saves. I aim for 100% coverage on reusable libraries, critical architecture and anytime I think the business rules are far too complex for QA to completely understand let alone regression test on a regular basis. 100% Coverage on simple data manipulation web page will be a frustrating waste of your time.

. TDD – Good luck with that!
Unless your company has several years experience writing Automated Tests you will not get buy in for TDD. Learn to walk before you try to run.

. Continuous Integration is an easier win
I can install a Cruise Control in a day and educate all devs in one 30 minute presentation. Before looking at Automated Developer Tests I highly recommend rolling Continuous Integration our first. It is a massive win for very little effort. Managers and developers alike always see the value, this should build up your credibility enough to start an NUnit pilot.

. Screw Mocks, use a real database, ldap etc
Yes Mocks can work, but in my experience I have seen developers waste time coding Mocks, Object Mothers etc. A far simpler approach is to commit to a reasonably large amount of upfront effort so the Automated Tests setup and tear down a real environment. This framework should be created one expert developer and will result in some complex, hard to maintain code, but it then becomes very simple for even junior developers to test large sections of their code, not just wimpy Unit Tests. This is the foremost reason I have had so much success with NUnit. I have my own framework for SQL Server/ Oracle which took about three re-writes to become as simple and stable as it is today – you will need great database skills and good C# but once written it just works. Via Cruise Control we automatically spot problems in build scripts instantly, if anyone changes sproc parameters without updating the DAL we spot that too! I even have a suite of test on one project that does an end-to-end publish mimicking data coming from several internal feeds, being data scrubbed by our system, transformed into records in our system and push out the other end to table ready for user consumption! Probably 100klocs of C# and PL/SQL are executed by a single test – if anything breaks we know about it very quickly.

. Hundreds of small tests or a few Large Tests?
A classic mistake I see is developers taking the Unit word too literally and set about writing literally hundreds of test for one module. Although sound in theory, it is madness in practice. These developers run out of time and generally I see a stack of pretty useless tests. You should aim for the most coverage you can per test, of course when such tests break it is not immediately obvious what broke but you will be aletred that something broke, and Cruise Control will show you what code changed since the last build – making it an easy fix almost every time. So do you want to spend weeks writing hundreds of tiny tests or a few days writing all-encompassing tests? In reality no team I have worked on has every has been permitted the time to write hundreds of test. Also most developers don’t have that kind of patience which is why TDD has a low adoption rate. To clarify this point in general go black box rather than white box – not I said in general, use your common sense here :)

. NUnit can really stress developers out
This is a serious problem when developers are under the gun to meet deadlines and an NUnit test breaks the Cruise Control build. Of course everyone knows all work should stop until the build is fixed, but 90% of developers will just mark the test with [Ignore] and work on what their manager is shouting for.

. Some Managers think that is what (cheaper) QA staff is for
No explanation is needed I am sure. Some managers get the SDLC and some do not, and I can offer no solution to this problem. Some managers can only focus on very short-terms goals.

After five weeks of DIY it stopped being fun. Over the last year we’ve all but re-built rental house #2. Everything other than the trees was 100% DIY, and these were the most satisfying:

  • New Bathroom (only ~ $800!)
  • New Kitchen (only ~$3000!)
  • Leveled, graded and seeded ~10,000 sqft of lawn (~$500 including bobcat, before water bill)
  • Took one day off to ride the bike

I know, I know you want pictures:





























Steve McConnell requires no introduction. Remember in Code Complete and Rapid Development Steve said Software Estimation really required a full book. Finally he found the time to aggregate all that has been written on the topic, sprinkle with his own wisdom and produce a Software Estimation guide intended for mere mortals rather than specialists in the field.

There are three main sections to the book:

1. Critical Estimation Concepts
2. Fundamental Estimation Techniques
3. Specific Estimation Challenges

Over the 18 years in IT four of the sixteen projects I participated in failed, in every case problems grew from wishful thinking and unrealistic estimates. If every IT manager read and understand chapter one if this book IT failure rates would plummet overnight, but then there would no hugely late projects for expensive IT consultants to rescue either ;) Admittedly chapter one teaches an experienced developer little, but I left with a better vocabulary to translate my experience into terms non-technical managers are likely to understand and agree with. The diagram called ‘Cone of Uncertainty’ and the section on why underestimation is really dangerous are prime examples that

Interestingly in every failure I saw serious problems mounting well before the projects were canceled. Trying to forewarn management generally results in being labeled a trouble maker, so before you batter a pointy-haired manager with this book make sure you can easily find another job!! I had to once; of course politics and wishful thinking did not deliver working code and the project failed. Both people responsible for firing me were fired for incompetence, and the client tells me they now have a much smaller team producing much better results after the purge; what a surprise ;) .

Recently I presented on Software Estimation at the local IASA chapter, the material was based on this book (with Steve’s permission!) and people loved the content – it seemed like every single person present came to me and said they enjoyed the material or emailed me later.

Offshoring is here for good, get used to it. Only last month I sold my recently delivered ’07 BMW to an Indian working in the US. He is an off shoring specialist with no coding skills whatsoever! The offshoring trend is way more advanced than you probably think. Oh yes, he paid cash for the car too, these Indians are smart people…

 

So what are we to do? In his first book ‘My Job Went to India’ Chad Fowler has delivered a ‘self-help’ guide for Western developers. Of course you dear reader, as a blog devouring overachiever, 80% of this book will be common sense. During chapter one I almost tossed it back on the book shelf, but Chad’s anecdotes from his time in India are pretty amusing, and chuckles from a tech book always keep me reading :) As the book progressed tips appeared that I bet even you too can learn from. The chapter on Marketing Yourself is something I wish I had read ten years ago.

 

The cover of the book was my IM avatar for a while – as hoped it generated quite a few laughs, but most friends had never heard of the book, hence this review.

 

It is an easy read and at only $13.57 from Amazon I suggest everyone pick up a copy

IASA Logo

This should be fun a night, I will kick off with a light hearted look at Cruise Control – it is amazing how many projects still do not use Continuous Integration. My plan is take demos and a few slides – knowing the Architect Group the audience will soon be talking more than me ;)

Next I will give a more formal presentation on Software Estimation – it will be a little dry, but I expect people in the room will liven it up with amusing tales from the field. We all have tales to tell of estimates which went awry.

The Architects group is really meant for Architects and CTOs with 10+ years experience. Even are you not an Architect (yet!) come along this month and enjoy these basic topics. Be aware that most regulars will call out any BS from presenters, I fully expect to be challenged and hope to learn a lot from other attendees.

The Atlanta IASA website is http://www.iasahome.org/web/atlanta.
We meet at Matrix in Dunwoody:

May 9 – 6:30pm to 8:30pm
Matrix (on the top floor)
115 Perimeter Center Place NE
Suite 250
Atlanta, GA 30346

Click here for a Google Map

The office is secure so if you are late knock on the window to the left of the door and someone will let you in.

Moved to WordPress

Posted: April 4, 2007 in Other

This is the new feed:

http://dotnetworkaholic.com/feed/

The transition was fairly painless. The DasBlog posts imported to WordPress directly from the RSS feed, but all the comments were lost. This may be a future possibility so I zipped up a working copy of DasBlog. Moving my eight Blogger posts to WordPress was easy with the correct plugin for ‘new’ Blogger (i.e. not the default Blogger plugin). First impressions are that WordPress is very easy to use, has plenty of features and lots of community support.

LinkedIn's second wind

Posted: January 25, 2007 in Technology

Like many busy people I used to politely decline requests to join LinkedIn – a social networking website for professionals. A few weeks ago I finally gave it a try and on uploading my Gmail contacts a whopping 70+ people I knew were already in LinkedIn, wow it has really taken off! Check out my shiny new LinkedIn profile here:

http://www.linkedin.com/in/PaulLockwood

What are the main benefits I see from the site? Luckily I have never have trouble finding contracts, but every so often I find myself working for really bad managers – incompetents seem to cluster, why is that? With LinkedIn I hope to avoid making such mistakes ever again:

LinkedIn should enable us to observe any company’s rate of turnover, especially to discover if competent senior developers are leaving in droves or only staying for a few months. As more and more people joined LinkedIn it will become pretty easy to contact someone who used to have the job you are interviewing for – what better way to get to the 411 on why they left than ask the individual themselves?

One thing I have found is that not every member responds to an invite immediately. After three weeks I sent a reminders to the few stragglers and all but one responded within the day – perhaps they missed the first ‘bulk request’ due to spam filters? Whatever the reason don’t forget than you can easily resend an invitation to an existing member.