DEV Community

Discussion on: Engineering guide to writing correct User Stories

Collapse
 
sobolevn profile image
Nikita Sobolev • Edited

You have to apply abstraction to merge several steps together. Or apply decomposition to separate them. Let me explain, please.

For example: you want to be notified when someone posts likes on your posts/images/etc. We all know and love this feeling. For this situation it does not really matter how did you create this content. You only write specs for the reaction part.

Feature: authors are notified about readers' reactions

Scenario: get notified of a new reaction
   When a reader reacts on author's content
   Then author gets a notification about it

Scenario: do not get notified about new reactions when notifications are disabled
   When author's notifications for reactions are disabled 
   And a reader reacts on author's content
   Then author gets no notification about it

This is a first feature: receiving notifications. Disabling the ability to react is a different feature. And should be specified as a different feature. Because notifications only make sense when readers are allowed to posts reactions. However, you can mention that all content for feature authors are notified about readers' reactions is allowed to be reacted on. You can use Background tag for that: relishapp.com/cucumber/cucumber/do...

I hope this helps you.

Collapse
 
finnhvman profile image
Bence Szabo

Thanks for the reply!

Then this implies to me that I might end up writing long Backgrounds.

Do you maybe know some mature open source projects where they're doing BDD the right way? I would love to analyze something in depth.

Thread Thread
 
sobolevn profile image
Nikita Sobolev

Nope, sorry :sad: