Wednesday, May 26, 2010

OTUG Presentation Big Ball of Mud

OTUG's latest distinguished lecturer presentation was Joe Yoder and Brian Foote's Big Ball of Mud.

First, let me say that Foote and Yoder were the most entertaining speakers I've seen at an OTUG presentation. Their presentation style was to tag team the presentation. Each speaker would talk to a point or two and then the other would take over. Their approach really worked well. Foote and Yoder's energy levels seemed to stay at a higher level than it would have been with a single continuous speaker.

If there's one criticism that's resonated about the distinguished lecturer series recently it's that the presenters tend to be academics who do not speak to the same world that working software professionals live in. There's nothing wrong with speaking to the abstract, if not disconnected, world of academia. Sometimes I think that people come into these lectures with the expectation that they will receive a practical lecture that can be directly applied to their situations.

With that said, Yoder and Foote's presentation is clearly rooted in real world practical experience. If anything, Big Ball of Mud is the antithesis of the ivory tower lecture. It's all about the disconnect between what we say we are doing and what we are doing.

The premise of Big Ball of Mud is that software professionals aspire to produce software that is architecturally elegant, yet the product that we so often create is very different than those aspirations. As Yoder and Foote put it, "if [most] software were architecture, it would look like a shanty town." They liken software architecture to 'The Emperor's New Clothes' and that everyone is in denial that we are creating shanty towns.

Yoder and Foote call this ugly software mud. The dirty and chaotic messes of spaghetti. We all see mud in other people's code, and in that I've seen the monster and it is us way, we see it in our own code too. It's really a wonder that anything ever worked until we the noble craftsmen arrived, or is it.

They point out a few of the types of mud and the ways that it happens. Copy and paste, which they call metastasis. Big Bucket of Glue, or taking open source libraries from the wild and haphazardly gluing them into an ugly chimera of an application.

Yoder and Foote raised the question, "Why does stuff that sucks hang around so long?" It's easy to characterize the obvious negative traits of mud, but Yoder and Foote pointed out some of the things that aren't so obvious. The mud that we encounter works. If it didn't work, we'd ditch it. The mud that we see is sufficiently complex, otherwise we'd find the time to replace it with something beautiful.

Yoder and Foote showed examples of how a good enough solution now can be more valuable than a beautiful solution later. It kind of makes sense that for software to add value, it must be available.

Yoder and Foote addressed software craftsmanship. Brian Foote, talked about Amish furniture craftsmanship. He even wore an Amish hat for that portion of the presentation. If we think about Amish made furniture, it's beautiful and of excellent quality. We all would like furniture that is of that quality and is beautiful. We also buy stuff that's made of particle board from Ikea in droves. Sometimes the Ikea furniture is good enough.

The takeaway from the talk I got is that mud is the byproduct of a trade off from writing software in a way that costs less upfront. The mud is a technical debt that may, or may not, need to be paid down the road, but it is a debt that certainly does not get paid at the onset of its introduction. We can clean up mud through refactoring and replacing muddy software.

Foote and Yoder brought up a great point that automated tests will have your back when it comes time to clean up the mud.

We can strive to create mudless software, but it comes at a cost that becomes impractical. I'm reminded of a project that I was on. We set the goal to get our automated test code coverage at 85%, and we did. It was a worthwhile effort. Someone then thought we should strive to get the code coverage to 95% and we did at the cost of adding about 30% more time to our work. Was that 10% worth the effort? Is it worth 1/3 of a feature? In that case we let our idealism take precedence over the practical need to deliver something of value to our customers.

It seems that the image of the muddy boot architect may be an appropriate metaphor for software creators. Some mud is needed on the job site. We may have the opportunity to clean it up, but it isn't something that we need to avoid at the cost of delivering value.

As an observation, I don't think that the software that we are creating today, with the tools that we have available, is nearly as muddy as some of the code that was created in the past. We're getting better. As a community, I think that we are moving towards producing less muddy software. Just as I was thinking, nay fantasizing, about how we may reach a time where the mud we see is more like a fine layer of dust. Then Deion Steward had to bring up a question about concurrency and multicore development and I think that may be a whole other swamp.

