-
-
Notifications
You must be signed in to change notification settings - Fork 523
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add a section to explain declarative vs imperative style (Fixes #323) #429
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lisacrispin - I really love this explanation; I think it captures pretty well what we try to say to users.
A few (minor) comments below.
In addition, some suggestions:
- let's see if we can make the wording a little more concise?
- I'd like to add something about imperative steps providing too much detail, making it hard to see what the exact behaviour is that a particular scenario is trying to illustrate. As is decribed in this article
Thanks for taking the time to help out!
…the idea of "pushing the 'how' down"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hi @lisacrispin - I really love this change! Some minor additional suggestions, mainly for consistency with the rest of the docs. (for example, replacing "tests" with "scenarios").
If you agree with my suggested changes, you should be able to click the "commit suggestion" button below each comment and that will automatically apply the suggestion as a commit.
content/docs/bdd/better-gherkin.md
Outdated
|
||
# Consider a more declarative style | ||
|
||
One way to make tests easier to maintain and less brittle is to use a declarative style. Declarative style describes the behaviour of the application, rather than the implementation details. Declarative tests read better as "living documentation". A declarative style helps you focus on the value that the customer is getting, rather than the keystrokes they will use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
One way to make tests easier to maintain and less brittle is to use a declarative style. Declarative style describes the behaviour of the application, rather than the implementation details. Declarative tests read better as "living documentation". A declarative style helps you focus on the value that the customer is getting, rather than the keystrokes they will use. | |
One way to make scenarios easier to maintain and less brittle is to use a declarative style. Declarative style describes the behaviour of the application, rather than the implementation details. Declarative tests read better as "living documentation". A declarative style helps you focus on the value that the customer is getting, rather than the keystrokes they will use. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done.
content/docs/bdd/better-gherkin.md
Outdated
|
||
One way to make tests easier to maintain and less brittle is to use a declarative style. Declarative style describes the behaviour of the application, rather than the implementation details. Declarative tests read better as "living documentation". A declarative style helps you focus on the value that the customer is getting, rather than the keystrokes they will use. | ||
|
||
Imperative tests are communicative, and in some contexts, this style of test is appropriate. On the other hand, because they are so closely tied to the mechanics of the current UI, they often require more work to maintain. Any time the implementation changes, the tests need to be updated too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Imperative tests are communicative, and in some contexts, this style of test is appropriate. On the other hand, because they are so closely tied to the mechanics of the current UI, they often require more work to maintain. Any time the implementation changes, the tests need to be updated too. | |
Imperative tests communicate details, and in some contexts, this style of test is appropriate. On the other hand, because they are so closely tied to the mechanics of the current UI, they often require more work to maintain. Any time the implementation changes, the tests need to be updated too. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done. Why does the 'and' show up in red there? Is that something I need to change also?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I don't know. You can ignore it
content/docs/bdd/better-gherkin.md
Outdated
|
||
Imperative tests are communicative, and in some contexts, this style of test is appropriate. On the other hand, because they are so closely tied to the mechanics of the current UI, they often require more work to maintain. Any time the implementation changes, the tests need to be updated too. | ||
|
||
Here's a more imperative style: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Here's a more imperative style: | |
Here's an example of a feature in an imperative style: |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Done, and next one I will try to do the "commit changes" thing in the dropdown. Doh.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Learn something new every day ;)
…es via GitHub review comments.
Co-Authored-By: Marit van Dijk <mlvandijk@gmail.com>
Co-Authored-By: Marit van Dijk <mlvandijk@gmail.com>
Co-Authored-By: Marit van Dijk <mlvandijk@gmail.com>
Co-Authored-By: Marit van Dijk <mlvandijk@gmail.com>
Co-Authored-By: Marit van Dijk <mlvandijk@gmail.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Great content! Thanks @lisacrispin
Working on fixing #323