440 likes | 642 Views
Agile Acceptance Testing Software development by example. Gojko Adzic gojko@gojko.com. An experiment with four active battalions in US Army . Commander expectations matched actions in only 34% of the cases. L.G.Shattuck, 2000 http://www.au.af.mil/au/awc/awcgate/milreview/shattuck.pdf.
E N D
Agile Acceptance TestingSoftware development by example Gojko Adzic gojko@gojko.com
An experiment with four active battalions in US Army Commander expectations matched actions in only 34% of the cases L.G.Shattuck, 2000 http://www.au.af.mil/au/awc/awcgate/milreview/shattuck.pdf
Agile acceptance tests solve this problem! It might be called testing, but it is still important!
“Fit is a tool for enhancing collaboration in software development. “ Ward Cunningham, 2002
How do we verify that this thing we are going to write is implemented completely and correctly? Can you give us a few examples?
Pretend it is magic… …and we deliver this software. How would you test it?
Inconsistencies and gaps are easy to spot when you write the rules down!
Real-world examples help flush out incorrect assumed rules find real business rules!
People have think at a more detailed level and can't brush questions off…
The acceptance test threesome “A BA, a Developer and a Tester go into a room…”
Back to the military example: Only 19% of Commander's Intent statements had anything to say about the purpose of the mission The Mission: The Dilemma of Specified Task and Implied Commander's Intent William Crain (http://handle.dtic.mil/100.2/ADA225436),
BA/Customers must help developers understand business reasons behind technical requests
User stories are a great complement acceptance tests They communicate intent and have just enough detail to start the conversation
User stories are the scope.Story tests are the specification.
Writing story tests • Chance to learn about the domain • Capture the conversation! • Make sure that everyone speaks the same language • Flush out inconsistencies • Build a complete description
Communicating Intent • Here's what I think we face • Here's what I think we should do • Here's why • Here's what we should keep our eye on • Now, talk to me. • Revised commander’s intent document, Karl Weick "Managerial thought in the context of action"
Step 2:Automated specification check Because we are lazy…
The Toyota Way Check at the source Inexpensive Verifications Test to prevent defects, not to discover them
Save time on manually (acceptance/smoke)testing Verify business rules with the click of a button
FIT and FitNesse allow you to automate tests, but still keep them human-readable And you can add pictures as well….
Step 3:Providing focus for development No just-in-case code
Developers will have to code exactly what was specified … not just the rules they see
Automated testreports show where we are… When all the tests are green, the job is done
Automated tests show straight away when something is obsolete or broken
[tests became a] “significant and valuable business resource” Rick Mugridge, Doubling the Value of Automated Tests, Google Tech Talks 09/2007
“It’s extra work and I don’t have time” Save time by not writing those big requirements docs that nobody reads…
“But they will only look at the tests and not read the requirements…” Tests ARE Specifications
“What if I leave something out? If they are using tests as the scope, and we do not specify some tests, what happens then?“
“That’s cheating! We give the developers exactly what we are going to test, and they develop the software only to pass those tests…”
“I won’t understand user stories and tests, I’m used to use cases” Story tests still contain triggers, steps, exceptions…
“It’s impossible to describe UI layouts as FIT tests” So use something else – share the knowledge when you discuss tests
“Rules are too scattered, there is no big picture” Communicate intent when writing stories, clean up tests to isolate rules, add some general docs…
“Describe-Demonstrate-Develop” by Jim Shore A very useful way to think about acceptance tests in wider context http://jamesshore.com/Blog/How-I-Use-Fit.html
Step 1: Describe • use a short paragraph to describe part of the functionality that the software supports.
Step 2: Demonstrate • Provide some examples of the functionality • show the differences in possibilities
Step 3: Develop • Implement the functionality using TDD.
…xUnit insures thecodeisbuiltright, and FitNesse insures therightcodeisbuilt. Andy Dassing on the FitNesse mailing list
Where next? http://gojko.net http://www.fitnesse.org http://www.fitnesse.info