EDIT: Please read Foote and Yoder's paper Big Ball of Mud.

Monday, April 19, 2010

What Do The Shape of Manhole Covers Have To Do With Software Development?

I talked to a friend of mine who not too long ago became a Microsoft Employee. I asked him if the mythology around their interview process is still in place.

The mythology of the Microsoft Interview is that Microsoft will fly candidates to Redmond and pass them through a strange gauntlet of technical questions and questions that are meant to see how one thinks. Candidates would meet with many interviewers. The interviewers would do interesting things like continue a line of questioning that another interviewer started. Interviewees have told me that the second interviewer would be privy to details of the content of the earlier interviews. I can imagine that it would be quite an experience.

The questions also carry some mythology. They would range from technical questions to puzzles to questions that are impossible to answer.

Technical questions seem very appropriate for a technical interview. It would seem that one would be remiss to not ask a few questions to see whether someone could communicate about technical issues.

I enjoy puzzles. I wouldn't mind being asked to solve some of them in an interview setting.

The impossible to answer questions have always disturbed me as an unkind thing to ask in an interview though. I used to work with a guy who liked to ask candidates those types of questions. For example, he would ask: how would you move Mt. Fuji or how many flowers will get delivered in New York City today? What makes this particularly unkind is the interviewer asks these questions as though they expect a specific answer.

This seems unkind to me for two reasons: one, what does this have to do with one's ability to do job in question and two, interviewees can be in a situation where they need a job whereas a hiring manager may be in a position where they would like to have another employee.

This type of questioning also reflects negatively on an interviewer for a couple of reasons in itself. Is the interviewer trying to say that they are accustomed to making unreasonable requests from his reports? Is the interviewer accustomed to using indirect methods of questioning to make unqualified psychological evaluations of people?

The Question:

Somewhere between the impossible to answer and the puzzle question is one that my friend was asked at Microsoft. The question in question is "Why are manholes round?".

Nobody has yet to ask me that question in an interview.

I really would love to be asked that question so much. I spent five summers working for the Downers Grove Sanitary District, a municpal sewage treatment plant, through high school and college. From time to time, we needed to work with manholes and manhole covers. I even worked on a street crew installing sewer mains complete with manholes.

This experience doesn't really qualify me to answer the question any better than say a civil engineer, but I feel familiar enough with the subject matter that I can speak comfortably on the subject.

Wait, there was a problem?

The answer that is comonly considered to be most correct by the people who ask this question in interviews is the reason is because a round cover will never fall into the hole. This is factually true.

I think that it's a nice side effect of having a round hole. There are some people who are adamant that this is the reason for the shape of the hole and cover being round.

If you strongly believe that this is the reason that manhole covers are round, and you believe that knowing a thing or two about the shape of manholes is content worthy of asking in an interview; I would love to be in the position of being asked that question by you. Not because I would like to work for your company, I just have a grotesque compulsion to argue.

I believe that a manhole cover is not round for this reason. I also believe that that believing that this property is the reason for a manhole being round says many unflattering things about a person.

Why I Believe That The Commonly Accepted Answer Is Incorrect

Let's look at the powers that are in play with the problems being solved.

Dropping a manhole cover into an open sewer would be a bummer, but it's hardly a major concern for the people who design sewer parts or, more importantly, the people who purchase those parts.

Consider the people who sell manhole covers. Would their primary concern be creating a cover that cannot fall into the hole that they cover? What's the absolute worst thing that can happen to the foundry that sells a manhole cover that happens to fall into the hole? Maybe they get to sell one more cover.

What's the worst that would happen to the people who purchase the manhole covers if one of the covers were to fall down the hole? The cover would either need to be retrieved or replaced. Retrieving a cover could be difficult and dangerous, but it wouldn't be the end of the world. Depending on how deep the hole is, it could be recovered by a couple of people within a few hours at most with maybe a winch if they need it. It may just take fifteen minutes.

A Google product search shows that a manhole cover costs somewhere in the neighborhood of $500.

It would not be catastrophic to a multi-million dollar municipal sewer budget to lose a manhole cover.

What About Other Shapes?

