Ted’s Rants and Raves by Ted M. Young

November 2, 2009

PragProWriMo: Day 1

Filed under: General Rant

If you’ve followed my tweets, you already know that I’m participating in the November PragProWriMo, or the Pragmatic Programmers Writing Month. It’s not a contest or anything, but it is an opportunity to start writing what might become a book, or just a series of blog posts.

Note that these are not really blog posts, or even self-contained tidbits, but just what I’ve happened to write on that day. So, while you can feel free to comment, I’ll not really be paying attention to the comments and certainly expect things to not be well-written, let alone make sense without additional context. This is simply a way to allow people to see my writings as soon as they’re written and nag me if I miss a day of writing.

Day 1

Fluent Testing

ATDD, or Acceptance Test-Driven Development is one of the more recent techniques in developing software. The idea is to use code-based acceptance tests instead of English-based specifications or requirements. While it seems that English accetpance tests would be easier to write, in fact, they are more difficult to write well. It’s quite hard to be precise in a natural language where words are often ambiguous. For example, in this English-based acceptance "test"

* Filter searches on the Account number and the Policy number

The context here is a text field for a "filter" that limits the records that are shown. This simple statement can be interpreted in different ways. Before reading my interpretations, think about how many ways you could interpret it.

1. Text entered in the filter text field is used to search in the account number field, the policy number field or both.
2. The text is searched for in both the account number and policy number fields and must be found in both in order for the record to appear.
3. The filter text is used to search in the account number field, and if no records are found, then search in the policy number field.

You might be thinking that this is obvious and should have been stated more precisely when this requirement was discussed. However, it’s very difficult to always express the intent of requirements with enough precision on a consistent basis without missing something, or contradicting some other requirement. Even if you do end up with sufficient precision, you’ll likely end up with a 300 page requirements document that, I guarantee you, will end up being interpreted differently than from how it was intended. Since the whole point of agile development using story cards is to discuss these details (as in a "token for conversation") on an as-needed basis, how do you make sure that the developers don’t forget the details as they’re developing the code? The answer is executable acceptance tests.
The problem I’ve seen in coming up with a good form for executable acceptance tests (no, I won’t call them EATs) is that in trying to formalize the English, you end up with something that is close enough to English that people understand the intent, but not quite enough like English so that people find it hard to write. The solution here is a fluent testing API. Something that is not only precise, but can be executed against production code once the code has been written and, going with the ATDD technique, use by developers _while_ they’re writing the code. For example (using JUnit in Java):

  public void sortByInvoiceDatesIsVisibleOnlyWhenGroupingByInvoiceAndByItem() {
    openCreateDirectBillPaymentPage(account)
      .groupByInvoice()
      .aggregateByItem()
      .assertSortByInvoiceDatesIsVisible("Sorting by invoice should be visible for Group By Invoice Aggregate By Item");
  }

 

It’s true, this test only checks that the "Sort By" selection element is visible, depending on various combinations of other selections ("Group By" and "Aggregation"), but it’s also very explicit under what conditions it should be visible and, most importantly, is not that much less readable than if it were written in English. It’s hopefully clear that after opening the "Create Direct Bill Payment Page", we "group by invoice", then "aggregate by [invoice] item", and finally, the check (assert) that the "Sort By" element is indeed visible. The string passed to the assert is the failure message, and helps describe _why_ the assertion should be true.
There’s an additional feature that puts this over the top, and that’s an IDE’s ability to provide a list of choices of methods that are available on each object, aka, code completion. This allows the executable acceptance test author to be guided by the code completion of methods that are available at each point. This turns out to make test writing much easier than if it were an /external DSL/, because the choices are constrained by the objects that you’re working with, i.e., on the DirectBillPaymentPage, the IDE will "tell you" that you can do "groupByInvoice" and "aggregateByItem" by showing those methods as auto-complete options.

 

February 1, 2009

Book Review: “The Art of Lean Software Development”, 1st Edition

Filed under: General Rant, Books

The Art of Lean Software Development, 1st Edition
by Curt Hibbs; Steve Jewett; Mike Sullivan

From O’Reilly Media, Inc.
Published February 2, 2009
ISBN-13: 978-0-596-51731-1
Pages: 144

 
 
I’ve already read James Shore and Shane Warden’s "The Art of Agile Development", and whether you liked it or not (I thought it was good enough to purchase half-a-dozen copies for people in my company), I don’t think you can argue that it’s not comprehensive. "The Art of Agile Development" is definitely from the "here’s what we did in the real world with real businesses" school of books.
 
