BDD Done Easy – The three types of data

There are three types of data that can appear on the output of a system. The three types of data are determined by the mechanism that is used to provide the data item.

The three types of data are:

  1. Data entered into the system from outside the system
  2. Data calculated in the system with data in the system
  3. Data created by processes in the system

machine-3039352_1920

To describe the three different data types, consider the following example report. Students are allowed to withdraw money from an account. A limit is applied to how much a student can withdraw each month. A student can choose to override the limit but any override needs to be approved by a responsible adult. This report shows those transactions that override the limit.

  • In order to identify whether appropriate limit breaches are being approved
  • As a Parent
  • I want to see transactions that breach the limit, along with the reason and the approver.

Screen Shot 2018-03-25 at 18.39.27

Data entered into the system from outside the system

Screen Shot 2018-03-25 at 18.39.51

In this example, the Student Name, Monthly Limit, Withdrawal Amount and reason to override the limit. All of these data items need to be enter either via a user interface or a system interface.

Values are either entered free format, or selected from a list of permitted values (The items in the list of permitted values are originally entered free format.

Data calculated in the system with data in the system

Screen Shot 2018-03-25 at 18.40.06

These are the values that are calculated within the system. In this example the balance and the % above limit. To indicate that these are calculated value, I prefix the name with “get”. Account.getBalance and Transaction.get%AboveLimit.

Account.getBalance(QueryDate) = Sum(Transaction.Amount) where transaction.date before QueryDate and after 1st Day of monthMonth

Transaction.Transaction.get%AboveLimit = ( Account.getBalance(Transaction.Date) – Account.Limit ) / Account.Limit )

Data created by processes in the system

Screen Shot 2018-03-25 at 18.40.23

These values are created by processes in the system. In this example, Date, Approved by and Approval Date. These values are all populated in a THEN in a GIVEN-WHEN-THEN statement. We start at the last step in the process which in this case is the approval.

  • THEN Approved by is set to the logged in user.
  • AND the Approval Date is set to the current Date & Time.
  • WHEN the withdrawal is approved
  • GIVEN the approval screen is displayed
  • AND a withdrawal above the limit is on the screen
  • AND the user is logged on
  • AND the user is an approver for the Account

Similarly (and ignoring the approval e:mail steps in between)

  • THEN the Date is set to the current Date & Time
  • AND an approval is sent to list of users who are approvers for the account.
  • WHEN the student overrides the limit
  • GIVEN the student is on the limit override screen

Understanding the three types of data means you ensure the correct approach for populating them is adopted.

This blog post was inpired by a conversation with Rekha Kusumanchi about the Cotswold Way. My thanks to Rekha.

About theitriskmanager

Currently an “engineering performance coach” because “transformation” and “Agile” are now toxic. In the past, “Transformation lead”, “Agile Coach”, “Programme Manager”, “Project Manager”, “Business Analyst”, and “Developer”. Did some stuff with the Agile Community. Put the “Given” into “Given-When-Then”. Discovered “Real Options” View all posts by theitriskmanager

One response to “BDD Done Easy – The three types of data

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s

%d bloggers like this: