Re: spambayes plugin, and other plugins

Ryan Barrett <pyblosxom-6sb6M7qyT/[email protected]>
Newsgroups gmane.comp.web.pyblosxom.devel
Message-ID <[email protected]>
On Thu, 6 Dec 2007, will wrote:

> Adding some unit test related tasks is a good idea.  I'll do that in the
> next round.  Some of the other projects have had tasks along the lines
> of "improve test coverage to xyz percent."  That'd help a lot.

cool, makes sense. i've also written a first pass at a unit testing wiki page 
for 2.0:

http://pyblosxom.sourceforge.net/wiki/index.php/Tests

for convenience, here's the full text:

==

Contents
     * 1 Tests
     * 2 Motivation
     * 3 State of the Union
     * 4 Framework
     * 5 Unit vs. Functional vs. Regression
     * 6 Discussion

Tests

Author: User:Ryan Ryan Barrett

Originally published: December 6, 2007


Motivation

Unit testing has been strongly praised as a software development practice, and has become widely adopted in both industry and open source.

When a project has a comprehensive set of tests, developers are less likely to break existing code inadvertently. This usually results in more contributions, fewer bugs, and higher confidence. (We've documented these trend in a number of projects at Google by measuring the number and quality of contributions before, during, and after they had full test suites.)


State of the Union

PyBlosxom currently has unit and functional tests for a few of its modules in the pyblosxom/test directory:

  unit/test_tools.py
  unit/test_callbacks.py
  unit/test_pathinfo.py
  functional/test_blog.py

This is nowhere near complete, though. Also, none of the plugins in the contrib pack have unit tests. We need to write more tests!


Framework

The tests currently use the nose test framework. The unit tests all follow the pattern of one class per test case, with _setup() and _teardown() methods. The functional test follows a different pattern, with top-level setupblog(), cleanupblog(), and test_harness() methods.

To run the tests, run:

  nosetests --verbose --include unit
  nosetests --verbose --include functional

The Python unittest module is much more common and widely adopted than nose. We could consider switching to that at some point. 
Unit vs. Functional vs. Regression

TODO(will): If you think it's worth addressing, consider filling in this section. Otherwise, we can delete it.


Discussion

Discussion of this proposal is at:

gmane.org
     http://article.gmane.org/gmane.comp.web.pyblosxom.devel/1981 
sf.net
     http://sourceforge.net/mailarchive/forum.php?forum_name=pyblosxom-devel

Retrieved from "http://pyblosxom.sourceforge.net/wiki/index.php/Tests"

Category: 2.0 Planning

-Ryan

--
http://snarfed.org/

-------------------------------------------------------------------------
SF.Net email is sponsored by: The Future of Linux Business White Paper
from Novell.  From the desktop to the data center, Linux is going
mainstream.  Let it simplify your IT future.
http://altfarm.mediaplex.com/ad/ck/8857-50307-18918-4
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.