Note that there are some explanatory texts on larger screens.

plurals
  1. POWhen and how much should I test third-party code integration when practicing behavior driven development (BDD)?
    primarykey
    data
    text
    <p><strong>Context:</strong> I am trying to practice BDD in a Ruby on Rails environment using Capybara/Steak for integration tests, so that will be the example I use, but this question is a general question about BDD best practices.</p> <p>Say I have an (admittedly broad) user story like so:</p> <pre><code>Feature: As an administrator I should be able to manage my products </code></pre> <p>I have been looking at the <code>ActiveAdmin</code> gem for Rails 3, which allows you to create sophisticated admin interfaces using a simple DSL. While the time-saving potential is huge, it also scares me to off-load so much functionality to third-party code without testing at all.</p> <p>However, I've been taught that you generally only need to test code that you write yourself. So, by that logic, I just need to test that <code>ActiveAdmin</code> is integrated properly, since that's the only code I'm actually writing. A basic scenario to test this might be:</p> <pre><code>Scenario: Given I have 20 products When I visit the product index page Then I should see 20 products. </code></pre> <p>This is a function offered by <code>ActiveAdmin</code> out of the box. So I could do the basic installation and create the Products Admin page using <code>ActiveAdmin</code>'s documentation, and the scenario will pass.</p> <p>Of course, then I have also integrated a massive number of other scenarios, such as:</p> <pre><code>Given I have 20 products And my products include Apples, Bananas, and Berries When I sort my products by name Then Apples, Bananas and Berries should be on the first page in that order. Given I have 20 products And my products include Apples, Bananas, and Berries When I type 'ap' into the Filter by Name field Then I should see "Apples" And I should not see "Bananas" </code></pre> <p>etc. etc.</p> <p>Presumably though, these have already been tested by <code>ActiveAdmin</code> and so I shouldn't need to test them again, even though they are critical to my application. So I guess I'm done, and can move on to another feature(?).</p> <p><strong>TL;DR</strong>: My basic question is, <strong>should I be writing scenarios for critical functionality like sorting and filtering, even if they are already provided by an external library and I have tested my application's integration with that library?</strong></p>
    singulars
    1. This table or related slice is empty.
    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.
    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