There are some obvious benefits to pairing: Shared knowledge, keeping on task, holding each other accountable, reduced bad design/code. It is all about quality. When we make a mistake we live with it forever.
My wife works in heath care. She treats patients who have prostate cancer, with some sort of hugely expensive equipment that produces radiation. So when it comes time for a patient to receive treatment, how many people are involved in the treatment? Two, that is right two.
I have been so busy thinking about how as software developers we are changing the way we do our work. I didn't even notice that my wife pairs every day of the week. In fact she has regulations against treating a patient by herself. The medical community doesn't want people to make mistakes.
Why do we as programmers need to re-educate developers to not code alone? There are all sorts of regulations around treating patients with medical equipment. Shouldn't we consider our work just a critical? I say get that Bill to congress!
Sunday, July 19, 2009
Wednesday, April 29, 2009
Book Review: Test-Driven Development By Example
Test Driven Development By Example is a Kent Beck book that introduces developers to the concept of driving feature development through the use of tests. This is not a new book on the subject, but it is the book that all developers should read. I have been developing using tests for quite some time, and I have used TDD techniques as part of my development methodology. Unfortunately it took me until recently to decide and read an actual book on the subject.
Kent uses two different examples to show the steps that take place in a Test Driven solution. The first example is a Money application that uses Java for its solution. The second example is an exercise in building your own xUnit testing framework for Python. These examples show the cadence a developer uses to go from broken test to passing test. Rather then describing theory for how to write tests, Kent demonstrates. While showing the reader what steps are made and why decisions are made, he is actually building a case for specific patterns. The third section of the book looks at specific TDD patterns.
This book does a wonderful job of demonstrating small focused tests. Create a test that fails, make it pass, refactor. Each chapter follows this pattern by focusing on a single task. Many of the chapters are less then five pages. They focus on a single test that needs to be implemented and the following implementation. This style may seem rather annoying at first, but definitely conveys the sense of being able to put down the book at any time. You can in turn pick up the book and quickly get right back into the exercises.
This is a great book for both beginners and experienced TDD developers. Beginners will get a great first lesson on how to TDD and why it can be as successful as it is. Experts can get reinforcement on why decisions and behaviors are important.
Kent uses two different examples to show the steps that take place in a Test Driven solution. The first example is a Money application that uses Java for its solution. The second example is an exercise in building your own xUnit testing framework for Python. These examples show the cadence a developer uses to go from broken test to passing test. Rather then describing theory for how to write tests, Kent demonstrates. While showing the reader what steps are made and why decisions are made, he is actually building a case for specific patterns. The third section of the book looks at specific TDD patterns.
This book does a wonderful job of demonstrating small focused tests. Create a test that fails, make it pass, refactor. Each chapter follows this pattern by focusing on a single task. Many of the chapters are less then five pages. They focus on a single test that needs to be implemented and the following implementation. This style may seem rather annoying at first, but definitely conveys the sense of being able to put down the book at any time. You can in turn pick up the book and quickly get right back into the exercises.
This is a great book for both beginners and experienced TDD developers. Beginners will get a great first lesson on how to TDD and why it can be as successful as it is. Experts can get reinforcement on why decisions and behaviors are important.
Saturday, April 4, 2009
The Surplus
I was watching the TV show "The Office" and there is an episode where there is a surplus and a decision needs to made how the extra money is spent. If they don't spend the money it goes away, and the next year they receive less money.
Think of this, if you plan on running a 4 hour marathon. Suppose you are going to be done 30 minutes early. Would you run extra miles after the race so you can run for the full 4 hours? That would be silly. Then again would you slow down so that you hit the line an exactly 4 hours. This is the same surplus problem.
Suppose a software team committed to delivering a project in 9 months and they finished what they agreed to in 8 months? Looks like there is a surplus. How should that time be spent? Should the team get assigned a new project? Should the team be allowed to determine what they need to do over that 1 month period?
I see a very similar relationships between the three scenarios. Management funds projects and pays for it through money and resources. If the project cost the price or less, management gets what they asked for. If there is extra money or resources who gets to spend it.
I would think the team gets to spend the money or time. Lets face it as teams we rarely have extra cash or time. We also are more then welcome to accept more work. I think it is time to reward teams for being good at what they do. Let them decide how to spend the extra money. Lets face it we will probably prototype out something with a long term goal in mind.
Think of this, if you plan on running a 4 hour marathon. Suppose you are going to be done 30 minutes early. Would you run extra miles after the race so you can run for the full 4 hours? That would be silly. Then again would you slow down so that you hit the line an exactly 4 hours. This is the same surplus problem.
Suppose a software team committed to delivering a project in 9 months and they finished what they agreed to in 8 months? Looks like there is a surplus. How should that time be spent? Should the team get assigned a new project? Should the team be allowed to determine what they need to do over that 1 month period?
I see a very similar relationships between the three scenarios. Management funds projects and pays for it through money and resources. If the project cost the price or less, management gets what they asked for. If there is extra money or resources who gets to spend it.
I would think the team gets to spend the money or time. Lets face it as teams we rarely have extra cash or time. We also are more then welcome to accept more work. I think it is time to reward teams for being good at what they do. Let them decide how to spend the extra money. Lets face it we will probably prototype out something with a long term goal in mind.
Monday, March 23, 2009
Passion, Drive and Trust
I have been working on a team for nearly a year, and this is an account of the last couple of weeks. Essentially we ended up behind plan, I guess that is a whole different story to tell. With some drive and passion for success we were able to accomplish some pretty good stuff.
Early on the team was able to build some core values before we were up against a deadline. Code reviews were mandatory for everything. JUnit tests were required for all work we did. Fitnesse tests were also developed in appropriate areas. I knew we had a good culture when I wasn't the only one who asked about scheduling a review or where the tests were.
So we finally realized we were kind of behind with 3 sprints left. So I challenged the team to rev up up our output. It was a straight forward challenge deliver 50% more points each sprint and we would do a happy hour every two weeks. I would kick in $50 and I challenged the product owner and manager to each match the $50.
There are a lot of reasons that these gimmicks don't work. There are also a bunch why they can work. First it gave the team a challenge to do the impossible. Lets face it as IT professionals we like to do the impossible. It also gave us an opportunity to socialize as a team outside of the team room.
So what went right? We were able to have our first two happy hours. We are sure we are going to hit our last goal, because we ended up ahead of plan. Our management team is happy and the team feels great about what it has been able to accomplish. You would expect corners were cut to get the extra output, but because we had already changed the culture, the core values stayed strong. So rather than cut corners there is only one way to get extra output. Yes, lot of extra effort.
What stuff didn't work? First I ended up sick. I guess going on 4-6 hours sleep for 2 or 3 weeks really isn't great for the body. We ramped up our development, but non-developer testing has been more difficult to to match the increase. So we have a bunch of stories waiting for acceptance from our QA team. Can we deliver the work without testing, no. We still need to fix this. I didn't say we were perfect yet. Lastly I hope my boss doesn't expect the impossible on a monthly basis.
I still like the fact we are going to hit our deadline with quality. I would rather be drinking beer and making better friends along the way. I guess we would have been better off bonding as a team earlier in the release. Then again we needed to trust each other to accomplish our lofty goals.
Monday, February 16, 2009
Developing With Smaller Steps

