Hi. I'm Jon Jagger.
I help software teams improve their effectiveness.
I built cyber-dojo, the place teams practice programming.
I'm based in the UK.
I've worked in 22 countries.
If you don't like my work, I won't invoice you.
Hire me

Pages

In his book
Patterns of Software
Richard Gabriel devotes a whole chapter (Writing Broadside) to writing about writing. Writing software is an act of writing so to get better at writing software he suggests it is a good idea to get better at writing in general. I was reminded of the chapter when I listened to Kevlin Henney's Skillsmatter
podcast Rethinking unit testing in C++.

In his talk Kevlin discusses identifiers. Names. Names are funny things. When developers choose names they have a difficult task. They have to balance two forces that are very definitely competing against each other. On the one hand longer names give more room to express intention - to create intention revealing names. A declaration is a declaration of intent, an expression is an expression of intent, a statement is a statement of intent. But on the other hand the names of our classes, our functions and our objects also participate as sub expressions in larger and larger expressions. In the context of use the pull of brevity is very powerful.

Kevlin reminds us that some names are never intended to be used at all! They never participate in expressions that we write! Brevity should not be a concern for such names. In a language that supports reflection your test framework will call the test method for you. The only time you write the name of the test method is when you define it.

Developers typically have a lot less practice at writing names when they are freed from the shackles of brevity so it's not really surprising test method names often smell so bad. They smell bad because they are too concise! Loosen up! Give yourself some space. Instead of writing a test method called test_index think about the intention deep inside your head and try to express that as a whole sentence. That's a difficult practice to develop. If I'm pair programming and as the navigator I see the driver struggling with a test method name I sometimes ask them to "put the mouse down and step away from the keyboard". We discuss, face to face, what the intention is. Freed from the code-silo mentality of the keyboard we can usually move quite rapidly from test_index to test_indexing to test_out_of_range_indexing to test_out_of_range_indexing_throws_exception.

The last additional suffix ...throws_exception is an important one. A good test name should express an expectation. This is a transformational name change. It transforms the idea of testing so that it becomes not-testing. The name becomes a proposition. And the tests inches closer towards being an executable specification.

Another example of the context of test/proposition names having a different meta-context from regular code is naming style. Kevlin suggests that even in a language with a strong camelCase or PascalCase naming convention there is a strong argument for naming test methods with underscores_as_separators. You aren't calling these methods. They aren't participating in larger expressions. The only time they appear is in a diagnostic. Experiments have shown there is a small but definite cognitive delay in reading camelCase or PascalCase identifiers once they get beyond around 30 characters.

Bureaucrats are usually empowered to say no to even reasonable requests, but they cannot say yes to them. This requires passing requests to a higher authority. Saying no inflates bureaucrats' self-images.

While I was at Jerry Weinberg's Problem Solving Leadership workshop last week (which was truly fantastic) I showed a group of fellow attendees a very simple velocity/wip game I've invented. You simply create some cards and arrange them into columns. Each card has a number written on it which is it's estimate.
The photo shows the setup for our game; the left column (eg Analysis) contained the numbers 1,8,2; the middle column (eg Design) contained the numbers 1,1,5; the right column (eg Testing) contained the numbers 8,1,2. We put one person on each column; Darrin on analysis, Ted on Design, and Tim on Testing. Play proceeds as follows:

each player gets N (eg 3) dice which they each roll over and over again

if a player rolls a 1 they add one to their running tally (which starts at zero)

if their tally reaches a number on a card in their column they can move that card one column to the right and reduce their tally by that number

that's it! (you can also add wip limits to the columns if you like)

Paul was on the timer and gave us one minute. After the minute was up we added up the...

work-in-progress: the total of the cards still in the three columns

velocity: the total of the cards that got moved out of the rightmost column (into an extra rightmost column called Done)

The first minute

The wip was 25 and the velocity was 11. This makes a total of 36 which is greater than the total we started with. This is because there is also an extra left-most column called Backlog which contains more numbered cards. Darrin was on the left Analysis column and after moving all three of his cards into Ted's middle Design column he pulled some more work into his column from the Backlog. Despite this Ted was starved of work for part of the minute.

The second minute

We reset the board back to it's initial position and decided to try and increase the velocity by smoothing the work. We split the high cards into multiple smaller cards. For example, the 8 was split into 3,3,2. Then we did another minute's worth of work. This time the wip was 18 and the velocity was 18. Once again this makes a total of 36 and once again Darrin pulled in more work from the Backlog after emptying his Analysis column. Because the work was less lumpy Ted wasn't starved and the velocity went up.

The third minute

We reset the board back to it's initial position from the second minute. This time we decided to try and lower the work-in-progress left over at the end. After all, if the project got canceled that wip would be waste. To do this we agreed not to introduce any new work from the backlog, and also that anyone's dice could contribute to the tally on anyone's column. Then we did another minute's worth of work. This time the wip was 9 and the velocity was 20.

Summary

Simply by smoothing the work and working together we increased velocity by a factor of ~2 (11 to 20) and reduced the wip by a factor of ~3 (25 to 9). Simple!

is a great book by Dale Carnegie. As usual I'm going to quote from a few pages:

Any fool can criticise, condemn, and complain - and most fools do.

Action seems to follow feeling, but really action and feeling go together; and by regulating the action, which is under more direct control of the will, we can indirectly regulate the feeling, which is not. (quoting William James)

Good manners, said Emerson, are made up of petty sacrifices.

I made it a rule, said [Benjamin] Franklin, to forbear all direct contradiction of the sentiment of others, and all positive assertion of my own.

I judge people by their own principles, not by my own. (quoting Martin Luther King)

Any fool can try to defend his or her mistakes - and most fools do.

If there is any one secret of success, said Henry Ford, it lies in the ability to get the other person's point of view and see things from that person's angle as well as from your own.

At Jerry Weinberg's Problem Solving Leadership workshop one of the handouts contains this quote from Einstein which spoke to me:

I soon learned to scent out that which was able to lead to fundamentals and to turn aside everything else, from the multitude of things which clutter up the mind and divert it from the essential.

The hitch in this was, of course, the fact that one had to cram all this stuff into one's mind for the examinations, whether one liked it or not. This coercion had such a deterring effect upon me that, after I had passed the final examination, I found the consideration of any scientific problems distasteful to me for an entire year.

It is, in fact, nothing short of a miracle, that the modern methods of instruction have not yet entirely strangled the holy curiosity of inquiry; for this delicate little plant, aside from stimulation, stands mainly in need of freedom; without this it goes to wreck and ruin without fail. It is a very grave mistake to think that the enjoyment of seeing and searching can be promoted by means of coercion and a sense of duty. To the contrary, I believe that it would be possible to rob even a healthy beast of prey of its voraciousness, if it were possible, with the aid of a whip, to force the beast to devour continuously, even when not hungry.

I do I Ching some mornings. It's part of a deliberate effort to try and improve my subconscious! Today the dice chose 1,2,1,1 which means tetragram ten.

Inner Harmony
In managing your instincts and embracing Oneness,
Can you be undivided?
In focusing your Influence,
Can you yield as a newborn child?
In clearing your insight,
Can you become free of error?
In loving people and leading the organization,
Can you take no action?
In opening and closing the gateway to nature,
Can you not weaken?
In seeing clearly in all directions,
Can you be without knowledge?

Produce things, cultivate things;
Produce but do not possess.
Act without expectation.
Advance without dominating.
These are called the Subtle Powers.