Loading ...
Sorry, an error occurred while loading the content.

159123Testing a web-stack (angular+REST), From: [XP] TDD and kinds of test

Expand Messages
  • Jonas Andersson
    Apr 4, 2014
    • 0 Attachment

      Done that mistake as well :) First and only time so far that we've had to drop a complete testing suite. :/

      A stack with Angular + REST looks great from the perspective that you can test the back-end and front-end separately. 

      In theory:
      Use TDD+BDD on backend, including REST-API-tests.
      Use TDD+BDD on front-end, using REST-mocking.

      Anyone tried this? If so, was it productive?

      // Jonas


      On 3 April 2014 23:06, Phlip <phlip2005@...> wrote:
       

      > In practice ATDD and BDD ..

      Just a note here - another HUGE industry fallacy, repeated at all
      levels, is that BDD, for "functional testing", mean "integration tests
      using klutzy screen-driver AND a declarative language that even
      consultants can read & write."

      Put another way, junior Rails programmers by the truckload these days
      are taught -

      - tdd the model with the unit test folder, and call it BDD bc we test
      with RSpec

      - tdd the controllers & not the view with the functional test folder,
      with template rendering turned off

      - tdd the HTML or JS, even at the trivial level of "what color tag do
      we template in?" using ONLY
      * Cucumber BDD runner, using ...
      * Gherkhin notation, driving ...
      * Capybara (a webrat offspring), running Selenium on your Chrome
      browser!, plugged into ...
      * a real HTTP server, running your Rails app in a 4th
      environment, operating on ...
      * a complete batch of data records copied in each time, using ...
      * a ton of mocks for everything that "just stopped working bc we
      added that feature & didn't want to add it to the test", AND ...
      * a couple of ridiculous hack gems that keep your test VM in
      memory forever so it's not so incredibly slow.

      A more fragile stack could not be imagined. Oh, yeah, and it's all
      open source, getting out of sync with each other every season or so.

      (the correct way to test HTML views, btw, is render their templates &
      test most of the view using assert_xpath, and yes I'm obviously
      recovering from an experience, here...)

      All of that teaching is wrong, false, the opposite of true, and only
      damages the BDD movement. Good luck getting rid of that stupid meme
      because it's unbelievably damaging, and entirely tempting using
      today's tools!!


    • Show all 3 messages in this topic