Archive for October, 2010

No Significant Threat After All, and an Argument

Turns out there isn’t a threat to the program after all.  Mark and Louis are in no real danger of being flopped by the parole board as a result of anything the force working against them can do to them.  It’s even fallen into doubt as to whether that force is actually working against them, or simply wounding their egos.  They have decided to stay rather than leave.  And if Mark and Louis aren’t threatened, the program isn’t either.

Tonight we started off with an interesting argument and finished with a list of definitions.

The argument was about testing only through the front door: that is, working under the self-assumed constraint that your tests must only ever call public methods of the class under test.  We examined both the pro position and the con positions:

Pro: No package-private production methods.  Tests call only public methods.  All non-public methods are private.  Class is a black box from the tests’ perspective.

Con: Maybe a few private methods, but mostly either public or package-private.  Tests have near-total access to the class under test.  Class is a white box from the tests’ perspective.

Arguments for the pro side were:

1. Tests may be more understandable because there’s less mocking involved and the class is being called through its public interface.

2. Changes to the implementation (but not interface) of a class don’t require test changes; also, since they don’t require test changes, the original intent of the class is clear and preserved.

Arguments for the con side were:

1. Tests for indivdual “private” methods are much shorter because they must contain significantly less setup code.

2. There will probably be fewer tests, because to test every code path through the front door means that if the code makes n independent binary decisions, you have to have at least 2^n tests to cover each possible path, while if you’re allowed to test private methods you can do it in 2n tests.

3. Spending extra time writing more numerous and more complex tests so that you can change the implementation more easily in the future qualifies as goldplating, because chances are best that you won’t need to change the implementation in the future.

4. If you do need to change the implementation in the future, you can write characterization tests then, before you change any code.

With some abstentions, the count at the end of the argument was Pros 4, Cons 3.5.

(Yes, yes, there were more than 3.5 cons there because it was a  blinkin’ prison. I get it.  Ha ha.  Shut up.)

I’m going to see if I can get that argument started on Pillar’s Socialcast site.

The list of definitions was of types of tests.  We listed integration tests, unit tests, system tests, functional tests, smoke tests, and various other forms, and discussed what each term meant.  Sometimes the meanings were different for different folks.

Great discussion.  Hope to do it again next week.

Soon, though, the Lifeline lab should be back open, and we’ll be able to actually sit at machines and code again.

Advertisements

Word of a Threat to the Program

Joel and I went in for our regular Tuesday-night session tonight (Rob can’t come back in until he goes through his security-training session day after tomorrow) and had a reasonably productive time with the guys, even though we couldn’t actually demonstrate any code because the available CO didn’t have a key to the place where they kept the projector.

But after the other guys in the class left, two of the three top students in the class stayed to talk to us in private.  These are the guys who are the driving force behind Sprint Zero of the Project.

They let us know that they’re trying to find a graceful way to quit–not just JavaGuys, but the entire Lifeline program that involves all sorts of computer-related training.

Why?

Because in prison, apparently, if you see somebody successfully bettering himself, especially if it takes effort or talent or skill you can’t or don’t want to apply, you resolve that situation by shooting him down.

These two guys are coming under increasing pressure because of their spectacular success in the program, and they’re afraid that if they continue, an incident of some sort will occur, they’ll be written up and sent to the Hole, and that in a few years when they come up next for parole, the Parole Board will see that ticket and flop them for four or five more years.

I love these two guys, and have been consistently amazed by their energy and inventiveness in overcoming the many obstacles that have stood in their way.  It would be a real shame to lose them; but if it were just them, I’d be forced to accept whatever decision they made.  Treating them as adults means that it’s not my job to fight their battles for them.

But this isn’t just about them.  If the forces that intimidate them succeed in making them leave the Project, a precedent will have been set.  When the next couple of pairs make it to the Project, the same forces will intimidate them as well–possibly also into leaving.

The whole point of the program–well, one of the whole points, anyway–is to give them professional-level experience on a Project that they can put on their resume.  If nobody can make it to the Project because he’s afraid he’ll get screwed, that severely cripples the program.

And it is my job to fight for the program.

So I gotta figure out what I’m gonna do.

Why Java?

Java’s a dying language, right?  Why not teach something more modern?  Even if you keep the JVM, there’s JRuby, Groovy, Scala, Clojure, and many others.  Outside the JVM, there’s C#, Ruby, Erlang, Haskell, all sorts of programming languages that A) are better than Java, and B) would teach the principles of programming in a much purer form.  Why not one of them?

First, if you’re talking about “principles of programming in a much purer form,” then get C# the heck off that list.  There is nothing at all pure about C#, especially in version 3.0 and later.  Scala either, for that matter.

But yes, Java is certainly the new COBOL.  Along every dimension by which programming languages can be measured, there are now other languages that soundly beat Java…except one.

