Derik Whittaker

Syndication

News


Quantity is NOT a measure of Quality

Today I was asked what I thought about asking each of our feature teams to report the total number of new unit tests created during their iteration.  My knee-jerk reaction was to ask the person WTF were they thinking.  However, my better sense (yea, I have a little common sense) kicked in.

Before I started to explain my point of view, I asked the person what the intent of this requirement was?  Their reasons were below:

  • With this in place it will keep the developers inline in terms of knowing that creating tests is important
  • More tests == more coverage which SHOULD increase code quality
  • Simple measurement tool to track work items

 

Once all the points were stated, only then did I state my view.

  • Reason: With this in place it will keep the developers inline in terms of knowing that creating tests is important
    I am ok with this being a goal as it is important for each developer to clearly understand what is expected of them when creating code.  However, I would rather show them why creating unit tests should lead to better code with less bugs rather than force them to write tests or else. 

    We as a profession need to start taking the stance that we must convince or persuade developers, but rather show them why one way may be preferred or better.
  • Reason: More tests == more coverage which SHOULD increase code quality
    In general principle I agree with this statement, however unit test count is NOT a good measure.  Here is why:

    I could spend 2-3 hours creating a single unit test that proves out a extremely critical path in code which adds great value or I can spend 2-3 hours created 20+ test that add little to no value.  It is because of this single fact that count of tests (like lines of code count) can be a very, very useless measure.
  • Reason: Simple measurement tool to track work items
    Well, I guess there is only one thing I could say for this one….When should I turn in my TPS reports

Anyway, If you are reading this and can take anything away, it should be this. Measurements are good, but make sure you are measuring the right metric.  In terms of measuring code, lines of code and count of tests may not be the best measurement. 

Till next time,


Posted 08-21-2009 9:08 AM by Derik Whittaker
Filed under: ,

[Advertisement]

Comments

jdn wrote re: Quantity is NOT a measure of Quality
on 08-21-2009 7:22 PM

After you gave you view, I hope you then added, "BTW, WTF were you thinking?"

The point of testing should be to test the SUT, so that it fulfills its specifications.  That's it.

on 08-25-2009 5:54 PM

Agile/ALT.NET James Shore provides a Introduction to Agile for QA People This is late but Davy Brion has started a series on Build Your Own Data Access Layer Series . Some posts include Out of the Box CRUD Functionality , Mapping Classes to Tables , and

Sanjeev Agarwal wrote Daily tech links for .net and related technologies - August 25-28, 2009
on 08-26-2009 7:16 AM

Daily tech links for .net and related technologies - August 25-28, 2009 Web Development Clean Web.Config

Sanjeev Agarwal wrote Daily tech links for .net and related technologies - August 25-27, 2009
on 08-26-2009 7:20 AM

Daily tech links for .net and related technologies - August 25-27, 2009 Web Development Clean Web.Config

Eber Irigoyen wrote re: Quantity is NOT a measure of Quality
on 08-29-2009 6:34 PM

that's exactly like measuring quality by the amount of code

About The CodeBetter.Com Blog Network
CodeBetter.Com FAQ

Our Mission

Advertisers should contact Brendan

Subscribe
Google Reader or Homepage

del.icio.us CodeBetter.com Latest Items
Add to My Yahoo!
Subscribe with Bloglines
Subscribe in NewsGator Online
Subscribe with myFeedster
Add to My AOL
Furl CodeBetter.com Latest Items
Subscribe in Rojo

Member Projects
DimeCasts.Net - Derik Whittaker

Friends of Devlicio.us
Red-Gate Tools For SQL and .NET

NDepend

SlickEdit
 
SmartInspect .NET Logging
NGEDIT: ViEmu and Codekana
LiteAccounting.Com
DevExpress
Fixx
NHibernate Profiler
Unfuddle
Balsamiq Mockups
Scrumy
JetBrains - ReSharper
Umbraco
NServiceBus
RavenDb
Web Sequence Diagrams
Ducksboard<-- NEW Friend!

 



Site Copyright © 2007 CodeBetter.Com
Content Copyright Individual Bloggers

 

Community Server (Commercial Edition)