0

In a project we are using BDD to write the specification. In a requirement user has to configure the system properly before being used.

  1. This configuration involves copying a secret key file between computer and a mobile device.
  2. On the launch of mobile app it will prompt the user to import the secret key file.
  3. Without doing the import user can not use the mobile application. Since, all future operations inside the mobile app will depend on the availability of secret key file.

My question is, will the following story be valid in BDD? -

Title:- Configure mobile application for first time use
Narrative:- 
            As a:- System, 
            I want:- to have the same secret key available on both the participating devices 
            So that:- I use the correct key to encrypt and decrypt text using symmetric encryption algorithm on the participating devices
Scenarios:- Scenario 1
            Given:- I have a secret key generated and available in the computer
            When:- I have finished installing the application in mobile device
            Then:- I expect the user to perform following steps - 
                   1. Copy the secret key file from the computer
                   2. Paste the secret key file in the mobile device where the application is installed
            Scenario 2
            Given:- I have a secret key generated and available in the computer
            When:- User cancelled the configuration step
            Then:- I should prompt the user with message - "App requires the secret key configuration to work!"

I have already read this post in SO Writing user stories for internal technical tasks where it is made clear that System can not be a role in the story. But for my scenario where the System expects the user to configure the application properly can I not use the role of System?

We did contemplate on the possibility of system moving the secret key by itself i.e. automatically to other devices. However, this was shot down for other technical reasons and customer did not want that to happen automatically.

Community
  • 1
  • 1
Siva Senthil
  • 610
  • 6
  • 22

2 Answers2

1

The purpose of the "As a... I want... so that..." template is mostly to stop people including things in releases that don't actually need to be there.

If you know who wants something, and why, you can just write that down:

We want the user to import the key so that their information is encrypted. Without the key the user can't use the app. The customer doesn't want this to happen automatically.

If you really need to retrofit the template from that, you can:

As the admins, we want the user to explictly import the secret key so that their information is encrypted.

Or however you talk about it. If you don't know why the customer is uncomfortable with it happening automatically, it might be good to find out. It's also OK to have more than one stakeholder and more than one goal that's being fulfilled.

Once you've got that, as a BDD scenario-writer, I would ask you, "Can you give me an example?" Can you give me an example of what a key looks like? How would you refer to a particular key? What does a typical user look like? Do they always import the key?

And now we can start coming up with scenarios for that:

Given Harry Happy has downloaded the App
When he launches it
Then it should prompt him to install key #1234.

Given Harry Happy has launched the app
When he chooses to install key #1234
Then it should take him to the home screen.

Given Prudence Paranoid has launched the app
When she chooses not to install key #1582
Then she should be told that the app requires this key installation and cannot be used
And the app should close.

I find it much easier when I start thinking about real users. Remember that the stakeholder benefiting from the scenario outcome doesn't have to be the user:

Given I have plenty of money
When I withdraw £20 from the ATM
Then the ATM should also debit my bank account by £20.

It's not for my benefit, and that's OK.

Community
  • 1
  • 1
Lunivore
  • 17,277
  • 4
  • 47
  • 92
0

As you said, the System expects the user to configure the application.

When you think of a scenario, you think from the user's perspective and as a result the user does something -> system responds with a change.

You execute the scenario as a user, the system does what you tell him to do.

Maybe you should write something like:
As a: admin user
I need to: configure the app
So that: secret key is available on both participating devices and the message is encrypted and the app can be used

The user will trigger what system does (moving the key).

Role > Do something > Bussiness value

lauda
  • 4,153
  • 2
  • 14
  • 28
  • for the last statement "The user will trigger what system does (moving the key)" it is the user who should copy and paste the key file. System expects the user will move the file from computer to mobile device. – Siva Senthil Sep 14 '16 at 12:37
  • you have used "I need to" instead of "I want to". Is that correct for drafting a story? – Siva Senthil Sep 14 '16 at 12:38
  • Depending on the focus i guess, if is on the business or the action. I want to configure the app in order to enable encryption (on the business) vs If i want encryption then I need to configure the app (on the configure). I think need sounds like you don't have an option, you need to do this; want sounds more like is optional.Just my opinion. Anyway you should write from a user's point of view. In some way both, need or want, are ok. – lauda Sep 14 '16 at 12:50