Home » Archive by category "TDD"

Test Driven Development Kata – Roman to Arabic in JavaScript

Coding Katas are a way of developing your skills as a programmer.  I thought it might be informative to tackle one of the classics as a blog post. Depending on how this works, I may or may not do another one quite so publicly.

The rules I’m going to try to adhere by.

  1. I will document what I am doing as I go.
  2. This is not a pre-coded blog post.  You’ll get to “see” me code as I go.
  3. I will write all tests first.
  4. I will only write enough code to make the current tests succeed.


Test Driven Kata - Roman to Arabic

Continue reading “Test Driven Development Kata – Roman to Arabic in JavaScript”

3 Reasons You Believe 100% Code Coverage Is Impossible

I’ve written about Test Driven Development before.  I’ve even written about 100% code coverage before.  And I haven’t written much about it recently because I’ve been focused on JavaScript.  But, I’ve been thinking about the 100% code coverage debate more and I have a few more thoughts on the subject.

You see, the more I practice Test Driven Development, the more inclined I am to believe that there are only three reasons for arguing against 100% code coverage.

100% Code Coverage

Continue reading “3 Reasons You Believe 100% Code Coverage Is Impossible”

Test Driven Learning – An Experiment

As I mentioned last week, I’ve been learning React JS over the last month or so. Up until the start of this project, I would learn a new framework, and then I would try to paste in Test Driven Development after the fact.  I would use the excuse that because I didn’t know the framework well enough, I wouldn’t be able to properly write tests for it.

But this time, I decided to do something different.  What if I wrote tests for my demo application as I was learning this new framework?  My reasoning was that learning how to test code written in the framework was just as important as learning the framework.

What follows are the lessons I learned from this wildly successful experiment.

Photo credit: twm1340 via Visualhunt.com / CC BY-SA

Continue reading “Test Driven Learning – An Experiment”

The Parable of The Road Line Painter

land-0125Way back in the day when lines were first being painted on roads.  The early lines were painted by hand.  In those days, a painter was hired and given a stretch of road to paint.  The first day he got on very well.  In fact, he was one of the best line painters they had ever had.  His lines were perfectly aligned, there were no unpainted areas in the space where there should be paint, and he managed to get 500 yards of road painted.  The average line painter normally did 250 yards in the first day.  The managers who had hired him were quite pleased.

Well, the next day, he came to work and set off on his task of painting the road.  He still had another 500 yards of road to paint.  And yet, for as fast as he was, he was only able to get 350 yards painted that day.  Not quite what his managers expected given his performance on the first day.  But still, better than their average painter, and so they reasoned to themselves, “Maybe he hit an extra hilly patch of road or some other unforeseen obstacle got in his way.”

Finally, the third day, he came in and finished the patch of road he had been given.

Continue reading “The Parable of The Road Line Painter”