I can say with confidence that Java’s going to be around, and Java jobs available, for another twenty years.  I can’t say that about any of those other languages.  When the JavaGuys are released from prison, they will (assuming they’re good enough) be able to get jobs writing code in Java.  If they then want to improve themselves by learning another, more lucrative language in their spare time, they can do that.

But if I teach them a really cool programming language that employers aren’t going to need when they get out of prison, then I’m no better than the college professors who are crippling their students by teaching them mainly C and C++, with historical perspectives on FORTRAN, Ada, and Lisp.  (All I can think is that C++ was the latest thing back when those professors got tenure, and now that nobody can fire them, they see no reason to take the trouble to learn even Java, much less anything “exotic.”  Cynical?  Perhaps; but then I’m a consultant who has to constantly work to keep myself marketable, lest I roll off an assignment and find nothing else waiting for me.  Tenure is a trap, sez I.)

Here’s the mission statement we came up with for the JavaGuys, in increasing order of importance:

3. Treat them like adults, not like children.  I assume they know better than anyone else what life decisions are best for them.  I give them advice where appropriate, but there’s never any “you must” or “you must not.”  (There is, of course, a waiting list of people to get into JavaGuys, and every seat in the class is vulnerable to somebody on that list who might fill it more productively than its current occupant.)

2. Set the course’s trajectory on a path that makes outside support as unimportant as possible.  I’m a consultant; my schedule is not dependable.  At any time I could be jerked away from them.  If I have to leave, I want the JavaGuys to endure under their own power–perhaps with guidance a little less accurate than before, but with undiminished horsepower or enthusiasm.

1. Teach only things that will definitely help in getting a job upon release.  Practice over theory–as a matter of fact, practice instead of theory except when theory is absolutely necessary to make practice understandable.  These guys probably won’t learn big-O notation, but they’ll understand that an algorithm is slower the more nested loops it has.  They won’t learn to write a mergesort, but they’ll learn how to write a Comparator-based anonymous inner class to do custom sorting with Java’s Collections.sort () method.

So…that’s why Java.

First MCI Code Retreat

The Pillar client where I was working had occasion to hire a number of developers.  Since we were particularly interested in smart Agile developers, we decided to hold a Code Retreat at the client site, and then troll through the participants we attracted to see if we could find any worth hiring.

The problem was that even though we advertised it far and wide, nobody but Pillar developers signed up for the Code Retreat–not even client developers.  Therefore, the decision was made to cancel the Retreat.

I told the JavaGuys about this the next time I went to see them, and one of them, Louis, said, “Well, do you think we could have a Code Retreat here in prison?”

It was an interesting idea: a day given over to pairing, preferably with the more experienced prisoners pairing with the less experienced prisoners.

I said sure, no problem: I thought that was a great idea.

“Can you come in to be with us during the Code Retreat?” Louis asked.  “We can’t be in the computer room without somebody from the outside to supervise us.”

“Only on the condition that I get to play too,” I said.  “If I can be part of the Code Retreat, then I’d love to be here with you guys all day.”

“And how many guests will you be bringing with you?” Louis asked innocently.

Guests?  Never occurred to me to bring guests.  But I was instantly captivated by the idea, because earlier I had had to deal with word that, as part of an argument between two of them, one of the JavaGuys had called me their “sensei.”  Allegorically, of course.  That frightened me.  I’m not a particularly accomplished software developer; I’m just a guy.  The thing that makes me a little different from the norm is not that I’m brilliant, but that I have no fear of prison or prisoners.  I didn’t want these fellows slavishly following my ideas simply because they were mine.  I had for some time been trying to get another developer to come in some Tuesday night and speak to them for purposes of cross-pollination anyway.

So I told Louis I’d see how many guests I could attract.

Two or three, maybe, I thought.

Boy, was I surprised.  Nine developers–all from Pillar–decided to participate in the Code Retreat.  A carload of them even came down from southeastern Michigan to participate.

From central Ohio, we had Rob Conaway, Tracy Harms, Ronak Patel, Nilanjan Raychaudhuri, and me.  From Michigan, we had Sean McMillan, Matt LaForest, Zachary Spencer, and Kevin Baribeau.  The Michigan guys apparently stayed at Matt Van Vleet’s house overnight so as not to incur hotel bills.

And guess how many JavaGuys we had in the class during the first Code Retreat?

That’s right: nine.  Almost enough to make a fellow believe in God.

Everything went amazingly well. Even the correctional officers seemed to be happy to have us.  The prisoners learned all sorts of stuff from the three professional developers each of them was paired with, and a couple of the outside folks were brand-new Pillar developers who weren’t really comfortable with pairing yet, so the prisoners were able to give them some experience with and instruction in that.