With that book as a reference point, "The Art of Lean Software Development" sounded very appealing and I had high expectations of learning about using Lean ideas in real-world software development. The books is on the short side, only 144 pages, though this can be a good thing since then there shouldn’t be any filler material (unlike the sell-by-the-pound books). Alas, I was sorely disappointed.
 
The book starts out with the seemingly standard "here’s why software projects fail, here’s how waterfall doesn’t work, and here’s the Agile Manifesto and the typical Agile processes." Maybe I’m jaded, but it’s a somewhat old story by now, no? A bright spot is that they point out how Winston Royce’s paper on Waterfall was misunderstood, misinterpreted, or never really read (since Royce actually rails against the down-flowing waterfall process).
 
Next, the book summarizes the Lean Principles: Value, Value Stream, Flow, Pull, and Perfection. And I do mean summarize: the authors spend about a sentence or two per principle. I would’ve liked some more background here, especially the more about "Value" and the "Value Stream", but they promise the next chapter will apply these to software development.
 
Chapter 2 starts by referencing the Poppendiecks’ books on Lean and Software Development ("Lean Software Development" from 2003 and "Implementing Lean Software Development" from 2006) and summarizes their seven principles, diving deepest into the "Eliminate Waste" principle by mapping the manufacturing lean terms to software development terms, e.g., Overproduction -> Extra Features and Transportation -> Handoffs. The authors then go on for only a few more pages on relating the other principles to the process of software development. The chapter ends with a short comparison of Lean vs. Agile, which the authors feel is mainly due to "the mindset" of Lean, i.e., "the elimination of waste in the context of what the customer values."
 
With the introductory material out of the way, I expected to find out more about how to apply the Lean mindset to software development and was eager to learn some new tools. Here’s where I felt really let down. The next six chapters talk about the Lean Practices (starting at the Zeroth), but honestly, there is nothing new about these practices. The Zeroth Practice is "Source Code Management and Scripted Builds". Does anyone doing commercial software development not use source code management? And scripted builds are nothing new. Practice 1 is "Automated Testing". I don’t think there’s any question that this is a must — mainly the arguments are around do I write the tests first or have I gotten 90% code-coverage, etc. Practice 2 discusses "Continuous Integration", but again, this is nothing new and certainly isn’t exclusively a Lean Practice. Practice 3 is "Less Code", i.e., write less code and you’ll have fewer bugs and the system will be easier to maintain. Yup. I totally agree, been doing things that way for decades.
 
Practice 4 is "Short Iterations", which goes back much further than the "translation" of Lean Manufacturing ideas to Software Development. And here I take issue with the recommendation for iteration length: "the best starting point is in the middle of that range—four weeks": my experience is that shorter iterations, such as two weeks, are much better for teams that are starting in Agile because of the shorter feedback loops and more opportunities for inspecting and adapting the process to the needs of the project and the team. The last is Practice 5: "Customer Participation", which is eXtreme Programming’s On-Site Customer. Nothing new here.
 
At this point, the book hits Chapter 9: "What’s Next", which already sounds like the conclusion and I haven’t learned anything new! It does go on for a little bit about Kaizen and Value Stream Maps, but this should be the meat of the book: show me how it’s been applied to projects. Show me the elements that don’t translate to software development. Show me a real-world Kanban board and not just a pretty Visio picture of some columns with rectangles. How does the Kanban really work? How do I deal with wide variation in the tasks? How do I know when and where to put the buffer queues? This section ends with "Make It Visible". Um, Burn-Down Charts? I’ve been using those for years in Agile. And why do I only get a couple of pages on "Root Cause Analysis (Five Whys)"?
 
Chapter 9 ends with some references to "complementary approaches", and I’m very surprised when the authors state "There is currently a little bit of industry talk about applying ToC and CC to software development, but there are no serious efforts that we are aware of to actually do so." Have they even read David Anderson’s 2003 book "Agile Management for Software Engineering: Applying the Theory of Constraints for Business Results"? It’s actually listed in the "Resources" section — unless the authors don’t consider that book (and the kanbandev and Real Options Yahoo Groups email lists) as a "serious effort".
 
All in all, a most disappointing book and definitely not recommended: it doesn’t provide any real-world project information; the authors don’t seem to have participated in any of the mail lists that discuss Lean and Software Development (a quick Google search doesn’t find anything they’ve written in this area); and ultimately it fails to truly show the difference between the various flavors of Agile and how it’s different from "the mindset" of Lean.
 
I suggest reading the books by the Poppendiecks, the Agile Management book by Anderson, the Scrumban book by Corey Ladas and skipping this one.

November 12, 2008

Easing Into Agile - Slides from Silicon Valley Code Camp 2008

