Boy, have I been busy the past couple months! And now, I’m comfortable enough to announce what I’ve been working on – my first major open-source project:
Spectacular is an Acceptance Test Driven Development (ATDD) / Behavior Driven Development (BDD) tool that aggregates several different types of testing frameworks into 1, and it also introduces the idea of Executable Use Cases (EUC) – if you have to write use cases, you might as well make them Not Suck.
The idea is that a Business Analyst (BA), Quality Assurance engineer (QA), or Developer can write a spec in any way they feel comfortable with, including diagrams and business rules if necessary. They can write tests in the form of Executable Use Cases, BDD-style tests (Gherkin/Given-When-Then scenarios), and/or FIT-style tests all within the same document. The tool will run through the document, “detect” test cases, execute them, and print out the results in the same format as it was input.
I work at a large financial services company, where compliance with Sarbanes-Oxley (SOX) and Office of the Comptroller of the Currency (OCC) rules and regulations is of utmost importance, specifically with the audit requirements.
I suspect that there are many, many organizations out there who have to comply with the same set of rules, so I took what I learned about SOX and OCC audit requirements, combined them with what I learned at Elisabeth Hendrickson’s AMAZING ATDD course, and created Spectacular to make writing requirements more natural while also making those same documents executable, and not restricting any team to any single tool.
Also, I found through practical application of various ATDD tools that they are all pretty amazing and useful, but it was really annoying to use all these various tools to write specs and tests in different ways located in different locations depending on the tool being used. Plus, I would suspect that most teams would prefer to write story tests in a single document in a single format rather than having them live all over the place.
I don’t think so. Actually, I think something like Spectacular will help any large organization with an established corporate hierarchy and previous experience writing specifications in a use-case format adopt Agile more easily, especially those with “hardened” quality-assurance/quality-control groups. In my experience, these large organizations can be like “steering the Titanic with a small rudder” when it comes to transitioning to a more Agile process – allowing teams to continue writing requirements in the form of Use Case flows and documenting the tests in the same document will let them experiment with the various ATDD best-practices while remaining compliant with their regulatory bodies.
Spectacular helps those teams constrained with writing full-specs by allowing those teams to write the specs with tests embedded in them. Agility is introduced because those specs – written in a format they are used to – are now executable. A core Agile practice IMHO.
Yes, really. Use cases can tell a lot of the “story” if written well. Use cases, just like implementation code when written after a unit test is written, can be written well if there a constraint of execution behind it. Also, traditionally use cases have been taken to a far extreme of complicated. Not necessary IMHO.
To me, Use Cases fill the role of “Epic Spec” in an agile process. I’m a huge believer in the practice of Story Mapping and Persona Development (from Jeff Patton and Dave Hussman, respectively. Two of my personal geek-heroes). While doing your story mapping workshop, the high-level “activities” that you decompose into stories can very easily be Use Cases. In fact, in my experience writing Use Cases to explain the high-level activity (or “Epic”) can help to decompose it into discreet stories. And as such, each level of requirement-granularity (from Epic/Use Case to the Story) requires a different way to test it.
As such, I use Spectacular myself to execute Use Cases against Epics, and BDD/Gherkin and FIT tests to execute Stories.
I don’t know about the rest of you, but I hate it when I stumble upon a useful open-source tool only to find that the documentation is poorly written. Now, I’m not saying Spectacular’s docs are amazing, but I did spend some time writing a good amount to make sure people could pick up Spectacular and use it relatively quickly. All of the docs are located at the Spectacular Wiki on Google Code. I welcome all feedback so that the documentation can be improved!
But here’s an example. Given a document:
(Executable Use Case)
| Primary Flow: Register New User to System | ||
| User Action | Expectation | Comments |
| User navigates to “http://blog.minderupt.com/” | User sees blog site with existing blog entries | |
| User clicks on “Log in” link | User sees page requesting credentials | |
| User clicks on “Register” link | User sees page requesting registration info | Reg info includes a username, password, confirm password, and age! |
| User enters registration information and submits form | User sees page asking user to confirm |
Business Rules:
Story: As a new user not already registered I want to register myself so that I can use the system.
(BDD/Gherkin Executable Test)
|
Scenario: Brand new user correctly registers Given a username of “myusername” is not already registered Scenario: Good username, duplicate email Given a username of “myusername” is not already registered Scenario: Duplicate username, good email Given a username of “myusername” is registered |
Story: As a new user not already registered I should not be able to skip any data elements so that…
(FIT executable test)
| Username | Password | Confirm Password | DOB | registered() |
| myusername | mypassword | mypassword | 11/01/1960 | true |
| username1 | password1 | password2 | 11/01/1960 | false |
| myusername | mypassword | mypassword | 01/01/2005 | false |
With these requirements written, Spectacular will run through this document and parse out the tests (basically, anything contained in a table and fitting particular patterns) and execute test fixtures for each of these. While for version 1.0 Spectacular only supports Java (using JBehave) for the BDD/Gherkin and FIT tests, Executable Use Case fixtures can be written in Java, Groovy, Ruby (experimental – using JRuby), and Selenese (to directly drive a browser using SeleniumRC). The ability to write fixtures for BDD/Gherkin and FIT in other languages is coming soon! (I’d really like to be able to write BDD/Gherkin tests using Cucumber as the engine if possible)
Try it out! I hope the Agile community finds some use out of this tool like I have. If you have any questions, you can leave them here in comments or join the users & dev lists.
Much of Spectacular is based in part or whole from the following projects:
As well as from the teaching/writing/works from the following people:
A great analogy, brought to you by a viewing of Bravo TV’s “The Fashion Show.”
Here it is: An architect who does not code produces the same quality of work as a fashion designer who does not sew.
Please, for all of you who hold that title of “Architect:” Do not tell me your “team of people” will dive into the details. If you do not know the ramifications of your design (which eventually come out in the details) then show me someone who does. If you’re responsible for systems design, even at bird’s eye level, please be able to do some coding so prove your design, even if you’re not officially coding for the project.
Seriously.

