Executable specifiaction
-
Upload
uergo-ringo -
Category
Technology
-
view
936 -
download
1
Transcript of Executable specifiaction
Executable Specification
rgo Ringo
Idea
Tests == Examples == Spec
Collaboration
Living documentation
Automation
Level of Automation
Tools
Concordion
Cucumber
easyb
GreenPepper
jBehave
Automation layers
Specification in jBehave
Scenario: new entry is added
Given that Urgo published new entry "Hello World" in his blogWhen aggregator runsThen aggregated blog contains 1 entry with title "Hello World"
Scenario: user without Confluence account has his full name as author
Given that user with author name urgo.ringo does not have Confluence account and he published new entry "Hello World" in his blogWhen aggregator runsThen aggregated blog contains entry "Hello World" with author "Urgo Ringo"
Scenario: user with Confluence account has his username as author
Given that Urgo has Confluence account with username urgo.ringo and he published new entry "Hello World" in his blogWhen aggregator runsThen it contains entry "Hello World" with author linked to Confluence account with username urgo.ringo
Steps
public class AddNewEntrySteps {
...
@BeforeScenario public void setup() { feed = new SimpleSyndFeed();
plugin = new Confluence(currentDateProvider); plugin.registerBlogToAggregator(feed); }
... @AfterScenario public void reset() { plugin.uninstallAggregator(); }
}
@Given("that Urgo published new entry \"$title\" in his blog")public void newBlogEntryPublished(String title) { plugin.installAggregator("urgo.ringo"); publishNewBlogEntry(title);}
@When("aggregator runs")public void aggregatorRuns() { plugin.runAggregator();}
@Then("aggregated blog contains 1 entry with title \"$title\"")public void aggregatedBlogContainNewEntry(String title) { List entries = plugin.getAggregatedEntries();
assertEquals(1, entries.size()); assertEquals(title, entries.get(0).getTitle());}
Application runner
public class Confluence {
public void registerBlogToAggregator(SyndFeed feed) { ... }
public void uninstallAggregator() { ... }
public void installAggregator(String aggregatedAuthor) { ... }
public void createUserAccount(String username) { ... }
public void runAggregator() { ... }
public List getAggregatedEntries() { ... }
}
Verdict
Development cost
What is the problem?
Used pictureshttp://www.flickr.com/photos/shearwater/154210466/
urgoringo.wordpress.com
ignite.ee