Writing the First Cucumber Feature
I’m currently working on my first BDD project, but after reading through the Cucumber wiki for what felt like the 100th time I was still not sure where to start. I tried generating a boilerplate feature file as the documentation suggests (even though the documentation then tries to dissuade you from taking that approach in the next paragraph), but the generated file didn’t really provide much guidance so I was back to square one. Finally I started asking for advice on the freenode #cucumber channel. It seemed like a shot in the dark, knowing that every project is different and there isn’t really a single pattern that would work for everyone. The initial responses were less than illuminating, but after a few short minutes someone offered the following advice:
msassak: auth features are not very valuable, imo msassak: you need to do them, but i would implement almost anything first msassak: err anything else cbloom: So assume every user is registered for now. Then start hiding stuff after the other features are complete? msassak: that's what i would do cbloom: OK, that makes a lot of sense. msassak: imagine you are going to present this to someone who is going to pay you for it msassak: do they want to see that users can log in, or that users can do something cool on the site? cbloom: they want to see that users can print coupons cbloom: so I'll start with that msassak: yup, exactly cbloom: so simple, yet so abstract
It seems so simple now. Now to see if that actually cures my writers block.