mardi 26 janvier 2016

What is the actual flow for developing a feature through testing with BDD?

-Scroll further down for the actual question-

Hello, this question is intended towards understanding best practices for developing your projects. I've looked through plenty of projects on Github and they all seem to create a test suite for a particular module. e.g

Project tree:

./lib/module_a.js
./lib/module_b.js
./tests/module_a.js
./tests/module_b.js

I have yet to come by someone performing a unit test by utilizing for instance mocha.js. Most if not all tests are of type integration or functional. To me it just seems like everyone is just doing stuff on a whim without following any actual models or following it but doing a pretty poorly job doing it.

I initially had the misconception that you make test suites for features only, and that you divide up your types of testing such as unit, integration and functional into separate test suites - but this does not seem to be the case at all.

Note: I do comprehend the concept of all the four tests as described in the following post: What's the difference between unit, functional, acceptance, and integration tests?

The Actual Question:

I would really like to know how one would go about developing a feature, through the following flow; by working your way through unit testing followed by integration testing, functional testing and optionally acceptance testing. How that would actually look like using something like mocha.js as a testing tool and by following the behaviour driven development model (BDD).

  • Don't forget to include the directory structure for deeper understanding of what's going on.

Bonus: if possible it would sure be great if you can also use the git flow model as described in this following page: http://ift.tt/mixx0f e.g 1) Creating your new project. 2) Adding the initial feature to that project through testing. 3) Releasing 0.1.0. 4) adding the second feature through testing 5) Releasing 0.2.0.

Ultra Bonus: Upload and share a a super small and simple example project on Github, giving us the aforementioned questions answered. (preferably with node.js and mocha.js)

P.S This is my first post on Stack Overflow and generally the only question I believe many people need answered including myself. Thanks in advance.

Aucun commentaire:

Enregistrer un commentaire