Skip to content

Commit

Permalink
Merge branch 'master' of github.com:scikit-learn/scikit-learn
Browse files Browse the repository at this point in the history
  • Loading branch information
GaelVaroquaux committed Jul 26, 2012
2 parents b5519f0 + 01cf172 commit 6de8466
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions doc/developers/index.rst
Expand Up @@ -150,6 +150,8 @@ You can also check for common programming errors with the following tools:
$ pip install nose coverage
$ nosetests --with-coverage path/to/tests_for_package

see also :ref:`testing`

* No pyflakes warnings, check with::

$ pip install pyflakes
Expand Down Expand Up @@ -224,6 +226,39 @@ it.
slightly differently. To get the best results, you should use version
1.0.

.. _testing:

Testing and improving test coverage
------------------------------------

High-quality `unit testing <http://en.wikipedia.org/wiki/Unit_testing>`_
is a corner-stone of the sciki-learn development process. For this
purpose, we use the `nose <http://nose.readthedocs.org/en/latest/>`_
package. The tests are functions appropriately names, located in `tests`
subdirectories, that check the validity of the algorithms and the
different options of the code.

The full scikit-learn tests can be run using 'make' in the root folder.
Alternatively, running 'nosetests' in a folder will run all the tests of
the corresponding subpackages.

We expect code coverage of new features to be at least around 90%.

.. note:: **Workflow to improve test coverage**

To test code coverage, you need to install the `coverage
<http://pypi.python.org/pypi/coverage>`_ package in addition to nose.

1. Run 'make test-coverage'. The output lists for each file the line
numbers that are not tested.

2. Find a low hanging fruit, looking at which lines are not tested,
write or adapt a test specifically for these lines.

3. Loop.



Developers web site
-------------------

Expand Down

0 comments on commit 6de8466

Please sign in to comment.