Cory Foy

Saturday, April 26, 2008

Moving into Agile Architecture

Things are going to be interesting over the next couple of months. I guess that my new role is part of the architecture team. I've already had quite a rude awakening of how the industry has bastardized XP and Scrum (after somehow being sheltered by working in a great XP company, and then being onsite as an expert), and traditional software architecture is one of those things that I've never been fond of. Note that I don't mean architecture isn't important, or that teams shouldn't think about it. More that architecture models should be developed from actual requirements, and should be publically displayed to the other teams, and developed in a collaborative manner.

I've been re-reading a lot of stuff from Scott Ambler's sites, and I found an essay he did on Agile Architecture which sums up how I'm feeling right now:

  • Your architecture must be based on requirements otherwise you are hacking, it’s as simple as that.

  • To promote communication within your development team I am a firm believer that you should follow the practice Display Models Publicly for all of your architectural diagrams because an architecture that is a closely guarded secret isn’t an architecture, it’s merely an egotistical exercise in futility.


Part of me feels like this is going to be an interesting exercise of the work I've done over the past several years. Here's hoping we end up on the other side an agile project.

Friday, April 18, 2008

Extremely disappointed with Serena Dimensions

Before I joined my current job, they had just standardized on Serena Dimensions for the source control. In the past, I've used several different source control systems - CVS, Subversion, TFS, SourceSafe, etc. But I have never opened up a source control client and been utterly clueless as to how to get the files down. I mean, just lost.

But I managed to get past that, only to discover that even though they pretend to have a command line version of their tools, they all pop up a dialog box for the login - there is no way to pass it in via command line. Meaning that any efforts to automate our builds using things like CruiseControl.NET are on hold at the current moment. I was hoping that I'd just be able to use the pvcs task, but apparently that is for Serena ChangeMan, not Serena Dimensions. I even tried renaming the exe from dmcli to pcli just to see if NAnt could work magic - to no avail.

I'm hoping to find some way around it. They supposedly have an API, so I could write my own client, but looking at the license for the samples, I'm not allowed to show anyone the source code for them, so I'm likely going to have to try to figure it out without looking at them.

Has anyone gotten automation working with Serena Dimensions? I'd love to hear from you.

Calculating differences using queries in DbFit

I'm doing a bunch of things over the next couple of weeks with FitNesse and DbFit, so I'll be posting tips and tricks from the stuff I'm doing.

Today I had to calculate that a specific amount was updated in the database. Since I'm writing characterization tests, I can't just modify the database to make things easier. Luckily the way Gojko wrote DbFit, it can help quite a bit.

Let's say you have a transaction which adds a user to the database, but also updates some Active Users Count table. This isn't what we were doing, but will make the story work. ;)

Your fixture may look something like:


|MyDoFixture|

|import|
|dbfit.fixture|

|Query|SELECT ActiveUserCount FROM ActiveUsersCount|
|ActiveUserCount?|
|>>countbeforetransaction|

|Add User To Table With Name|Justin Example|

|Query|SELECT ActiveUserCount FROM ActiveUsersCount|
|ActiveUserCount?|
|>>countaftertransaction|

|Query|SELECT (:countaftertransaction - :countbeforetransaction) As DiffCount|
|DiffCount?|
|1|

In other words, the parameters are actually just replaced before the query is run, so you can do things like this to make life easier. There may be a better way, but the problem I had was that the query to get the equivalent of the count above was rather lengthy.

Thursday, April 17, 2008

FitNesse DoFixtures and Gojko's DbFit

Things have been kind of quiet on my front because of how crazy things have been at work. But in a good way. One of the things I've been doing is introducing FitNesse as an integral part of our strategy for capturing business rules and domain logic that isn't really being captured anywhere.

Currently I'm working on some characterization tests around one of our legacy transaction systems. Basically a component calls our web service, which processes the request and then updates the database. I've been using a DoFixture with the .NET version of FitNesse to capture the steps. When it came time to test the database, I knew I wanted to use Gojko's DbFit fixtures.

So far, they've been great. The hiccup was that I needed to integrate them into my existing DoFixture flow. However, using the handy property of DoFixtures to be able to return other fixtures, I've got it working.

The test would look something like:

!|MyTestFixture|

|Set Blog To|http://www.cornetdesign.com|

|Add Link To Blog With Username|Cory|And Password|Password|

|import|
|dbfixture.fixture|

|DatabaseEnvironment|ORACLE|
|Connect|MYDB|username|pw|

|Ensure Link Was Added To Database With Query|SELECT LinkUrl FROM Links|
|LinkUrl|
|http://www.cornetdesign.com|

The code for the db method would look like:

public dbfit.fixture.Query EnsureLinkWasAddedToDatabaseWithQuery(string query)
{
  return new dbfit.fixture.Query(dbfit.DbEnvironmentFactory.DefaultEnvironment, query, false)
}

Two great tastes that taste great together.

Wednesday, April 02, 2008

What is Agile?

Lately in the software industry, everywhere you turn you hear about "Agile". Its in the conferences, in the literature. You have Agile Modeling, Agile Software, Agile Requirements, Agile Architecture, and a whole host of acronyms that make your head spin. And then people start combining them (XP and CMMI! Scrum and XP! Scrum and CMMI!).

That's why I had originally started Agile FAQ. It's a place to try to pull together all of the information that is out there. Alas, my changing of jobs disrupted the flow, but now that things are settling back, I have a renewed goal to get the site going again. One way to do that is my taking the questions from the site and putting them in the form of blog posts here.

The very first question we kicked the site off with was "What is Agile?" I got the opportunity to have great support from many leaders in the agile community, which has led to some great responses on the site from people like Andy Hunt, Jim Shore, Alistair Cockburn and Ron Jeffries.

If we look at a dictionary response to the word "Agile", we'll see it isn't a proper noun. The form "agile" from Encarta says:

  1. nimble: able to move quickly and with suppleness, skill, and control
  2. mentally quick: able to think quickly and intelligently

The problem is that this term gets applied to a wide variety of domains, which try to piggy-back off of the agile software movement. Andy Hunt, in his reply, was very clear that the agile manifesto was coined for software development, and other uses would be considered children of that original definition.

Alistair Cockburn had a stronger definition:

There is only one definition for agile software development, which is of course the manifesto itself. That has to remain the touchstone for all other attempted definitions, because it is the one that identified the term as applied to software development and also described what it means. Any other definition is just a personal statement reframing the manifesto into some individual's worldview.

Jim Shore and Ron Jeffries both took a slightly different path. Jim said:

Agile is defined by the people who use it. There's no hard and fast definition. Sometimes this is good, because it allows the practice of Agile to continue to evolve and grow. Sometimes it's bad, because people hijack the term to mean lazy or sloppy software development, or use the Agile brand to sell some less-than-agile approach.

While Ron continued:

I agree with the sentiment of Alistair's view that "Agile" ought to be defined in terms of the Manifesto. But the definition of a word is in its usage, not in some dry dictionary or manifesto. The word "awesome", for example, used to mean the feeling one would have in the presence of God. Today, as Chet just pointed out to me, "awesome" refers to a bagel that doesn't suck.

Folks, you just can't get any clearer than that. Which seems to beg the question - when you want your team to be "agile", are you shooting to be adaptive and people-oriented - things that are hard? Or are you shooting to be the team that doesn't suck.

As much as I like bagels, I know which I'd choose.