Filed under: General Rant

The presentation "slides" are here: http://www.tedmyoung.com/EasingIntoAgile.pdf.

Note that the content is licensed under the Creative Commons Attribution-Noncommercial-Share Alike 3.0 United States License.

Question, comments, criticism, etc., are always welcome.

November 10, 2008

Two IDEA 8.0 Features Worth the Price to Upgrade

Filed under: General Rant

I don’t know about you, but I’ve got code in my code base that still uses arrays and we need to move them to Lists. Sounds like fun, huh? Well, a new refactoring in IDEA 8.0, Type Migration, is going to help a lot in this task. The other feature that blew me away during the EAP was the Data Flow To This… command, which lets you see how the variable you’re looking at got its value all the way back through the method chains. This is really useful when you’re trying to figure out, say, why the value is null and where it got set that way.

Examples and screenshots on these coming soon. 

IntelliJ IDEA 8.0 Released!

Filed under: General Rant

Yeah, IDEA 8.0 has been out almost a week, but I’ve been so busy with the Code Camp preparations, I didn’t have time to focus on it.

I’ve been using 8.0 since the first Early Access builds, and it’s been a very solid product all the way through. There were some regressions in the way things were "painted" (causing background colors to not work properly in some cases) that I’m betting has to do with the fact that IDEA 8.0 ships with the 1.6u10 release of the Sun Java VM. Those bugs are fixed and I’m happily using 8.0 on its 30-day trial until I get my 7.0 license upgraded. I’m bummed that I didn’t win the JetBrains raffle at the Code Camp, but oh well.

I’ll be posting thoughts and information about the new 8.0 features over the next few weeks. 

November 8, 2008

SILICON VALLEY CODE CAMP 2008

Filed under: General Rant

If you attended (or missed) either of my Silicon Valley Code Camp talks, I’d be happy to do them again as 5 minute lightning talks. :-)

Saturday’s sessions are over, but there’s still Sunday! See http://www.siliconvalley-codecamp.com/Sessions.aspx

March 1, 2008

Why I’m Not Using Adobe Flex (yet?)

I was just reading Per Olesen’s blog entry about Adobe Flex and the fact that it’s closed source and proprietary, and it hit me that the reason I haven’t tried Flex is because the source isn’t available. I remember years ago at eBay when we were using C#/ASP.NET 1.1 for internal web app development and it was so frustrating because when an exception was thrown inside the framework, you’d hit the “no source wall”: the place where the stack trace leads you to code that you can’t look at. At least in the Java framework I can trace through the code and even set breakpoints in framework code so I could figure out if it was my code’s fault or a bug in the framework. Usually it was my code, but whereas in Java I could figure out what I was doing wrong by looking at the Java framework code, in ASP.NET I often just gave up and tried a completely different way of solving the problem (usually by tossing out the use of ADO.NET). Sometimes I even went to the Mono source to see what they’re doing and it did help when I was creating ASP widgets, but it’s not the same thing as having all of the source available with the ability to step into it in a debugger.

I haven’t followed .NET development much since I left eBay, but I’ve noticed that Microsoft has opened up some of the .NET framework source, which is definitely a move in the right direction.

So, I guess subconsciously I’ve been staying away from otherwise appealing frameworks if I can’t access the source code. And it doesn’t have to be “open source”, as in GPL, LGPL, etc., but I at least want the option of seeing it if I need to. I don’t mind proprietary, but without the source, I’m going to choose another framework, my time is too valuable to hit my head against the wall otherwise.

December 27, 2007

More Chartjunk from TechCrunch

Filed under: General Rant

I generally don’t have much to say about TechCrunch. I read it pretty often to see where people are putting their attention (or at least what TechCrunch thinks is the case) since I’m not really in that audience — I don’t visit Facebook (let alone have a profile), I don’t Twitter, and I use my cell phone for making phone calls and the occasional (once a month?) text message. However, a recent post on TechCrunch ticked me off because of the way it plays with statistics. The post is here and it claims that GMail will catch Yahoo! Mail, in terms of unique visitors, sometime in 2010. In and of itself, such predictions are not a problem, the problem is the way this prediction was arrived at: current percentage growth rate from November 2006 to November 2007. That’s right, a single number over an arbitrary time period is used as the sole basis for the prediction, and I quote: “Yahoo showed 3.21% growth for the 12 months to November 2007 compared with Gmail’s 53.60%”. Even worse, this single statistic is used to create Chartjunk:

From TechCrunch: Chartjunk

From http://www.techcrunch.com/2007/12/25/2007-in-numbers-more-people-using-yahoo-mail-this-christmas-than-gmail/

