Book Image

Learning Behavior-driven development with Javascript

Book Image

Learning Behavior-driven development with Javascript

Overview of this book

Table of Contents (17 chapters)
Learning Behavior-driven Development with JavaScript
Credits
About the Author
About the Reviewers
www.PacktPub.com
Preface
Index

Writing features


The first thing we need to do is to identify the features on the ordering page. As we saw in the last chapter, there should be only one single user action in the system per feature.

A nice trick to extract features is to identify the main conceptual entities that the user is going to interact with. Then, we can simply discover the operations that the user can execute on each entity and write one feature per operation.

In the order subsystem, we will obviously have an Order entity. With this in mind, we can think of several features, such as the following ones:

  • Placing the order

  • Creating a new order

  • Adding some beverages to the order

  • Removing a beverage from the order

  • Changing the quantity of a beverage

Of course, each one of these actions is a different feature, but we are forgetting a very important one: displaying the order. After all, whenever the user visits the ordering page or refreshes it, they are simply performing an action against the server.

So, we actually have six features...