The Artima Developer Community
Sponsored Link

Ruby Buzz Forum
My Apprenticeship - Monday, July 12, 2004

0 replies on 1 page.

Welcome Guest
  Sign In

Go back to the topic listing  Back to Topic List Click to reply to this topic  Reply to this Topic Click to search messages in this forum  Search Forum Click for a threaded view of the topic  Threaded View   
Previous Topic   Next Topic
Flat View: This topic has 0 replies on 1 page
Jake Scruggs

Posts: 336
Nickname: aurorae314
Registered: Feb, 2008

Jake Scruggs is a developer at ThoughtWorks
My Apprenticeship - Monday, July 12, 2004 Posted: Jul 13, 2009 6:08 PM
Reply to this message Reply

This post originated from an RSS feed registered with Ruby Buzz by Jake Scruggs.
Original Post: My Apprenticeship - Monday, July 12, 2004
Feed Title: Jake Scruggs
Feed URL: http://jakescruggs.blogspot.com/feeds/posts/default
Feed Description: Ruby, Rails, Metrics, Testing, and pursuit of clean code.
Latest Ruby Buzz Posts
Latest Ruby Buzz Posts by Jake Scruggs
Latest Posts From Jake Scruggs

Advertisement
This summer I'm revisiting my short apprenticeship at Object Mentor. I'll be posting commentary on all my posts from the summer of 2004 exactly 5 years later to the day.

Monday 7-12-04

Today was a day of unintentional diversions. Paul and I came up with an idea of how to test an area of our state map compiler that had been eluding us. We would build up an input file, in the tests, and then send that input file into the SMC which would create an output file that we could read and check to make sure it works. If we had been designing this SMC thing from scratch using TDD, we could have made it easier to test, but since large parts of the program are a legacy, we had to resort to the building/writing/reading file method. But the parser in the SMC program doesn't like to be called twice, so a fair amount of the day was spent figuring out how to get around that for multiple tests. The other part of the day was spent writing a bunch of tests that had to be thrown out because there's a quirk of the program that given the same input, you may get different output. Everything will be there, but the order is not guaranteed. This is one of the problems with using a list, things may not come out in the order they were added. So our tests, which assumed a certain order, would randomly fail. Great. Luckily, there was only one test that really needed our new method of building/writing/reading so we could move all the old tests back to the old way (we called the program directly to set variables) and, in the one straggler, we re-wrote the test so that order was unimportant.

Pretty much the same thing was going on in the office. The email wasn't functioning and everybody who knew about the mail server was either out of town or teaching a class. Then Quickbooks started malfunctioning and things typed in by one person were not available to someone else in the system Nobody was sure if data might be getting lost -- this had the effect of chilling productivity in the office.

In short, everybody's 9am plans never even got started.


"If we had been designing this SMC thing from scratch using TDD, we could have made it easier to test..." How many times over the last five years have I run into this exact same problem? Too many to count -- lack of test leads to untestable code which is very often unmaintainable code.

Oh distant-past-jake, why didn't you just loop over the list you were trying to test and see if the things you wanted were in there? Ah well, a testing technique I would soon learn the hard way
.

Read: My Apprenticeship - Monday, July 12, 2004

Topic: Adobe Flex Visual Design Integration Previous Topic   Next Topic Topic: My Apprenticeship - Friday, July 9, 2004

Sponsored Links



Google
  Web Artima.com   

Copyright © 1996-2019 Artima, Inc. All Rights Reserved. - Privacy Policy - Terms of Use