Friday, April 11, 2014

Agile in a Flash 21

Agile in a Flash by Jeff Langr and Tim Ottinger (card #21)

Acceptance tests are used to verify that the team has built what the customer requested in a story.

> Are defined by the customer
> Define “done done” for stories
> Are automated
> Document uses of the system
> Don’t just cover happy paths
> Do not replace exploratory tests
> Run in a near-production environment
--

Are defined by the customer Acceptance tests (ATs) are an expression of customer need. All parties can contribute, but ultimately, a single customer voice defines their interests as an unambiguous set of tests.
Define “done done” for stories ATs are written before development as a contract for completion. Passing ATs tell programmers their work is done and tell customers that they can accept it.
Are automated You can script, and thus automate, all tests that define expected system capabilities. Manually executed scripts are a form of abuse.
Document uses of the system Design readable tests so they demonstrate, by example, valid uses of the system. Such documentation never becomes stale!
Don’t just cover happy paths It’s hard to capture all alternate and exceptional conditions. Inevitably you’ll miss one. Add it to your AT suite.
Do not replace exploratory tests Exploratory testing highlights the more creative aspects of how a user might choose to interact with a new feature. It also helps teach testers how to improve their test design skills.

Run in a near-production environment ATs execute in an environment that emulates production as closely as possible. They hit a real database and external API calls as much as possible. ATs are slow by definition.

Thursday, April 10, 2014

Agile in a Flash 20

Agile in a Flash by Jeff Langr and Tim Ottinger (card #20)

> Defer alternate paths, edge cases, or error cases
> Defer supporting fields
> Defer side effects
> Stub dependencies
> Split operationally (for example, CRUD)
> Defer nonfunctional aspects
> Verif y against audit trail
> Defer variant data cases
> Inject dummy data
> Ask the customer
--

Deliver completed stories in each iteration. Avoid XL (extra large) stories that “go dark,” requiring many iterations before you can show completed product. Consider splitting off alternate paths, edge cases, or error cases, using acceptance tests to delineate each. (But remember, they must still show business value.)

In many cases, you can split off secondary details: supporting data fields (distill to a few core fields), input validation (assume the input data is perfect), or side effects (worry later about, for example, impacts to downstream feeds). You might similarly defer nonfunctional constraints (such as logging, graceful error handling, performance, or auditing) and variant data cases (for example, have a
shipping system send all packages to the same address).

Here are some other options for putting those XL stories on a diet:
> “Fake it until you make it,” by stubbing dependencies on third-party systems or by injecting dummy data and doing data collection stories later.
> Split along CRUD (Create, Read, Update, Delete) boundaries. You don’t have to build “create” stories first!
> Use audit trails (or logs) to verify progress not visible to the user.

Finally, ask your customer—don’t be surprised if they come up with an even

better idea for breaking down your bloated stories!

Wednesday, April 9, 2014

Agile In a Flash 19

Agile in a Flash by Jeff Langr and Tim Ottinger (card #19)

> Card
> Conversation
> Confirmation
--

Cards are superb for story derivation and planning, but focus on the dialogue they create—not so much on their format or wording. Sail to success on Ron Jeffries’ three C’s (see http://xprogramming.com/articles/expcardconversationconfirmation).

Card Story cards are little physical things with purposefully insufficient space for every detail about what should be built. They are promises for subsequent communication that must occur. Ron says cards are tokens; the card isn’t the real thing—it’s a placeholder for the real thing.
Conversation So, what is the real thing? Collaborating to build and deliver software that meets customer needs! To succeed, you must converse continually. You must continue to negotiate supporting specifics for a story until all parties are in agreement and the software is delivered.
Confirmation A story’s specifics must ultimately be clear to the customer and your team. The customer uses acceptance tests (ATs) to define this criteria. These ATs exercise the system to demonstrate that the implemented story really works. When all ATs for a story pass, the customer knows that the story is truly done—the software does what they asked.


Think of stories in a more ephemeral sense. Once you build the customer’s need (represented by the story) in code, the story has been heard. Only the working feature and the tests that document how it behaves remain. Rip up that card!

Tuesday, April 8, 2014

Agile in a Flash 18

Categorize Requirements with FURPS – The Plan
Agile in a Flash by Jeff Langr and Tim Ottinger (card #18)

> Functionality
> Usability
> Reliability
> Performance
> Supportability
--

As you mature in agile (see Card 27, Shu-Ha-Ri), consider ideas outside its realm, such as HP’s FURPS (http://en.wikipedia.org/wiki/FURPS) requirements categorization scheme.

Stories technically are not requirements; they are informal expressions of customer need. You can still categorize such needs using FURPS. Most significantly, FURPS reminds you that stories can represent more than just the immediate goals a user wants to accomplish by interacting with the system—the functionality.

More than with Functionality stories, you must vet -URPS (excuse us!) candidates against INVEST characteristics of a good story (see Card 17, INVEST in Your Stories). For example, it’s hard to define acceptance criteria for usability, but otherwise you have no idea when the story is done.

Functionality User features your customer wants, of course!

Usability Product effectiveness, aesthetics, documentation, and so on.

Reliability Failover, downtime, recovery, system accuracy, and so on.

Performance Max response time, throughput, memory consumption, and so on.


Supportability Testability, serviceability, monitorability, extensibility, and so on.

Monday, April 7, 2014

Car Talk Puzzler - Mind Gym for the Team

I am a fan of the NPR show Car Talk and they have a weekly puzzler for listeners to solve.  I found this to be a great "Mind Gym" exercise for solving issues that have many combinations.
For the last couple of weeks, they have had a great puzzler that I almost solved but is worthy of engineers to attempt and to consider.  Linked below is the text of the puzzle
http://www.cartalk.com/content/prison-switcharoo-0?question
You can figure if you would solve the issue and send your friend to freedom or to be fed to the alligators.
In programming, we find our proposed solutions focusing upon numbers and information that become, or are, irrelevant to the actual solution.  As the Car Talk host suggested, a group of students were fixed upon the number 23 as being prime.  Yet, the number 23 only diverts attention from the solution. This mind gym exercise can help us to examine how we look at other problems in the workplace (i.e. is our focus correct, are we over-analyzing the facts, and what is truly the objective of our projects.) Remember, the objective here is not to be fed to the alligators.  
We, as programmers, could go one step further and ask how to program a calculation that solves this in your favorite language.
**The hint to figure your base case and to solve for 3 prisoners can help a bunch.

Agile in a Flash 17 - INVEST in your stories – The Plan

INVEST in your stories The Plan
Agile in a Flash by Jeff Langr and Tim Ottinger (card #17)

> Independent
> Negotiable
> Valuable
> Estimable
> Small
> Testable
--

Customers describe their needs as briefly stated stories, best captured in a few words on index cards. Vet these candidate stories against Bill Wake’ s INVEST mnemonic (see http://xp123.com/xplor/xp0308). Fix them if they’re not up to snuff.

Independent Your customer wants cool features now, not boring data inputscreens. Can you deliver? Yes! Each story is an independent, incremental need. You don’t need the “add” story yet. Life isn’t neat and orderly.

Negotiable A story is not a contract! It’s a promise for more communication. Don’t fill your story cards with every last detail.

Valuable Stories represent small bits of business value for your customer. Each implemented bit lets them see what you can deliver and provide feedback. Stories promising implementation of technical details (such as “build a database layer”) provide no visible business value—never create them!

Estimable A reasonable estimate might not exist if a story is too big or if you don’t know what’s involved. Go back to the drawing board.

Small Stories are small, many fitting into an iteration and none approaching the full iteration’s length. An ideal story would take your team a day to deliver.

Testable If you can’t verify a story in some manner, you’ll never know when it’s done! Tests are often the best way to flesh out your understanding of a story.


Google Java Standards

Just got this web site with the Google Java Standards.
Useful points:
  • Files are all in UTF-8
  • Braces always used: void method() {}
  • One statement per line: how many times have you seen someone a gigantic boolean condition all on one line?
  • Enums formatted as if an array (no methods or docs)
  • Testing caught exceptions can be ignored if, and named, "expected"
We can find issues with files not formatted correctly, especially when using a tool like Camel and Bean IO to convert files to Java objects.  Using the base UTF encoding, we keep characters that can hurt the code from causing issues.
Braces are important for visually defining connected elements of the code and for asserting logic.  It may be a couple key strokes  less to exclude them, but someone working on that code may incorrectly change the logic and behavior of the code because they did not see the connected operations.
One statement per line helps readability, debugging and can help to deter code smell.
return (x == y && x== z || x== a || x ==b )
Remember here that java works with order of operations as top to bottom.  A debugger will just error on the one line if there is an error, and as well, a Boolean condition that is nested in the line may make determining the overall outcome difficult.  By breaking the conditions into individual comparisons, the debugger can reveal if the logic is accurate and which statement is causing the logic to be true or false.  This might better, even more, refactored into other methods were the Boolean logic is more concise to one comparison rather than as a chain.
(x == y
&& x== z
|| x== a
|| x ==b)
Testing that causes exceptions should name the exception as "expected" helps testers understand what the test is trying to accomplish or asserting. Something is being thrown in order to prove that incorrect parameters or other bad condition is being attempted.
@Test(expected = Exception.class)
methodThatCausesException(){ //operation that causes exception}