Testing and Coverage

“An application without tests, is a dead-born application.”
Someone very serious

Writing tests is important, maybe more important than coding.

And this for a lot of reasons, but I’m not here to convince you about the benefits of software testing, some prophets will do it better than me.

Of course Zinnia is tested using the unittest approach. All the tests belong in the directory zinnia/tests/.

Launching the test suite

If you have run the buildout script bundled in Zinnia, the tests are run under nose by launching this command:

$ ./bin/test

But the tests can also be launched within a Django project with the default test runner:

$ django-admin.py test zinnia --settings=zinnia.testsettings

Using the ./bin/test script is usefull when you develop because the tests are calibrated to run fast, but testing Zinnia within a Django project even if it’s slow, can prevent some integration issues.

If you want to make some speed optimizations or compare with your tests results, you can check the actual execution time of the tests at this URL:

http://django-blog-zinnia.com/documentation/xunit/

Coverage

Despite my best efforts, some functionnalities are not yet tested, that’s why I need your help !

As I write these lines the 127 tests in Zinnia cover 96% of the code bundled in Zinnia. A real effort has been made to obtain this percentage, for ensuring the quality of the code.

I know that a coverage percent does not represent the quality of the tests, but maintaining or increasing this percentage ensures the quality of Zinnia and his future evolutions.

You can check the actual coverage percent at this URL:

http://django-blog-zinnia.com/documentation/coverage/

I hope that you will write some tests and find some bugs. :)

Project Versions

Table Of Contents

Previous topic

Buildout

Next topic

List of settings

This Page