Not My Money Any More: Lessons from Poker 4

Here is my first lesson from poker. I take that back. My first lesson from poker is when two strangers ask if they can join the game, lose a little all night, then offer to cut the cards for $100 as the game is breaking up, count the deck before and then after they turn up the ace.

Okay, so this was my second lesson from poker: as soon as it leaves my hand it’s not my money any more. The day after the game I was incredibly frustrated. I’d lost and lost all night long. I kept rebuying and losing, rebuying and losing. All I could think about was when was the next game so I could win my money back.

Over the course of the next week I became obsessed by that thought: I was going to win my money back. At the same time, a part of me was standing off to one side say, “Excuse me, hello, this doesn’t make any sense.” At some point I figured out how to articulate what was wrong with my thinking–it wasn’t my money. It wasn’t my money as soon as someone else won the hand. In fact, it wasn’t my money as soon as I put my bet in. I gave my money to the game, the game gave the money to the winner, and that was that. I couldn’t win my money back because it wasn’t my money.

Peace. Sometimes obsession works like that. You figure out what’s wrong with your thinking and the cycle just stops. This was one of those times. It wasn’t my money. I couldn’t get it back, because it wasn’t mine. The next time I played, I was just playing. I started with $20 and went from there.

Many of you will have recognized the Sunk Cost Fallacy. Money already bet is gone, sunk. It makes no sense to factor it into your decision making. I knew about the Sunk Cost Fallacy, but I wasn’t spotting it in my own thinking.

The same situation comes up all the time in programming. You have a long refactoring session, every step of which is perfectly safe. Then you run the tests. A test breaks. What should you do? What should you do if the error isn’t obvious? What should you do if the error isn’t obvious and you have been refactoring for a minute? An hour? A day? Does the amount of time invested have anything to do with how you proceed?

My experience is that the right thing to do in a situation where I don’t know what I did to break the tests is immediately return to my last known green state and re-run the tests. Then I begin refactoring again and run the dang tests every step. But, and here’s the irrational part, the longer I’ve been refactoring, the more tempted I am to press on. That’s the Sunk Cost Fallacy at work.

The longer I’ve been refactoring, the less well I remember all the steps, the harder it will be to spot the error, the greater the value of just starting over. The harder it is to start over (emotionally), the more valuable it is to start over.

It’s not my time any more. Have I been refactoring for a minute? An hour? A day? Doesn’t matter. It’s not my time any more. I’ve given it to the program. It’s gone. What I should do now should not be influenced by the magnitude of time I already have invested. It’s not my time any more.

As I was writing this I occurred to me that I’ve been guilty of a variation on the Sunk Cost Fallacy with JUnit. If you’ve been reading this blog for any length of time, you’ve heard me whining about not having found a business model to turn the success of JUnit into revenue. The faulty reasoning goes like this: JUnit has created all of this value in the world (billions of dollars by my envelope calculations) and I haven’t received any of it.

So what? If JUnit hadn’t created any value at all so far but was still in the same position, what should I do? Exactly the same as if it had created a million dollars of value or a billion. It’s the Sunk Benefit Fallacy. What’s past is done. It’s not my benefit. All that matters is the current situation. Any energy or thought I expend on the past will only muddle my thinking.

So here’s my resolution. I will think about the current state of developer testing, figure out the trends, and get ahead of the curve. That’s how I will make a living from JUnit. Oh, and I’ll be sure to count the deck, or better yet, not gamble with strangers.

11 Comments

Niklas BjørnerstedtJanuary 14th, 2010 at 11:43 pm

You forget one thing towards the end. There is a substantial value in Junit that is not sunk. All the people using it give you a brand value that might be possible to capitalize. Looking for a way to do this is not the same as chasing a sunk cost.

Thomas M AnderssonJanuary 15th, 2010 at 6:03 am

Hopefully this does not come out as rude.
Be honest to yourself here Kent, it seems like you’re still stuck in that same fallacy.
Somehow you seem a bit obsessed with getting monetary value out of JUnit. Do you really need to make a living directly from JUnit?
Isn’t JUnit part of what made you famous and that has provided you with plenty of value. Continued investment in JUnit will keep JUnit from dying and continue to provide this indrect value.

I Have A Link (6) « Comments After The EOFJanuary 15th, 2010 at 6:54 am

[...] JUnit Max – Kent Beck: Not My Money Any More: Lessons from Poker 4 [...]

KentJanuary 15th, 2010 at 7:28 am

Thomas,

It doesn’t seem rude at all. It’s a very reasonable question. My thinking is that because JUnit is such a big success, if I can find a way to monetize it I will get more money with less effort and (most importantly) less risk than if I try something else. I do have other activities like Responsive Design so I’m not completely dependent on finding a way to turn JUnit into a business.

If this were poker, JUnit would be my drawing hand–high potential, high risk.

Bryan JacobsonJanuary 16th, 2010 at 12:51 pm

Your post is insightful and right on the money. A good life lesson is in there too. Thank you from a fan of Poker, Agile and Refactoring.

Sebastian KübeckJanuary 21st, 2010 at 2:36 am

Kent,

seems that you are still stuck with the problem “how do I make money with JUnit”.
Maybe it’s time to redefine the problem?
In other words, try to find a solution for X in the following statement:

Waterfall to XP is like monetizing JUnit to X.

Mike RolfJanuary 23rd, 2010 at 2:55 pm

Kent, what you’ve created in JUnit is part of why you’re considered one of the great programmers. There are some things more important than wad’s of cash…

Mike

Chris SmithJanuary 28th, 2010 at 12:23 pm

Kent,

Please help me (and yourself) by doing something to improve Rails testing. I was a great practitioner of TDD for years while working in Java, but in Rails the feedback loop is just so tight, with the app and especially with the console, and the integration of the domain model with the database is so sticky, it’s much harder to feel any short-term value. There must be a lot of scope for improvement.

James BrechtelMarch 13th, 2010 at 10:21 am

Funny thing about poker is that the sunk cost fallacy (as it normally applies to a single hand) doesn’t apply quite the same when you can’t rebuy (you’re in a tournament or you’ve simply got no money behind) and what you’d be left with if you quit isn’t enough to do anything reasonable with.

I suppose the analog in most other situations would be time.

Dave RooneyMarch 23rd, 2010 at 2:40 pm

Kent,

St. Augustine said (paraphrased), “If you want to be immortal, live a life worth remembering.”

Perhaps you aren’t supposed to make *any* money off of JUnit. You (and Erich) will forever be remembered for it, though, and that you started a revolution that is changing software development for the better.

Liam McLennanMarch 24th, 2010 at 1:30 pm

RE: figuring out trends and getting ahead of the curve

How about something for auto running tests in Java and .NET like http://groups.google.com.au/group/ozaltdotnet/browse_thread/thread/d0cd4a7f9a0ebd63 ?

Leave a comment

Your comment