Skip to content

Commit 6de8466

Browse files
committed
Merge branch 'master' of github.com:scikit-learn/scikit-learn
2 parents b5519f0 + 01cf172 commit 6de8466

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

doc/developers/index.rst

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,8 @@ You can also check for common programming errors with the following tools:
150150
$ pip install nose coverage
151151
$ nosetests --with-coverage path/to/tests_for_package
152152

153+
see also :ref:`testing`
154+
153155
* No pyflakes warnings, check with::
154156

155157
$ pip install pyflakes
@@ -224,6 +226,39 @@ it.
224226
slightly differently. To get the best results, you should use version
225227
1.0.
226228

229+
.. _testing:
230+
231+
Testing and improving test coverage
232+
------------------------------------
233+
234+
High-quality `unit testing <http://en.wikipedia.org/wiki/Unit_testing>`_
235+
is a corner-stone of the sciki-learn development process. For this
236+
purpose, we use the `nose <http://nose.readthedocs.org/en/latest/>`_
237+
package. The tests are functions appropriately names, located in `tests`
238+
subdirectories, that check the validity of the algorithms and the
239+
different options of the code.
240+
241+
The full scikit-learn tests can be run using 'make' in the root folder.
242+
Alternatively, running 'nosetests' in a folder will run all the tests of
243+
the corresponding subpackages.
244+
245+
We expect code coverage of new features to be at least around 90%.
246+
247+
.. note:: **Workflow to improve test coverage**
248+
249+
To test code coverage, you need to install the `coverage
250+
<http://pypi.python.org/pypi/coverage>`_ package in addition to nose.
251+
252+
1. Run 'make test-coverage'. The output lists for each file the line
253+
numbers that are not tested.
254+
255+
2. Find a low hanging fruit, looking at which lines are not tested,
256+
write or adapt a test specifically for these lines.
257+
258+
3. Loop.
259+
260+
261+
227262
Developers web site
228263
-------------------
229264

0 commit comments

Comments
 (0)