My son has been learning to ice skate over the past months. I was lucky enough to use some of my software development skills, to help him become more successful. Here is the story of how my four year old learned how to skate and how you can build better software.
After getting my son all suited up and ready for the ice, he had his first lesson standing by himself. His second lesson started almost immediately: getting back on his feet after falling. His third lesson was how to move his feet. This was where it got more challenging: as soon as one foot moved, he needed to try and regain his balance. He would then move the next foot as quickly as possible to “fix” things; unfortunately, this caused him to fall faster.
He was persistent and kept trying as hard as he could. Eventually, I convinced him to take smaller steps; this allowed him to keep his balance throughout the movement and never need to react to any major changes. He moved slower like this, but he spent a lot less time getting up off the ice.
Somewhere there must be a lesson in developing software solutions:
- Small steps allow you to be in control.
- Large steps expose many possibilities for failure.
Small steps allow you to get from project start to the other end of the ice without falling. Don't be tempted to code in “big steps” just because you are on a creative roll. Instead, try writing down some “small steps” on index cards; if these steps are written as tests, you will have the start of a TDD solution.
Take those index cards and start coding the solution to the first test. When you can prove that the first tests passes, you can then move onto the next test with confidence. If you suddenly realize you need a new test while coding a small step, write it down on a card. Don't stop working on that small step until it is complete.
If I coded a solution for eight hours without any validation, I can assure you the solution would have bugs. Trying to validate those changes, certainly would take longer then the original solution. Obviously, coding for one hour (a smaller step) followed by some testing would be a better, more efficient practice. Shorten that time to less then five minutes and you will be on your way to success.
How big are your steps? Can you make them even smaller?
Friday, February 6, 2009
What my Xbox taught me about agile
I have spent a large portion of my career trying to develop new code faster than before. This sounded like a really easy goal to accomplish. I guess my original plan was always flawed. The more I tried to develop fast, the more I needed to fix bugs. When something from 6 months past becomes a problem, things would come to a really frustrating halt.
The first time I played Forza Motorsport 2 on my Xbox 360, I drove as fast as I could crashing into every wall. This caused my car to get turned around backwards and start driving in the wrong direction. The game seemed impossible. Then I tried something crazy. I slowed down!!! What slow down in a video game. I did and do you know what happened? My time was significantly better. Eventually I was able get better control of the car at higher speeds. Still I needed to control how fast I drove, you can't go through a hair pin turn at full speed.
Why am I talking about video games?? Well we can learn a lot about software development from this same problem. If you are constantly pushing out as much code regardless of the quality, you will hit walls. You will need to stop what you are doing and rework code. The addition of new features will take longer because things are not stable or testable. Fixing defects requires hours of debugging sessions.
I realize no one wants to create a mess, it just happens. The faster you go the more technical debt you build up. Does your manager have sleepless nights about the debt you are building? I doubt it, this debt is usually very hidden. It only resurfaces in defects or the inability to make changes to existing code. I can assure you that you will spend more time fixing the mess then it took to create it.
One of my favorite techniques for delivering quality code is automated tests. Unit testing are the safety net that we need to prove what we are doing. If you are practicing TDD you are proving that your intentions are realized in code properly. Think back to before you had these tools. Has anyone wasted a day looking for a solution to a boolean expression of (variable = false). Yes it is an assignment not a boolean expression and it will always come back true. Unit testing is important.
So why FasterSlowerBetter? I think it says a lot about how I want to develop software. I want to be faster, but experience has taught me how to get my goal accomplished. Going slower and having better deliverables sets you up for a more productive future.
The first time I played Forza Motorsport 2 on my Xbox 360, I drove as fast as I could crashing into every wall. This caused my car to get turned around backwards and start driving in the wrong direction. The game seemed impossible. Then I tried something crazy. I slowed down!!! What slow down in a video game. I did and do you know what happened? My time was significantly better. Eventually I was able get better control of the car at higher speeds. Still I needed to control how fast I drove, you can't go through a hair pin turn at full speed.
Why am I talking about video games?? Well we can learn a lot about software development from this same problem. If you are constantly pushing out as much code regardless of the quality, you will hit walls. You will need to stop what you are doing and rework code. The addition of new features will take longer because things are not stable or testable. Fixing defects requires hours of debugging sessions.
I realize no one wants to create a mess, it just happens. The faster you go the more technical debt you build up. Does your manager have sleepless nights about the debt you are building? I doubt it, this debt is usually very hidden. It only resurfaces in defects or the inability to make changes to existing code. I can assure you that you will spend more time fixing the mess then it took to create it.
One of my favorite techniques for delivering quality code is automated tests. Unit testing are the safety net that we need to prove what we are doing. If you are practicing TDD you are proving that your intentions are realized in code properly. Think back to before you had these tools. Has anyone wasted a day looking for a solution to a boolean expression of (variable = false). Yes it is an assignment not a boolean expression and it will always come back true. Unit testing is important.
So why FasterSlowerBetter? I think it says a lot about how I want to develop software. I want to be faster, but experience has taught me how to get my goal accomplished. Going slower and having better deliverables sets you up for a more productive future.
Subscribe to:
Posts (Atom)