Skip to content

Commit

Permalink
Update contribution testing section
Browse files Browse the repository at this point in the history
  • Loading branch information
Orlando Hohmeier committed Jan 26, 2016
1 parent 93e09e3 commit 6157c98
Showing 1 changed file with 16 additions and 9 deletions.
25 changes: 16 additions & 9 deletions CONTRIBUTING.md
Expand Up @@ -119,16 +119,23 @@ Before you submit your pull request consider the following guidelines:

That's it! Thank you for your contribution!

#### <a name="testing"></a> Testing approach
#### <a name="testing"></a> Testing

Use the [BDD style](http://guide.agilealliance.org/guide/bdd.html) of testing.
Tests should be organised around scenarios rather than rigidly around class
structure and method names, for example "Creating an application" rather than
Test are organised around scenarios ([BDD style](http://guide.agilealliance.org/guide/bdd.html)) and/or single units ([Unit Tests](http://guide.agilealliance.org/guide/unittest.html)) of work. In the best case we have unit test to verify that every single unit is working as expected and scenarios to ensure that they all play well together.

Keep all tests short, clean, and descriptive. Aim for high code coverage, but don't
worry about achieving 100%. Try to keep tests flexible. Test the
interface, not the implementation. Make sure that tests can be run in any order and
that tests consistently return the same result. No random numbers and such. Aim to ensure that tests run quickly to keep the feedback loop tight.

##### Units

Unit tests should only test a single unit of work, therefor any dependency should be mocked or stubbed.

##### Scenarios

These tests should be organised around scenarios rather than rigidly around class
structure and method names, for example "create application" rather than
"Application#initialize". Test for correct error handling as well as correct
behaviour. Mock where necessary, but not as a matter of course.

Keep tests short, clean, and descriptive. Aim for high code coverage, but don't
worry about achieving 100% coverage. Try to keep tests flexible. Test the
interface, not the implementation.

Aim to ensure that tests run quickly to keep the feedback loop tight.

0 comments on commit 6157c98

Please sign in to comment.