Loading ...
Sorry, an error occurred while loading the content.
 

Generating user guides from acceptance tests... an idea...

Expand Messages
  • Antony Marcano
    Maybe it s been done... but maybe my ideas add something to the mix... You decide... Have a read of this... http://www.testingreflections.com/node/view/8186
    Message 1 of 1 , Jul 18, 2009
      Maybe it's been done... but maybe my ideas add something to the mix...

      You decide...

      Have a read of this...
      http://www.testingreflections.com/node/view/8186

      Below are some excerpts... but perhaps best to read the blog post.

      All feedback welcome.

      Antony Marcano
      blog: http://antonymarcano.com/blog
      twitter: http://antonymarcano.com/twitter

      Watch Test-Driven Development, refactoring, acceptance-test-driven
      development´┐Żlive or recorded at http://pairwith.us

      Excerpts:

      Example of a JNarrate Specification (using a certain wiki as the
      target of the example):
      (still a work in progress)

      public class EditAPageStory extends AbstractExampleStory {
      /*
      * As a Web User
      * I want to be able to change the content of the wiki page
      * So that I can communicate my own information to other readers
      */

      @Test public void shouldBeAbleToEditAPage() {

      Given
      .thatThe(wiki).wasAbleTo(beAtThe(PointWhereItHasBeen.JUST_INSTALLED));
      And.thatThe(user).wasAbleTo(navigateToTheHomePage());

      When.the(user).attemptsTo(changeTheContent().to("Welcome to
      Acceptance Test Driven Development"));

      Then.the(textOnTheScreen().ofThe(user)).shouldBe("Welcome to
      Acceptance Test Driven Development");
      }
      }

      So, the specification tells you what it does... but how does someone
      use the wiki to, say, change the content?

      public class ChangeTheContent extends AbstractActionForAWebUser {

      private String newContent;

      public void perform() {
      you.need(To.doTheFollowing(
      Click.onThe(OptionsMenu.EDIT_BUTTON),
      ClearTheContent.OfThe(Editor.CONTENT_PANEL),
      Type.theText(newContent).intoThe(Editor.CONTENT_PANEL),
      Click.onThe(Editor.SAVE_BUTTON)
      ));
      }

      public static ChangeTheContent changeTheContent() {
      return new ChangeTheContent();
      }

      public PerformableAsA<WebUser> to(String newContent) {
      this.newContent = newContent;
      return this;
      }
      }

      Let's zoom in on the perform() method in the ChangeTheContent class:

      public void perform() {
      you.need(To.doTheFollowing(
      Click.onThe(OptionsMenu.EDIT_BUTTON),
      ClearTheContent.OfThe(Editor.CONTENT_PANEL),
      Type.theText(newContent).intoThe(Editor.CONTENT_PANEL),
      Click.onThe(Editor.SAVE_BUTTON)
      ));
      }

      It shouldn't take much to get from that code to generate the user guide:

      To Change The Content you need to do the following:

      * Click on the Options Menu Edit Button
      * Clear the content of the Editor Content Panel
      * Type the new content into the Editor Content Panel
      * Click on the Editor Save Button

      I'm not there yet - but once I've done that, I'll let you know ;-)

      Just thought I'd throw the idea out there.

      [Non-text portions of this message have been removed]
    Your message has been successfully submitted and would be delivered to recipients shortly.