A couple weeks ago I attended a public class led by Elisabeth Hendrickson and Dale Emery (which, btw, was aboslutely AMAZING and if you have not taken their class before, I would highly recommend that you do so). Two things stood out during that 3-day class: Elisabeth’s simulation (where we all naturally migrated to a more test-first process), and the discussion around ATDD using natural domain language.
For example:
Given a user with the email address “someone@something.com” has not already registered with the system
When a user tries to register in the system with the email of “someone@something.com”
And a name of “Michael Dowling”
And a date of birth of “1/1/1985″ (yeah right)
Then register the user with an access token of “Registered”
This executes the following Cucumber code (in Ruby):
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | Given /a user with the email address "(.*?)" has not already registered with the system/ do |email| @email = email end When /a user tries to register in the system with the email of "(.*?)"/ do |registerEmail| @registerEmail = registerEmail end When /a name of "(.*?)"/ do |name| @registerName = name end When /a date of birth of "(.*?)\/(.*?)\/(.*?)"/ do |dobMonth, dobDay, dobYear| @month = dobMonth @day = dobDay @year = dobYear end Then /register the user with an access token of "Registered"/ do token = RegistrationService.register @registerEmail @registerName @month @day @year if token != "Registered" raise "Not registered" end |
The neat part of this is that it is an executable document; meaning, it is input to “test fixtures” written by development to test the software being developed from an acceptance point-of-view. This is the essence of “Behavior Driven Development” or BDD, of which I am a total convert.
I want to write much more about this topic – and I will. For now, though, the one though swirling through my head is the need to have documents be in formats large organizations (such as my employer) use to describe requirements (behaviors). I doubt it will be possible for most teams to check-in plain text files and be comfortable with that. Plus, these documents will need to be passed around, possibly stored in Wikis, or other document management systems (even though ideally, these documents would be in source control along with the ATDD code).
I think I found a new project for myself. Hmmm….