Why the 12-month time-period? Why not compare the growth since Gmail started? Or use projections from the same time-periods for each service, i.e., compare the first two years of Yahoo Mail to the first two years of Gmail? Or pretty much any kind of deeper analysis that takes more than 5 minutes of thought? Does anyone really think that Gmail will continue to grow over 50% every year for the next 3 years? Or that Yahoo! Mail will only grow a few percent every year for the next three years? What makes the past year so special?

Not to mention, does anyone really care? I think the real issue is how much money are the two companies making? And what about the OEM-like agreements that Google has been making, i.e., becoming the email service provider for universities, companies, etc.?

Ugh. I hate Chartjunk and the simplistic statistics that back them up.

November 24, 2007

I’m Back — Where’s the login page?

Since I originally started this blog for my rants (and raves) about software (creating and using), I didn’t feel up to posting anything since my father-in-law’s death in June from an unexpected stroke. However, I am going to start a separate blog to post (mostly rants) about the medical and health insurance industrial complex. Stay tuned for that.

In the meantime, I’m getting back on my horse and will also start some reflecting on introducing agile methods into a development environment, namely the company where I work: Guidewire Software.

And, lest you think I’m not ranting about anything in this post, I’d like to rant about Blogsome — yes, that’s the site that hosts this blog. Generally, Blogsome has been just fine, except that I hadn’t logged in for several months and so not only did I not remember my password, I couldn’t remember how to log in to my account so I could post. My expectation was that somewhere on the Blogsome home page there would be a place to type my username or at least take me to a login page, but there was none. So I looked for a help page or a FAQ, but there wasn’t one. I went to the forums, but didn’t feel like sifting through the threads to find the answer. Finally, I searched through my emails and found the original “welcome” email and used the link contained therein.

It shouldn’t be this hard. I can maybe understand the lack of help pages if you have a nice-sized forum, but the use cases for help pages vs. forums are quite different. What I can’t understand is hiding the login page. And it’s not just Blogsome that does this, but many other sites seem to have home pages that are geared towards new users, making the login/sign-in area hard to find. For example, Jellyfish (one of my favorite “rebate” sites, and I especially enjoy their Smack Shopping reverse auctions) makes it hard to find the login button and instead has a bunch of “wasted” space:

Jellyfish Login is Too Small

Yeah, it’s not only tiny, but it’s in brackets (further deemphasizing it) and is next to the “Sign Up Now” text, so you might even miss it — I have. And what happens when you click on the tiny login link?

There goes the Jellyfish Login

Ohhh, that’s what the “wasted” space is for! Well why isn’t that just there the whole time? My guess: it would ruin the “design”. Form over function wins and the users lose. And lest you think that it’s just some random site that might not have the money for someone dedicated to usability, Washington Mutual Bank recently redesigned their site and now it suffers from the same problem:

WaMu Bank Login

Again, the web site is treating the customers it already has as second-class citizens by forcing us to spend extra mental effort trying to find the login area. The fact that it’s clearly labeled doesn’t help, since we’re programmed to look for a pair of input fields that signify a login area, a visual clue that’s missing here. So what happens when you hover over the little plus sign next to the Log in link?

WaMu Bank Login - Expanded

There, that’s better. Just like Jellyfish, why couldn’t this be open all the time? There’s even less of an excuse here, not just because it’s a bank web site, but there’s no “design” to be ruined here, it’s all blank whitespace.

Remember, just because we can now do fancy things with Ajax, doesn’t mean we should sacrifice usability for “cool” designs.

April 30, 2007

Bad Error Messages Waste Time

Filed under: General Rant

The only thing worse than content-free error messages such as "Error 0" (see The $4,000 Error Message) are those that mislead: telling you that X is wrong when it’s really Y that’s the cause of the problem. At least with "Error 0", you’ll look at everything and think about all of the possible things that could be wrong and either see your mistake or give up and try something completely different.

The evil misleading error message, however, causes you to spend your time and effort on fixing X, until you finally realize (after much cursing and coffee drinking) that there’s no problem with X, X is just fine and works exactly as expected. Only then do you see that Y is the real problem and, even worse, it takes only two seconds to fix it.

This is why programmers should never write error messages. Just like they should never write help text, button labels, menu items, or pretty much any text that the end-user is going to read. That’s the job of the usability/documentation folks: they know how to write. This is also why QA should pay close attention to the error messages (they are testing the error cases, right?) and ensure that they are correct.

Of course, the best solution is to prevent the error conditions in the first place, but that’s another rant. 

Get free blog up and running in minutes with Blogsome
Theme designed by Jay of onefinejay.com