Archive for July 2006
Lately at work my team has had a small habit of not swapping out enough … the same pairs would sit and work on a project from beginning to completion with little or no swapping. Luckily we started breaking away from this last week, and this week alone I swapped in on several different projects.
I have to say, I loved it! Getting to swap around more lets you get to see different parts of the system being developed, and I got to provide my expertise in some areas where the existing pair was having trouble, and at the same time saw a few tricks that improved my knowledge and opened a few doors in my thinking. Sometimes you overcomplicate something, and then you see someone just take the simplest approach, you just think to yourself “Why didn’t I see that before!?”. :
I would say that one of the most underrated principals of XP is pair swapping and shared ownership … I’ve been left with a very positive feeling at the end of this week being swap so much, and at the same time have the confidence in my team members to produce such excellent work.
No tags
25
Test Driven Design or Test Driven Development?
1 Comment · Posted by James Carr in Agile Software Development, Test Driven Development
Tim Ottinger of Object Mentor brought up a great point recently on the testdrivendevelopment yahoo mailing list stating that he has noticed that a lot of people doing TDD are doing it more localized, unit tests only (Test Driven Development) rather than starting at a higher level with Acceptance Tests that drive the design / requirements.
(more…)
No tags
We always hear those sad sad stories everyday… some company patents something dead obvious then tries top hold an industry hostage over it. It really is sad the kind of patents that the USPTO issues.
Of course, the patent holder decided to sue Red Hat, only because they package Hibernate3 with their software. Silly, stupid, and … depressing.
I guess we can’t map objects to relational databases anymore huh?
No tags
Recently I’ve had the need from java to run a job on a remote server that can take a variable amount of time (anywhere from a few seconds to a few hours) and needed to detect when it is complete and get a file it generated when completed. This was a little challanging at first, as I had never used ssh from java, but I knew a little searching would yield results.
After a little searching, I found Java Secure Channel (JSch), a handy library with a BSD license and used in Ant and eclipse. The only sad thing is that there is zero documentation outside of a few examples, and my knowledge of streams (specifically PipedInputStream) was sorely behind as I hadn’t used them directly, since, well, college.
A little confusion abounded for awhile … how the heck am I supposed to detect the end of data coming over a pipe!? I mean, you can detect when it closes, but in my case I want to stay connected and issue more commands and close when I please, which means I cannot simply detect when the pipe is closed.
I struggled for a bit, then decided … I’ll just append ” && echo
public void send(String command) throws IOException {
command += " && echo \"" + TERMINATOR + "\"\n";
toServer.write(command.getBytes());
lastCommand = new String(command);
}
Getting the server response was a bit tricky. Since the command shows up when reading from the server, I need to detect the 2nd time it shows up and break out of the loop on that. After a little time I hacked up the following:
public String getServerResponse() throws IOException, InterruptedException {
StringBuilder builder = new StringBuilder();
int count = 0;
String line = "";
for (int i = 0; true; i++) {
line = fromServer.readLine();
builder.append(line).append("\n");
if (line.contains(TERMINATOR) && (++count > 1)) {
break;
}
}
String result = builder.toString();
int beginIndex = result.indexOf(TERMINATOR+"\"") + ((TERMINATOR+"\"").length());
result = result.substring(beginIndex);
return result.replaceAll(escape(TERMINATOR), "").trim();
}
This makes so many assumptions, but I guess that as I keep working on it I can find a better way. Anyway, below is the final result of the SshClient class I came up with:
(more…)
No tags
