« Table of Contents »
Previous « Thoughts On Gauge
The Behaviour Specification Handbook
Behaviour Specifications
Feature Files
A Feature file contains the Behaviour Specifications for a logical grouping of related functionality. I recommend having one feature file for each different software component involved in the same logical grouping of functionality.
File-System Folder Structure
I recommend grouping various feature files as appropriate into different file-system folders that follow a logical hierarchy. Each top-level of the hierarchy could be the name of an architectural capability, domain or whatever similar high-level grouping mechanism or category that makes sense.
Sub-folders can be used for other mid-level logical groupings of behaviour. The names of the sub-folders should include a verb, as after all, we are describing categories of behaviours, and behaviours are described with verbs. The sub-folder’s name could describe the set of processes, actions, behaviours and activities that take place, and always should be in business language — not implementation or system-specific language.
The feature files should exist within the lowest-level sub-folders.
Below is an example of the recommended folder structure:
1Purchasing (top-level folder, also a known business capability)
2|
3|---- ProcessingOrders (mid-level sub-folder, a general category of behaviours)
4 |
5 |---- Shopping (low-level sub-folder, a general category of behaviours)
6 |---- ManageShoppingCart.feature
7 |---- CalculateShippingCosts.feature
8 |---- ProcessPayments.feature
9 |---- PlaceOrder.feature
10 |
11 |---- FulfillingOrders (low-level sub-folder, a general category of behaviours)
12 |---- PickOrderItems.feature
13 |---- ShipOrderItems.feature
Source Control Branches
Different software components may live in different code branches or projects within your source control repository. The feature files for a given software component should live in the same code branch as its component. For consistency reasons, it is helpful for the benefit of the entire team to try to keep the same folder structure for feature files across the various software components, where it makes sense.
I also highly recommend not having white-space characters in a folder or feature file name, as this can cause problems depending on the technology platform or development tools you are using.