Skip to main content

So you want to get rid of Use Cases?

I'm going to do a lightning talk on this topic at tomorrow's XP-meetup, so if any of you devoted readers are attending you might get away with reading this blog-post. Spend the five minutes going downstairs for a pint, and bring me one while you're at it, please.

I was once in a meeting participated by a team of developers, requirement managers, test managers and project managers. The topic of discussion were how requirement changes should be handled.

The original requirements were described mostly in the form of use-case documents. The problem, and the reason for the meeting, was that the implementation was failing to follow the stuff specified in the use-cases.

The round went around the table with each and every member pledging to read the use-cases more carefully, and the requirement manager promised to clearly highlight changes and references in the documents.

When the turn came around to me I said something along the lines of:

I have read the use-cases already. I'm not going to spend time sitting scrolling through them looking for changes. There must be a better way to instruct changes into the implementation than fishing them out of some bloody Word document.

This didn't go well down with the project manager, and I was (not literally) told to stick to it, keep reading the use-cases like all the others.

Now I know use-cases are supposed to be light, user-story like, but in the hands of document-riders and management they become bloated with design descisions, business rules and interface nit-picking.

It's hard labour to track changes in these documents. I suggested putting them into wiki-format, but that proved to be too much hassle for the requirement manager. Pasting the word documents into the wiki ended up looking really ugly (considering the size of the use-case descriptions).

You can't modularize use case steps, you can't re-use them, and you can't refactor them. All in all, they're a pretty crappy form of requirement specification, especially for us developers that hate Word documents.

Then along came Selenium and showed us that Web-tests that are fun:

They're executable! We could use them as developers to speed up our own tests. We can even stuff them into our automated build/continous integration system.

It's dead easy! It's so easy even the document riders fell in love with them. We even got the testers to report bugs with them (bug traces).

The test managers could use them for acceptance testing and performance testing. So the normally huge acceptance testing phase at the end of the project was reduced to a matter of days.

Sure Selenium tests break easily, but they're easily repaired also. And most of all, when they break you (as either a developer or manager) are forced to recognize that a change has taken place, and you can decide whether this is a faulty test or a faulty implementation.

The flip side is that they're too easy to make. If the developers' test-suite gets bloated with all the tests managers want in, the suite runs too slow for the patience of a test-driven developer.

They are not refactorable, other than in the search-replace meaning of the word. If a change takes place across the entire web application you might have some work ahead of you to get the suite green again.

It can be hard to visualise the steps that will run in a web-test (but isn't it just as hard in a use-case?), so if you insist on creating the Selenium test before you do the implementation you will need some imagination and knowledge of Selenian. One way to work aorund this is to do prototyping of the webapp with static html pages, and record Selenium tests based on these.

Popular posts from this blog

Encrypting and Decrypting with Spring

I was recently working with protecting some sensitive data in a typical Java application with a database underneath. We convert the data on its way out of the application using Spring Security Crypto Utilities. It "was decided" that we'd be doing AES with a key-length of 256, and this just happens to be the kind of encryption Spring crypto does out of the box. Sweet!

The big aber is that whatever JRE is running the application has to be patched with Oracle's JCE in order to do 256 bits. It's a fascinating story, the short version being that U.S. companies are restricted from exporting various encryption algorithms to certain countries, and some countries are restricted from importing them.

Once I had patched my JRE with the JCE, I found it fascinating how straight forward it was to encrypt and decrypt using the Spring Encryptors. So just for fun at the weekend, I threw together a little desktop app that will encrypt and decrypt stuff for the given password and sa…

Managing dot-files with vcsh and myrepos

Say I want to get my dot-files out on a new computer. Here's what I do:

# install vcsh & myrepos via apt/brew/etc
vcsh clone https://github.com/tfnico/config-mr.git mr
mr update

Done! All dot-files are ready to use and in place. No deploy command, no linking up symlinks to the files. No checking/out in my entire home directory as a Git repository. Yet, all my dot-files are neatly kept in fine-grained repositories, and any changes I make are immediately ready to be committed:

config-atom.git
    -> ~/.atom/*

config-mr.git
    -> ~/.mrconfig
    -> ~/.config/mr/*

config-tmuxinator.git  
    -> ~/.tmuxinator/*

config-vim.git
    -> ~/.vimrc
    -> ~/.vim/*

config-bin.git   
    -> ~/bin/*

config-git.git          
    -> ~/.gitconfig

config-tmux.git  
    -> ~/.tmux.conf    

config-zsh.git
    -> ~/.zshrc

How can this be? The key here is to use vcsh to keep track of your dot-files, and its partner myrepos/mr for operating on many repositories at the same time.

I discovere…

Always use git-svn with --prefix

TLDR: I've recently been forced back into using git-svn, and while I was at it, I noticed that git-svn generally behaves a lot better when it is initialized using the --prefix option.

Frankly, I can't see any reason why you would ever want to use git-svn without --prefix. It even added some major simplifications to my old git-svn mirror setup.

Update: Some of the advantages of this solution will disappear in newer versions of Git.

For example, make a standard-layout svn clone:

$ git svn clone -s https://svn.company.com/repos/project-foo/

You'll get this .git/config:

[svn-remote "svn"]
        url = https://svn.company.com/repos/
        fetch = project-foo/trunk:refs/remotes/trunk
        branches = project-foo/branches/*:refs/remotes/*
        tags = project-foo/tags/*:refs/remotes/tags/*

And the remote branches looks like this (git branch -a):
    remotes/trunk
    remotes/feat-bar

(Compared to regular remote branches, they look very odd because there is no remote name i…