Note that there are some explanatory texts on larger screens.

plurals
  1. POIs BDD really applicable at the UI layer?
    primarykey
    data
    text
    <p>BDD is an <strong>"outside-in"</strong> methodology, which as I understand it, means you start with what you know. You write your stories and scenarios, and then implement the outermost domain objects, moving "inwards" and "deliberately" discovering collaborators as you go--down through service layers, domain layers, etc. For a collaborator that doesn't exist yet, you mock it (or "fake it") until you make it. (I'm stealing some of these terms straight from Dan North and Kent Beck).</p> <p>So, how does a UI fit into this?</p> <p>Borrowing from one of North's <a href="http://dannorth.net/2011/01/31/whose-domain-is-it-anyway/" rel="nofollow noreferrer">blog entries</a>, he rewrites this:</p> <pre><code>Given an unauthenticated user When the user tries to navigate to the welcome page Then they should be redirected to the login page When the user enters a valid name in the Name field And the user enters the corresponding password in the Password field And the user presses the Login button Then they should be directed to the welcome page </code></pre> <p>into this:</p> <pre><code>Given an unauthenticated user When the user tries to access a restricted asset Then they should be directed to a login page When the user submits valid credentials Then they should be redirected back to the restricted content </code></pre> <p>He does this to eliminate language from non-relevant domains, one of which is the UI (<em>"Name field", "Password field", "Login button"</em>). Now the UI can change and the story (or rather, the story's <em>intent</em>) doesn't break.</p> <p>So when I write the implementation for this story, do I use the UI or not? Is it better to fire up a browser and execute "the user submits valid credentials" via a Selenium test, or to connect to the underlying implementation directly (such as an authentication service)? BTW, I'm using <a href="http://jbehave.org/" rel="nofollow noreferrer">jBehave</a> as my BDD framework, but it could just as easily be Cucumber, rSpec, or a number of others.</p> <p>I tend not to test UI in an automated fashion, and I'm cautious of GUI automation tools like Selenium because I think the tests (1) can be overly brittle and (2) get run where the cost of execution is the greatest. So my inclination is to manually test the UI for aesthetics and usability and leave the business logic to lower, more easily automatible layers. (And possibly layers less likely to change.)</p> <p>But I'm open to being converted on this. So, is BDD for UI or not?</p> <p>PS. I have read all the posts on SO I could find on this topic, and none really address my question. <a href="https://stackoverflow.com/questions/7899731/should-your-bdd-specifications-be-separated-from-your-ui-tests">This one</a> gets closest, but I'm not talking about separating the UI into a separate story; rather, I'm talking about ignoring it entirely for the purposes of BDD.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload