News about my FOSS projects

Thursday, September 24, 2009

More than 300 downloads for dutest module

Download dutest module

¿Have you ever noticed how fast children become men and women? Of course you have ! And I consider that my FOSS projects are just like my children. Their goal is that everybody be able to be more efficient and happy. Hence I wanted to share with you this glorious moment: users have downloaded dutest more than 300 times. Isn't it wonderful ? I know, I know ... I have only written a very concise article about that minimalistic framework. That's why I plan to write a more tutorial entries about it as soon as I can.

Well you know this is a very brief entry, this doesn't means that it's not important, but instead that I have no free time at all :(. I just want to share my happiness with you, and thank all those who tried it out and use it.

Before the end I invite you all to visit Simelo's projects site and the FLiOOPS project site, so that you can learn a little more about all my projects. I hope you like them and wish to be back to you soon, here in Simelo's blog.

Tuesday, September 8, 2009

More than 100 downloads for dutest module

December 24th 2008 I realized that dutest module reached 100 downloads from PyPI. This unexpected news, inspired me to write mini-tutorial entries in order to explain how to use it under different circumstances. In those articles you will be able to discover all the cool features it supports in order to enhance the integration between the two standard testing frameworks written for Python. This is just the beginning ...

¿What is dutest?

Tha main goal of this module is to take advantages offered by both unittest and doctest. The former is implementation of the XUnit paradigm. Thus it has a lot of brothers (e.g. JUnit, SUnit ... and, if I continue I'd have to mention more than 50 implementations written for different programming languages and frameworks. So much success is the result of a good design, flexibility, and an incredible capacity to be integrated with other systems and frameworks. However, writing test cases using this style might be a little bit hard : you need to write a class, and a couple other things. Besides very simple tasks like to ensure that an exception is raised after a statement is executed, is not very intuitive.

On the other hand, doctest offers a different approach. Even if it lacks all the aforementioned features it also has a few virtues. This module is an incredible example of metaprogramming and simplicity. Tests are written directly in the documetation of functions, classes and modules under test. They look just like statements executed during interactive sessions using the interpreter (statement + result, statement + result ...). Hence doctests may be very useful for programmers using a library because they know exactly how to use it and the expected results. For the developpers it is useful to ensure that it behaves just like stated in the specifications. So if test cases dont fail and users pay attention to the documentation then everything will work just fine ! .

The major advantage of doctest is the readabiliy of the tests. The only thing you need to know in order to write doctest is the syntax of the programming language, and the expected outputs of the system ... so it's evident to ask : How could I take advantage of both approaches ? The answer is simple : Use dutest module.

If you need any help, illustrative examples or hints, don't hesitate: come back and visit this blog, read the articles, and post your own comments. And remember if you ask me about any particular feature you want to know about how to write tests in Python , and I'll always be there for you.

Follow this blog . I really hope you all follow all the posts about dutest , and use all that knowledge in order to write more readable and effective test cases. See you soon ! .