Dave's Notebook

100% Code Coverage Possible?

100% code coverage

In response to my post “Excuses For Not TestingKris K asked:

There is also another side of Unit Tests. Some companies are so fixated they aspire to have 100% Unit Tests coverage and they make programmers write Unit Tests for legacy code for no reason. Just for the sake of having Unit Tests. … [I] wonder if you had any similar experiences and what you think about this approach. I guess the 100% extreme is better than no tests at all, but it can make the developers very bored and feeling useless.

And my initial reaction to this was, “WOW!  So much to respond to here.  I think this is worth a blog post.

Read More

Changing Habits

hand-039This past week I’ve been thinking a lot about changing habits and how much of our lives habits influence. To be clear, I would define a habit as something we have learned to do as an automated response to some trigger.  Something we no longer think about doing, but we just do because … well … because we’ve always done it that way.

I have some bad habits:

  • Eat something sweet when I’m tired or bored.
  • How I react to particular situations
  • … others I’m not so willing to share publicly …  :)

And some good habits:

  • Wake up before 4:40am
  • Go to bed at 9:00pm
  • Write a blog post once a week
  • Watch PluralSight videos for 30 minutes every day.

And some habits I’m trying to form:

  • Exercise every day
  • Take my vitamins
  • Work on my book for 30 minutes each day

Read More

Dependency Injection Frameworks Are NOT Dependency Injection

land-0148

As you start your journey down the road of Unit Testing you will discover that part of what makes code testable is this concept of Dependency Injection.  As you explore further, you will see people mentioning various Dependency Injection frameworks.

You may naturally assume that to implement Dependency Injection, you will need to select an use a Dependency Injection framework.

But, Dependency Injection has nothing to do with using a Dependency Injection framework.  The frameworks are there because:

  1.  much of our existing code is code that has too many dependencies and the framework helps us break those dependencies without having to refactor too much of our code and
  2. to give us a way to easily swap out one object for another when our code is structured in such a way as to not have dependencies at all.

Read More

Excuses For Not Testing

ppl-kid-044

As I started my own journey into unit testing, I slowly began to realize that it was really easy to come up with reasons to NOT test my code as I was writing it, even once I understood what that was supposed to look like. The reason I think most programmers don’t unit test code, once they understand what it is they are supposed to be doing is that they don’t feel like they have permission. To this I also answer, “How much permission do you need?”

Read More

Being Agile Is About The Journey…

… Not The Destination

BeingAgile

This post first started as I was discussing my post “You Aren’t Doing Scrum If …” with a friend who had read the post and was worried that I might not fit in an organization that wasn’t doing all of Scrum.  I’ve since had other conversations and as I’ve reflected on the topic, I still stand by my original post, because there are some fundamental properties of Scrum that you have to implement in order to follow that methodology.  This is why I called the post “You Aren’t Doing Scrum If …” and not “You Aren’t Doing Agile If …”

Read More

Selenium Grid Setup

SeleniumGridSetup

My experience with setting up Selenium Grid was frustrated by the lack of information available about exactly what I needed to do to get this working.

I’ve actually had this working for a while now and I’ve set it up, or helped others set it up now, several times.  So, I guess it is time to write a post about it so I can just send people here when I need to explain the setup.

Read More