We decided that we definitely wanted to do this again.

 

Group Photo from the First Code Retreat

Group Photo from the First Code Retreat

 

Vendetta

One of the things I do as part of my job for Pillar Technology is interview prospective new developers.

In the spring and summer of 2009, I was getting more and more frustrated with the interviews I was doing–especially the ones involving young folks fresh out of college.  I was noticing that they had spent four years learning something, but they didn’t know anything we needed them to know.

For example: one promising young man I interviewed probably could have told me the difference between NP-hard and NP-complete right off the top of his head, and maybe made a good stab at writing a shellsort; but he couldn’t write a unit test to save his life.  He was trying to write a test for a method that was–under the conditions in effect at the time–supposed to return 2.  He started like this:

obj.methodThatShouldReturnTwo ();
assertEquals (2,

Note that he had forgotten to save the result of the call to .methodThatShouldReturnTwo () in a variable.

So he stared at the code for a good five minutes, trying to figure out what to put after the comma in the second line. Suddenly he brightened and completed the test:

obj.methodThatShouldReturnTwo ();
assertEquals (2, null);

“Are you sure?” I asked him.

“Yes, yes,” he declared confidently, “that’s a failing test.”  He ran JUnit to prove it to me.

“True enough,” I agreed.  “Now make it pass.”

Unfortunately, I had to draw the interview to a close before he was able to write enough production code to make assertEquals (2, null) pass.

But these were the kinds of kids I was getting for interviews straight out of college, and it was making me angry.  Obviously, the colleges were not teaching the right things to help their students get jobs when they graduated.

Both my wife and my father are college professors, so I’m at least peripherally involved in the academic community.  I decided to try to do something about this travesty.

At the time I was commuting to an Agile project in Michigan.  So I called up a succession of computer science professors (total of three, if I remember correctly) and made each of them the following proposal:

I know the university gives you travel money each year.  So: why don’t you reserve a room at the Marriott Courtyard in Farmington Hills, MI for a week.  I’ll drive you up there Sunday afternoon, and all week you can sit in the team room and see how a real live Agile project works, and what the people who work there need to know.  You can participate in the meetings, talk with anybody you want, pair with the developers, go to lunch with us and talk shop–whatever you want.  You’ll see the whole cadence of an entire Agile iteration.  Then on Thursday afternoon I’ll drive you back home.  (And you’ll have the opportunity to teach your students what they need to know rather than what they don’t.  I didn’t say that part, I just thought it.)  So what do you think?

Without exception, all three of the professors turned me down.  They weren’t interested.  They had better things to do.  One of them even told me, in rather a snide tone of voice, “We don’t train software developers. We train computer scientists!”

Well, you might say that got my dander up.

At that time, I had already been volunteering in various prisons–including MCI–doing other things for fifteen or twenty years, and I knew there were a few guys at MCI who were trying to learn programming, mostly as just something to do to pass the time.  So I got hold of Jo Dee Davis of WinWin and asked her if there weren’t some way I could get a class started there.

I had visions of calling that snide professor back in the space of two years or so and telling him, “You pick your favorite pair of seniors, and I’ll pick my favorite pair of felons, and we’ll put them to work on a real-world programming task and see who comes out ahead.”  Probably won’t ever happen, but it was enough to sustain my interest.

So Jo Dee set me up with four guys, and we got JavaGuys started.

Since then I was moved from the commuter project to one right here in central Ohio with a health-care services company.  In the summer of 2010 I made the same offer (without the travel) to another computer-science professor, and he actually took me up on my offer.  Well, sort of.  He said, “If it turns out I can’t do the entire week, at least I should be able to do a day.”

You can’t experience much about an Agile iteration cadence in a day, but I was excited anyway.  Since the client was a health-care company governed by HIPPA, though, there was a lot more involved with getting somebody from the outside in for a week than simply inviting him.  I got his paperwork started with the higher-ups, and it took a few weeks to come through.  The day it did, though, I was about to call him and tell him so when he called me.  He’d found something better to do that week than learn how to train mere software developers.

Seems to me that if you’re a professor of something like mathematics, where it’s perhaps true that no significant discoveries or advances have been made since Rufus Bowen’s work on axiom A systems in 1978, it might make sense to just teach the same thing over and over from hire to retire and not worry about staying up in your field.

But computer science isn’t mathematics, and discoveries and advances are being made every day. I think it’s inexcusable to still be teaching C++ as the main programming language in a computer science major, and deal with the advent of languages like Java, C#, and Ruby by sticking in half an hour on automated garbage collection in a programming-languages course.

So there’s my li’l ol’ personal vendetta.  Colleges turn out computer-science graduates who are essentially worthless to employers until after a significant training investment has been made in them, and does so over four years at a cost of $70-100,000.  I think smart, passionate guys can learn much more useful things in much less than four years for much less money than that.  So we’ll see.

After a year of JavaGuys, there are two prisoners in the class who, if they were released tomorrow, would make (I think) excellent junior developers for Pillar, and one who would slot easily right into Pillar’s apprenticeship program.  Of course, I have to wait until they’re actually released to find out whether I’m just blowing smoke–and I don’t know when that will be–but I have my suspicions.

But–but there are CRIMINALS in prison!

It’s true enough.  Some of the JavaGuys may well be murderers or rapists or even child molesters.  I could look them up on the Ohio Department of Rehabilitation and Correction’s website and find out, but I choose not to.

This objection has been raised frequently.  Of course the people who raise it are entitled–and welcome!–to their own opinions, and I certainly don’t arrogate to myself the right to sit in judgment of them.  But here are a few points that drive me to the decisions I make.

There’s no need for me or anyone else connected with the JavaGuys to be in the least concerned for our safety around them.  The program is seen by the prisoners as a very good thing, and any attack on it–possibly even something as small as a wolf whistle at a female volunteer–could get the whole program ejected from the prison.  If that happened, life would immediately become very dangerous for the offending prisoner.  Everybody knows this.  As a matter of fact, there’s such a taboo against anything even remotely in that vein that in some cases the normal give-and-take of pairing can be hamstrung when a volunteer and a prisoner pair together because the prisoner strains to be pathologically accommodating.

The JavaGuys program doesn’t address crimes or victims or sentences or any other issues of “deserve.”  Once a prisoner is released from prison, events immediately begin conspiring against him to put him back in prison just as quickly as possible–even if he is determined to do the right thing.  (I had heard this, but had no idea how true it was until I began volunteering with ex-offenders.)  The program is intended not to minimize his crime, further injure his victim, or affect his sentence in any way, but simply to give him a better opportunity to find a decent job when he’s released.

Released prisoners who find that they can’t make it on the outside go back to prison–frequently for committing another crime against somebody.  I would rather see a released prisoner getting a job as a software developer than waiting in the shadows near an ATM as somebody–me?  my wife?  my daughter?–approaches rummaging for a card.

Smart, passionate developers who know what employers need them to know are getting thinner and thinner on the ground.  They are certainly not coming in large numbers out of our colleges and universities.  If it turns out that they’re available from prison…so be it.

And finally…anyone who can experience the passion and desperation of these guys to learn something that he can teach them, and then simply turn and walk away from them–whether because they’re prisoners or for any other reason–is just flat made of different stuff than I am.

Description

The JavaGuys program, as the class is known, is a collection of around a dozen prisoners at Marion Correctional Institution who are part of the WinWin Institute for Response-Able Re-Entry.  The object of the class is to produce professional-level Agile software developers, with resumes containing knowledge and experience that prospective employers will find directly profitable.

We have students who were professional developers before they came to prison; we have prisoners who barely knew how to turn on a computer before they joined the class; and the rest of the students are sprinkled in various places between the two extremes.

Prisoners who are interested in being part of JavaGuys join a waiting list and take a test that is intended to evaluate their potential as Agile software developers, even if they have no prior experience.  I’ll probably describe the test in an upcoming post.

The class itself is divided into three parts:

  • Beginners, sometimes called the “nothin’ from nothin’ ’bout nothin'” guys, who spend their time learning the elementary theory of programming, elementary Java syntax, and test-driven development all at once, frequently with the help of Jeff Langr‘s aging but excellent book Agile Java.
  • Java students, who work through a series of programming problems of increasing difficulty and realism, ending with a cluster of web-front-end problems based on Tapestry followed by a cluster of back-end problems using Spring, JDBC, and Hibernate.
  • Project programmers, who participate in a real-world Agile project creating a real-world website for use by real-world people in solving real-world problems.  (The website is for a volunteer organization, so nobody makes any money on it.)

Students in the last two groups spend much of their time helping students in the first two groups.  Most of the passion and horsepower for the class is supplied by the students; they are certainly much more serious and dedicated than any college students I’ve ever seen.

Still, it’s difficult to impossible for me, as one guy, spending two to two and a half hours a week in the prison, to adequately address all three groups.

In the beginning, the class met with me for two to three hours a week on Friday mornings, because I was on a commuter project that allowed me to work four tens.  Since then, I’ve been moved to a local project that insists on five eights, so I go in for two and a half hours or so on Tuesday nights.

Lately, a couple of colleagues–Rob Conaway of Pillar Technology and Joel Helbling of LeanDog Software–have been hooked by the Code Reviews (I’ll probably mention them in a future post) and have been coming in with me on Tuesday nights.

Huh.  Three groups of students in the class, and now three outside guys volunteering to come in and teach them.  Almost enough to make a fellow believe in God.