1

We using Behaviour Driven Development to develop a SOA system using Scrum and have come across two approaches to producing the stories.

Approach 1
    Given Specific Message Type is available
    And Specific State exists
    When the Message is processed
    Then expected resulting state exists

Approach 2
    Given a Specific state exists
    When Specific Message Type is processed
    Then expected resulting state exists

Few if any of the examples available are applied to testing SOA systems. I would appreciate any experiences of these or any insights on the consequences of each approach.

We are aiming for declarative rather than imperative stories. The message arrival in the first has a slightly imperative feel but I'm not confident the second approach covers acceptance criteria adequately, because it doesn't seem to account for the event driven nature of the SUT.

Martin Spamer
  • 5,437
  • 28
  • 44
  • 4
    I'm voting to close this question as off-topic because [project management is now off-topic on Stack Overflow](//meta.stackoverflow.com/questions/343829/is-stack-overflow-an-appropriate-website-to-ask-about-project-management-issues/343841#343841). Ask these questions on [SoftwareEngineering.SE](//softwareengineering.stackexchange.com/) and [ProjectManagement.SE](//pm.stackexchange.com/) instead. (Unfortunately, this question is too old to be migrated.) – robinCTS Oct 29 '17 at 17:58
  • 1
    The reasons for closing this question are nonsense. This question has nothing to do with project management. BDD & TDD are clearly inscope give tags exist for these topics. – Martin Spamer May 10 '18 at 20:51
  • 1
    Just because certain tags exist and are used correctly in a question doesn't automatically make the question in-scope ;-) Re-reading the question, though, I think I would have to agree with you that it is not about project management (it is only vaguely indirectly related to it), and *"not … about programming within the scope defined in the help center"* is not a valid close reason. And while it does border on being too subjective, I don't think it *quite* qualifies for off-topic as "***primarily*** opinion-based". I'm voting to reopen. – robinCTS May 11 '18 at 05:11
  • 1
    @robinCTS ... and the the presence of certain tags doesn't automatically make the questions out of scope. :) Thanks for fair consideration. I've also reworded it to try and further reduce any opinion basis and move towards drawing on experiences. AIH the question was asked a long time ago and no longer applies to myself. Imperative vs declarative BDD an increasingly hot topic. – Martin Spamer May 11 '18 at 09:59

2 Answers2

3

The aim of the story is to communicate with your customer, so whatever style promotes that goal is best - and that will vary from one team to another. I might prefer 'when some business event occurs' rather than your suggestions, but I don't know your team! Beware of trying to find a 'one-size-fits-all' template, use whatever communicates best for each situation. And the heart of agile is the ability to adapt - try one style and feel free to adapt if it doesn't seem to be working.

Mike Stockdale
  • 5,256
  • 3
  • 29
  • 33
1

Whenever I'm producing a library or service, I often find it useful to provide an example of the kind of scenario which a service user might want. So for instance:

Given the server has information about risk limits for Lieumoney Brothers
And we are $2m from those limits
When we process EOD orders that take us to $1m for those limits
Then our status with Lieumoney Brothers should be Amber.

The actual contents of the message can then reflect the interaction with those particular sums and that particular counterparty. You can use this for lots of different domains, and your approach will depend on the domain and whether the availability of a message is unusual, for that domain. In the above example where you're trading millions then having risk information for a particular counterparty might be valuable, and if that's the state, it's worth calling out separately. It's probably less important if you're buying baby rabbits, for example.

Given "Rotweiller Pets Limited" is trading baby rabbits $2 cheaper than anyone else
When we ask the system to order 15 baby rabbits
Then it should place an order with "Rotweiller Pets Limited".

It's hard to discuss this without specific examples. However, you can probably see how providing those scenarios would then act as documentation for how to use your APIs, even if the underlying automation for those scenarios talks directly to the API, and has nothing actually specific for pets or Lieumoney trades.

Lunivore
  • 17,277
  • 4
  • 47
  • 92