George,
On 6/18/18 8:00 AM, George Cover wrote:
> Thanks for replying George! Viewing the status of something is a bit of
> a weak feature, you're right. The system that's being built is a virtual
> desktop infrastructure project - 'room' is the name given to a set of
> resources that enable a 'whiteroom' situation with various machines,
> routers, etc. As you said, it's really a step in "Connecting my network
> to the room" feature...some of our features are probably written in a
> more test case style than specification, something we're learning as we
> go, and correcting where we can.
One of the difficulties of creating infrastructure or frameworks is the
lack of specificity. I find I do best if I create a thin client using
what I'm building, so that I can better visualize how it will be used.
Sometimes I do that as a demo client that can be shipped as
documentation. Sometimes that client is just part of the test code.
Usually it starts out in the test code and gets extracted when it has
value elsewhere.
>
> Probably a better feature we have is desktop session recordings. Anyone
> who can use a desktop will create a recording, however only certain
> roles have access to view them. For the sake of completeness we want to
> have specifications for how the system behaves when being accessed by
> those different roles - let's say for three roles, the recordings are
> available and for two roles they are not. Pursuing a 'complete' spec is
> where we end up with a "feature" that could be too small - View Recordings.
>
> We've discussed having multiple feature files inside a larger theme of
> "Session Recording" - due to the user story changing it's perspective
> (role to role), understanding that the mini-feature "View Recordings" is
> broken for one role, or many roles, has some attraction to some of our
> team. This was in contrast to a single step with a table (or multiple
> steps) saying "And a <role> can view the recording" inside the "Connect
> to Desktop" feature. This perceived nesting of features is causing a few
> discussions here.
What does "And a <role> can view the recording" mean? Does it mean they
can see that it exists? Or that they can play it back?
I would suggest a scenario for "Viewing recording is forbidden" and one
for "Viewing recording." Perhaps something like:
Scenario: Viewing recording
When a <role> requests to view a recording
Then the recording starts playing
Scenario: Viewing recording is forbidden
When a <role> requests to view a recording
Then the system refuses to play it
This expresses that the recording actually cannot be played. This is
more powerful than checking that it's not listed in a list of
recordings, as it provides protection in the event of an emailed URL or
other action bypassing the GUI.
If you want to check specific presentation information in the GUI, you
can do that. This is a slippery slope, however. I would rather unit-test
the GUI code for that rather than treat it as system behavior.
(Side note: While I'm not as anti-scenario outline as Andrew, I do
suggest writing and implementing a bare scenario first before converting
it to an outline. You'll get much more natural expression that way, and
sometimes will find you don't need to resort to an outline.)
For recording, something simple can suffice:
Scenario: Making a recording
When a least_privileged_role records a session
Then a session recording is created
>
> And now I've wound myself all the way back to "View Recordings" which is
> probably just as weak a 'feature' as "View Room Status" :)
>
> In summary, I think I have two problems in breaking down
> stories/features/scenarios:
> - How to 'layer' functionality throughout the system. We introduce
> notifications about certain actions - does that become a step in a whole
> bunch of scenarios, does it warrant it's own feature? Does that change
> if we can enable/disable notifications?
I would treat notifications as a feature of its own. Test scenarios
where notification happens successfully and where it fails or isn't
permitted. Don't try to be comprehensive in testing all permutations
through Cucumber. If you want that, consolidate the functionality for
those permutations into one method and unit-test that method.
> - How to represent multiple roles being able to carry out the same
> behavior. What features/scenarios would we write for a venn diagram of
> roles versus read/write capability?
>
> Thinking about that last statement of read/write makes me think our
> features might be too closely aligned with CRUD...perhaps they are too
> much like test cases rather than specifications (however I also think
> the two are very closely related).
I think a problem arises when you try to make your specification
examples as complete and detailed as the system you're building.
Especially if you're trying to test it all through the GUI. The
scenarios should provide examples of the intended behavior, not check
all permutations. If you need to check permutations, check that at as
low a level as possible. You CAN do it that with gherkin, but if you do
it using unit tests in the same language as the implementation, it will
be much easier to refactor and keep up to date as the system changes.
- George