Knowing why Features are executable specifications
So far, we've created a Feature that captures our system's Author uploads profile picture behavior. Our Feature is the one and only source of truth for our development team. They can now take this Feature and write and deploy code that implements the behaviors specified in our Feature
. But how do we know that the code that our developers will deliver actually makes the system behave as specified? Well, there's an easy way to find out: we write some step definitions for our Scenario
steps. A step definition is simply some code that executes the behavior specified in a step. So, in our sample Feature
, we have a Background
that states the following:
Background: Given the user is logged in as an Author And the Author goes to their Profile page And the Author chooses to upload a picture And the Author selects an image file from their computer
We then write some code, in our programming language of choice, which sets...