I bring you good news and bad news, dear reader.

The bad news is that it looks as if my present client may be running out of interesting work for me to do, for the time being, which is a real shame as I’m greatly enjoying working there.

The good news though is that this means I’m now available for hire again! If you need an experienced, charismatic programmer, technical architect or coach to join or lead a team of programmers, and you’re serious about that team producing high-quality code that delivers maximum value to its users and enjoying it as they do so, then I think it’s time we had a little chat.

Read more here: http://mattwynne.net/work/cv/programmer/2008/05/14/

Okay, this is another one of those linux newbie posts where I tried to figure out how to do something that’s probably really obvious to all you seasoned hackers out there.

Anyway here I go clogging up the internet with a post that somebody, somewhere will hopefully find useful.

Are you that person? Well… have you ever used the shell command curl to fetch a web page? It’s cool, isn’t it, but you do end up with a splurge of ugly HTML tags in your terminal shell:

Eugh!

So… how about we parse that HTML into something human-readable?

Read the rest of this entry »

I just came across this post from Kevin Lim about a cool new tool for the (Apple-based) Safari browser called SafariStand.

A bit like HistoryHound, this plug-in allows you to quickly search your browser history, review it as thumbnails, and has a killer, iTunes-style cover-flow view of your history called History Flow:



Like Kevin, I’m still not satisfied with this, and would like to see something more like TrailBlazer, that allows me to visualise my browsing history as paths and branches.

Ideally I’d also like this data to be shared so I can socialise with other people who hang out on the same bits of the internet as I do.

Maybe it’s time to dig out that firefox extension tutorial again..?

The WatiN (Web Application Testing In .Net) framework, a port of the popular watir framework in ruby, has recently announced support for Firefox. This should make it a compelling alternative to selenium, especially as it looks to be a good deal quicker.

Sweet. Now if only I had a way to serve up an ASP.NET web application from code. Could this be what I need?

So the wife has been writing her mandatory university course diary as a wordpress blog, but now she needs to hand it in.

> Can you put it on a CD for me? She asks.

Unix to the rescue!

Read the rest of this entry »

I’m building an Adobe Air application at the moment, which basically means loads of javascript development.

We’re building it pure test-first, and have kicked off using jsUnit to get us started with something simple, flipping to the browser when we make a change and hitting the ‘run’ button in the jsTest testrunner HTML page.

I’m starting to find this quite unsatisfactory, however.

Read the rest of this entry »

If, like me, you’ve been confused by the two different, identically-named, unit testing frameworks for javascript, here’s a very useful explanation of their strengths, weaknesses, and purposes.

If you’ve ever tried to copy the source files from a Visual Studio 2005 ASP.NET solution, especially if you’re using TFS and Resharper, you’ll have probably noticed all great steaming heaps of fluff and nonsense these tools leave all over your hard drive. Not to mention all the built assemblies lurking in your bin/Debug folders.

If you have a unix/linux/apple machine handy, or have at least had the sense to instal cygwin or coLinux on your quaint old PC, then give this a rumble.

Read the rest of this entry »

One of the several great things about working for my current client is that their high public profile means it’s reasonably easy to get interesting people to come and visit us from time to time.

Last week the mighty Martin Fowler dropped by to talk to us.

Read the rest of this entry »

My notes on DanNorth and JoeWalnes‘ session at Spa 2008.

Five artefacts:

  • Automation - the glue that binds the tests to the code
  • Vocabulary - the language that the tests are expressed in
  • Syntax - the technology that the tests are expressed in (C#, Java)
  • Intent - the actual scenario being tested
  • Harness - the thing that runs the tests and tells you if they passed

Four roles. People might fill more than one, or more than one person might be in a role:

  • Stakeholder
  • Analyst
  • Tester
  • Developer

Taking a requirement, the Stakeholder and the Analyst have a conversation:

  • what does that requirement mean?
  • how can we create a shared understanding?

Then the Analyst and the Tester have a conversation:

  • what is the scope of (’bigness’) of this requirement?
  • how will we know when we’re done?
  • => Scenarios (examples)

Tester then ‘monkeyfies’ the scenarios, using the following template:

Given … - assumptions, context in which the scenario occurs.

When … - user action, interaction with the system

Then … - expected outcome

e.g. Given we have an account holder Joe and their current account contains $100 and the interest rate is 10% When Joe withdraws $120 Then Joe’s balance should be $-22

The tester and the developer sit down and write an automated test to implement each scenario.

You might chain these up, but you can always categorise test code into these three partitions. This really helps how you look at test code.

Consistency Validation Between ‘Units’

See the Consumer Driven Contracts paper on Martin Fowler’s website.

Tooling for Automation

Consider extending / creating the domain model to cover the application itself - the UI, the back end.

Loads of tools are availlable. Use whatever works and build on it.

Building a Vocabulary

Ubiquitous Language - Start with a shared language. It becomes ubiquitous when it appears everywhere - documents, code, databases, conversations.

You will use different vocabularies in different bounded contexts. A context might be your problem domain, testing domain, software domain, or the user interface domain.

Beware which roles understand you when you’re talking in a particular domain. Often terms will span domains.

e.g. NHibernateCustomerRepository <– 1 –><– 2–><– 3 –>

1 = 3rd Party Provider Domain 2 = Problem Domain 3 - Software Domain

Make your tests tell a story - make it flow. Don’t hide away things in Setup methods that will make the test hard to read. If that means a little bit of duplication, so be it. ‘Damp not DRY’.

Syntax - Implementing Your Tests

  • write your own
  • keep it simple. don’t fart around writing too fancy a DSL. you’ll be surprised what testers / analysts / stakeholders will be prepared to read.
  • great way to learn
  • Jbehave2
  • training wheels?
  • rspec
  • very nice.
  • create templates for each given / when / then which you can plug together with parameter values into scenarios
  • fit
  • concordion
  • nbehave - joe ocampo

Basically what you need is a way to assemble different permutations and combinations of Given / When / Then with different parameters to make different scenarios.

Expressing Intent

Think in terms of narrative, flow. Think in terms of bounded contexts, and who the audience (role) is for that context. Who will understand that vocabulary?

Make sure the intent is clear - that’s the main thing.

Harness

Do you want to hook into continuous integration build?

Which version of the code is it going to run against?

Keep the tests in two buckets: * in progress * done

Those which are in the ‘done’ bucket, should always work, those which are in progress are allowed to be failing, until you make them pass.

Getting Started

Things you can do today.

  • Try it for your next requirement
  • Given When Then helps guide the tests
  • It’s a collaborative process - get people involved
  • Works for bug fixes
  • a bug is a scenario that you missed in the first place use the tools you’re most comfortable with
  • doesn’t have to be perfect

Down The Line

What to aim for.

  • ALL requirements have acceptance criteria specified up front
  • helps with estimation
  • acceptance tests are automated where appropriate
  • just having thought about it helps - you may come back to automating it later.
  • Push button, availlable to all.
  • helps build trust with stakeholders

Advice

  • Automate pragmatically
  • Don’t try to automate what you can’t do manually
  • Testing is validating an outcome against intention
  • Non functional requirements
  • Plan for false positives
  • Quality is a variable
  • doesn’t mean you don’t go test first
  • doesn’t mean low quality code
  • does mean how complete is the solution? - how many scenarios / edge cases are you going to try and meet?

Summary

  • Have a shared understanding of done
  • There is no Golden Hammer
  • Be aware of the five aspects of test automation
  • Automation, Vocabulary, Syntax, Intent, Harness
  • Start simple, then you can benefit now
« Previous Entries