tags:

views:

38

answers:

2

I'm just starting with BDD and I'm trying to build a small app, so I can see it working in a real environment, but I'm having trouble deciding what should be a feature. I'm building a tiny shop.

I decided that "Compare products" will be a feature and "User can checkout as guest" will be one, but to get to that, I first need to list products.

My question is, should "There should be a list of products" be a feature?

Thanks!

+1  A: 

It should probably be a feature, but try wording it from a user's point of view. What does this list of product offer him?

  • User should be able to get an overview of offered products
  • User should be able to order and reorder products on name, price, availability.
Konerak
A: 

It's pretty hard to begin doing BDD. The only thing that helps feeling confident in your abilities and the whole approach is to write test scenarios and the code that executes them. I would suggest you not to make already complex and confusing situation harder. Pick whatever task that you need to implement, open a blank text file and try to explain using simple sentences the behavior. Every sentence should start with one of three keywords: given, when and then. Using your favorite BDD framework write the code that will parse these sentences and stimulate the application to get into the start state (given), execute some commands (when) and assert the transitioned state (then). Application code may start from mere mocks. Replace gradually those mocks with gradually built code and grow your application with higher confidence and quality levels.

Boris Pavlović