I’m pulling together a presentation on test-driven development for our company’s Java technical community, and so I’ve been forced to look at my own development practices. Sure, I use Ant as a build tool, and even use it to run my Junit tests. In fact, I’m so convinced of the value of this sort of stuff that when I made my brief foray into PHP, I found its corresponding xUnit tool, PHPUnit, and used it to help me build my system. But, casting a critical eye on how I actually do things, I can’t actually call my style of development “test-driven”. Often “test-validated”, and even sometimes tests that are written concurrently with code, but hardly ever test-driven. The idea behind test-driven is that you write the test first, and then your code once you have a test case to validate what you’re writing. My approach generally is to write the code first, and then to not consider it “valid” until it passes a test case that I’ve yet to write. Unless, of course, I consider the code I’ve written either too trivial to be worth testing (danger, Will Robinson!) or too difficult to set up a test case for (holy coding ostrich, Batman!) – in which case, I just sort of cross my fingers and figure that it’d be easier to catch any bugs as we use the stuff than it would be to write the test case to find it at the outset.

I’m not sold yet on TDD. Although I’m a fan of unit testing, my client doesn’t pay me for unit tests, they pay me for a working system (yes, I recognize that there’s a correlation between the two, I just think the correlation is looser than one to one). So, I’ll have to see a clear win in terms of either time required to do initial development, or time required to hunt down bugs. So far, I think I’d spend more time writing unit code than I’d recoup. (Remember, I’m already writing unit code for some things – just not all things.) Although I know there’s flexibility in TDD, that not _everything_ gets tested to the lowest level, seems you’d have a hard time defining where to stop. I’m looking over Kent Beck’s Test-Driven Development by Example book to see an expert walk through the process and make sure that I’m giving the thing a fair shake. May give more room in my blog later to some of the stuff I find out…

Hey, I won a copy of ‘Bitter EJB’ from JavaRanch! They regularly have book giveaways where the authors of a given book answer questions in a forum related to that book. Folks are entered into the contest by posting something in the forum that week. As I’ve been working on learning EJBs, and specifically how to do something with them using BEA’s app server, I answered a guy’s question (my wonderful answer here), just basically to test out how well I was learning my stuff. Turns out my post got randomly selected as someone who was going to get a book! And I’d been drooling over that book, anyway, so this just made my day!

There’s a movement/concept/broadly championed idea of something called Design Patterns within software development. For those of my readers who aren’t familiar with the term, the idea is that there lots of basic problems that software tries to solve, and there are some commonly understood solutions to those problems. Usually it takes a certain degree of experience in the field to realize that everyone does X in basically the same way; design patterns are a way of writing down the way that everyone does X, the problem that the solution tries to solve, and what tradeoffs there are in using this particular pattern to do X.

The term actually originally came from a guy named Christopher Alexander, who recognized that architects use the same basic solutions to solve problems when designing buildings. For example (very rough), if you need a way to get from floor 1 to floor 10, an architect will usually provide some number of elevators, and those elevators will be in an easy to locate place. Wouldn’t be any good if you had to climb a fire pole to get up to the tenth floor, or if the elevator was hidden behind the bathroom. See, they pay us software weenies too much money to use common sense sometimes.

OK, enough explanation… There’re lots of techie books out there listing lots of patterns. My new fav, though, is a slice at dating patterns. What are some well-recognized patterns for getting a date? Well, there’s the Factory pattern: any good singles bar. And there’s the Decorator pattern: she’s great for loud parties, but dumb as a cabbage. Lots more… Geeks will appreciate the reuse of techie pattern names. Non-geeks (aka normals) will appreciate the description of the pattern, even without the context of the classic techie GoF pattern background.

From one of the various often software-related blogs I frequent to get various viewpoints and ideas (in this case, The Fishbowl)
“If a tree falls in an application, and nobody is around to hear it, is it logged?”

Having one of those mornings where I’m desperately reaching for some kind of punny retort, but I’m knot coming up with anything. More coffee…

My client’s offered to pay for my time so that I can go to JavaOne! Actually, that happened a couple of weeks ago. But the request has sat on my boss’s desk since then, due to a combination of external factors. I had nearly written the request off as a “not going to happen”, but decided to give it one more go. Sent off an email requesting a response, stating that I needed to let my client know if I was going or not (rather than saying, “I really wanna know now!”), and got back a request for a cost estimate for the trip. Sent it off… waiting and hoping… drooling over a whole set of sessions that I’d love to attend…

My husband’s had to work a lot of late hours lately. His software project is on a tight schedule, and so the whole development team has been putting in a lot of extra time. We work for the same company, and I even have a minor part of his project, so I’m getting to see the situation from lots of angles. There’s the go-team angle: I’m a fellow employee who knows what the guys are going through, and wants them to succeed. There’s the sympathetic wife angle: my poor guy’s had to give up most of his evenings and his weekend time the past two weeks, and has come dragging in the door 9:00 or later in the evening. And then there’s the ticked-off wife angle: it’s been two weeks of mostly eating dinners by myself, taking care of our home and daughter by myself, and handling anything that comes up by myself. Not that it’s fault, but as each day passes where the workload doesn’t end (for him or me), I lose my patience more and more easily. And that minor work I’m supposed to be doing for the same project is getting ignored, because I don’t have any extra time to put in since I’m doing parental/home front double duty.

Theoretically, the deadline for the work to be done was yesterday. So, I was thinking that maybe, just maybe, hubby would be able to take the afternoon off and enjoy the fruit of some of those extra hours he put in early in the pay period by soaking up some sunshine today. And I had lined up a few activities for me for this weekend and next week, now that I’d have a little breathing room on the home front. But it’s 10:45 at night with my husband still at work. His intent is to work horrendously late tonight (he promised me he’d be home by the time I wake up tomorrow), if need be, so that he doesn’t go in for the rest of the weekend and can actually spend some time with our daughter. Getting home so late at night, she’s been in bed before he’s gotten home every night this week.

Cora and I are doing fine, though I’ve gotten lax on meal preparation: cereal, some cheese and a hot dog make a reasonably well-balanced diet for a toddler, right? And mom will just have a bowl of cereal and maybe a frozen burrito. There just doesn’t seem to be much point to making a real meal – dealing with a fussy toddler, making a mess in the kitchen, cleaning up that mess – all for the sake of eating by yourself (unless you count the food smearer and dropper known as Cora as great dinner company). I’m not sure what Jason’s eating – some combination of canned soups, PopTarts from the vending machine, and whatever else is easily available. Makes fewer dishes to clean this way, anyway.

I came home really mad tonight, but I think I’ve cooled off. Now I’m just tired. Going to bed to recharge for my software widow day tomorrow.

Had a moment the other day that I can only describe as Jenga coding. Having spent the day working on a difficult problem, designing, coding and testing the first part of the newest feature of my behemoth, I still had an hour to go on the day. I pondered: what could I do, what could I test further, what further step could I accomplish in the time remaining? I suddenly had a vision of a Jenga tower. Rather than the typical beer-drinking game version of writing various drinks on the sides, my Jenga blocks had class and method names, the classes and methods of the solution I’d built so far. That tower was looking mighty precarious. So, I went home. No sense breaking something just before heading out the door.