Has this ever been a problem? What shapes are even prone to this type of accident? It would be difficult, but possible to drop a square manhole cover through a slightly smaller square hole, it would be easier to pass a rectangular cover through a rectangular hole. A non-equilateral triangular cover could easily pass through a corresponding hole, but I think an equilateral triangle would have trouble passing through its hole. It is not a trivial task to perform on purpose, wouldn't it be a negligible concern for the design?

Now I Get A Little Righteous

There's an unspoken assumption in the question that sewer workers need idiotproof tools. Why else would one think that the primary design case for a manhole cover be such that it cannot possibly fall through the hole that it is meant to cover. Having worked side by side with sewer workers, I find this assumption to be insulting.

Entering a manhole is dangerous. Every year people die from suffocation. Entering a manhole is not an activity that is taken lightly. When I worked with them, a sewer worker would use a four gas sniffer to check to make certain that the air in the sewer is breathable. We really should have worn a harness that is attached to a winch for evacuation.

Not every uncovering involves entering the manhole, but there always is an element of real danger. No sewer worker takes going down lightly.

They're Like Nickels Though, Aren't They?

Manhole covers are heavy. They can weigh well over 100 pounds. Circular manhole covers can be difficult to open if you don't know how, or don't have a special tool.

The tool that we used is a hook. The hook makes manipulating a manhole fairly easy. There are also magnetic dollys that can be used, but we never had those.

Fun Personal Story About How I Almost Lost A Few Fingers

We usually didn't have the hook tool around, so I learned the hard and dangerous way how to replace a manhole cover. One problem with the circular design is one cannot place the cover onto the hole and slide it in place. It's heavy and the ledge around the edges is not wide enough to place a cover on the ledge and lower it down. I tried that and later learned that people have lost fingers doing that.

The safest way to replace a manhole cover is to drop it in the hole and stomp the high side of the cover until it falls into place.

If the cover were quadrilateral with 90 degree angles, it would be much easier to safely replace. You could just drop one edge of the cover into the hole parallel to it's resting position and slide it into place.

Now For The Reason That I Think That Manhole Covers Are Round

The reason that I believe manhole covers are round is because pipes are round. Pipes are round because the round cylindrical shape is the most efficient and strongest way to transport a liquid with the least amount of materials. Wouldn't cost and function make a much more compelling reason to design a manhole cover round?

Why would you base your design criteria for an unlikely and non-catastrophic event? It would be like designing cars in the US to be outstanding shark cages first, and machines that can move people from one place to another second. Sure, it would be very very nice to be safe from shark attack in the event that the car were to be driven into shark infested waters. It would be comforting to know that a shark won't kill you in that car, however the odds of your car ever needing to serve as a shark tank are likely to be more remote than winning the lottery while getting struck by lightning.

Ok, That's A Silly Question, But Why Make Such A Big Deal About It?

There's more to the issue though. Having the property of falling through a hole is certainly more likely just a side effect of the design. How is it that interviewers feel confident enough to assert that that property is the primary design criteria? Where did they come up with this question for software engineers?

I could see this being a very appropriate question for civil engineers and mechanical engineers who interview for a job in the sewer industry. If the position in question is designing manholes and manhole covers, yeah, that seems relevant.

Quick digression: I really should have been clearer at the beginning of this essay. If you're interviewing someone for a manhole cover designer position. You should ask this question. Sorry about that, I'll try to do better next time.

Back to interviewing software engineers. Do you want to hire someone who believes that manhole covers are round because a round cover won't fall into the hole? I wouldn't, I wouldn't want to work for someone who believes that either.

What does it say about a person who observes a correlation and assumes then firmly accepts a causal relationship? To me, it says that they have poor critical thinking skills and may be apt to assume causality between events that are not causally related. Do I want to trust my livelihood to the judgment of one who is incapable of sound critical thought?

Maybe the interviewer simply read the question somewhere or heard it from a friend. What does that say about the person? Is it that they so soundly accept information they hear or read as facts and that they are willing to use that information to judge whether a person who claims no expertise in that field is fit to hold the job in question? Is that a type of person for whom, or with whom I would want to work?

The intent of the Microsoft question is to gain insight in how someone thinks and how that person approaches problem solving. Does it? It's hard to say.

I really think it's more of a secret handshake. If you're one of the cool kids, you're probably already heard the question. I do have a somewhat sick desire to cross examine someone who gets caught passing the answer off as though they've figured it out themselves.

Time is precious. Spending time in an interview asking questions that may yield no good information about the person's ability to fill the position would seem to be a bad use of the time of all involved.

Instead, why not ask a software person about Sudoku.

Wednesday, February 17, 2010

Speaking: Integrated Test Driven Development

I will be presenting a use case for the Minnesota Scrum Experiences Group, a part of OTUG, on 2/23 at the University of St. Thomas. Murray Herrick room 155. Doors open at 6:00 PM.

My presentation will be a technical case study of using integration level tests to drive software development. My co-presenter, Ann Baumann Johnson, will give another perspective of the case study from the perspective of a project manager.

In our project we defined our technical requirements through executable JUnit tests at the application and integration level. We believe that by defining the requirements as such, the development team was able to deliver the exact program that was needed, even though the behavior of the program was never explicitly defined, we had no quality assurance team, and the consumers of the product were unable to test it until months later.

Although the circumstances surrounding this project were unique, the techniques we used are applicable to other software development projects.

My slides will be available on this site after the presentation.

Friday, January 8, 2010

Getting the itch to write again

I took a little respite from posting to form my opinions on some issues in the software development/flaming liberal socialist Marxist space.

I feel that these ideas are getting ready to share and I will begin posting them again in the coming weeks.

Wednesday, January 6, 2010

Three different stores, two different experiences

We're upgrading the home media center. At the heart of the project will be a Mac Mini that will operate an LCD television. Up until today we hadn't purchased either of these products.

It's been slow at the office, so I took the afternoon off and decided to pick up the Mini and look for and possibly buy the TV.

For the TV, we were looking for a few things: 52 inch picture, 120hz refresh, good picture and a good price.

My first stop was at Best Buy Roseville, MN. I went to the television section and looked at their displayed TVs. There were a few that I considered purchasing, but there wasn't anything that jumped out at me. I was kind of surprised that nobody offered to assist me, but I looked at what they had and there wasn't anything that could compete with the products I found online. I think at one point an employee asked me if I was OK, but he only asked me if I'm OK. I really couldn't tell if they were busy or just elsewhere.

I then went to Ultimate Electronics next door. They had a better selection. I actually found a TV that looked really nice at a decent price. I looked it up on and it had great reviews. I also found that I could get it for $100 less than what Ultimate Electronics was offering. I thought I might see if a sales person could compete, but here's the thing nobody offered to help me. There were about five guys BSing around the counter. Instead of bothering them I just ordered the same model from my phone from within the store. I thought it was kind of funny that I was shopping at Amazon from within a brick and mortar.

Had they decided to burn a couple of calories and offer to help me they might have made a few bucks off my business.

I then went across the street into Rosedale Mall. I went to the Apple store and was immediately greeted. I told the guy who greeted what I was interested in and he got a friendly lady to help me. She introduced herself and asked what I was planning to do. I told her I was planning on creating a media center for our living room. She was interested and thought it sounded really cool.

She showed me the display Mini. She explained how it would hook up to the TV. We then figured out the stuff that I'd need to get. She then went into the back room to get the stuff. While I was waiting, I was asked if I could be helped by three people. They were all friendly and nice. I thought that was really cool and enjoyable.

The lady even found that one of the accessories that I needed was on sale from Apple's web site for less and suggested that I order it from there instead. That was really considerate.

At Best Buy and Ultimate, they acted more as facilitators of visual aides for my TV purchase. They never even really tried to sell me anything or help me. I don't think I'm a demanding customer. I'm not going to buy a bunch of Monster cables, but they could make a few bucks on a purchase.

I know that online retailers are eating some brick and mortar retailer's lunch, but I think a lot of it has to do with the experience. I'm not going to work hard to give them my business. If they want it, it's there. They've got to offer me something more than what I can get from an online retailer to get it.

EDIT: here's the TV I picked up.