Stefano Zacchiroli: Test Driven Development in Debian
- a seminal conversation on identi.ca
- a couple of blog posts by Lars, discussing the general problem of how to use TDD in distribution development and to a lesser extent its instantiation to Debian
- a separate post by Daniel stressing the specific TDD advantage of increasing the confidence of maintainers in making far reaching changes
*g*.
more testing
I believe Debian needs more testing and I've
been advocating for that since quite a while e.g. at
DebConf10, as one of the main goals we should pursue in the
near future. Of course advocating alone is not enough in Debian to
make things happen and that is probably why this goal has been
(thus far) less successful that others we have put forward, such as
welcoming
non-packaging contributors as Debian Project members. There are
important reasons for increasing testing in Debian.
quality assurance
Quality Assurance has always been, and still is, one of the
distinctive traits of Debian. I often say that Debian has a
widespread culture of technical excellenceand that is visible in several places: the Debian Policy process, lintian, piuparts, periodic full archive rebuilds, the EDOS/Mancoosi QA tools, the cultural fact that maintainers tend to know a lot about the software they're packaging rather than only about packaging, the
we release when it's readymantra, etc. But caring about quality is not a boolean, it's rather something that should be continuously cherished, refining quality requirements over time. By simply maintaining the status quo in its QA tools and processes, Debian won't remain for long a distribution who could claim to care about package quality. Others will catch up and are in fact already doing that. In particular, we surely have room for improvements in our quality tools and processes for:
-
Build time package testing. Several packages
run their build-time test suites during package build. This aspect
is somewhat
supported by the Debian policy; we also do a best effort
attempt to run build-time test suites via
debhelper (starting from version 7). At the same time we could
probably campaign more to encourage maintainers to look for
build-time test suites which do not follow common Makefile target
naming or, fwiw, which don't rely on make at all.
TodoList.add("investigate and possibly file bug report against policy to encourage maintainers to run build-time test suites")
TodoList.add("investigate and possibly file bug report against lintian to spot the presence of [non-invoked] build-time test suites") - Runtime package testing (AKA "as-installed package testing"). Some kinds of test-suites are difficult to run at build-time (e.g. complex applications that don't offer easy way to re-configure on the fly their filesystem paths) and some others are plainly impossible to run without having the packages to be tested properly setup (e.g. running services that are accessible only through the network) or an isolated, throw-away testbed (e.g. bootloaders, kernels, etc.). TTBOMK this kind of testing is not currently in use neither in Debian nor, indirectly, in any of its derivatives. autopkgtest (AKA DEP8) is a step in this direction; I will get back to it later on in this post.
- Integration testing. When applied in the context of distributions, integration testing is about testing package combinations, task (as in tasksel) combinations, basic system functionalities, automated installations, etc. This is the aspect that Lars has discussed the most (and in which he seems to be interested the most) so I don't feel like adding much. Still, it's interesting to note that on this front Debian has an important potential to exploit. The large base of its developers and the fact that the average Debian user is technical savvy mean that we can potentially collect a lot of test cases. It's "just" (with well-deserved double quotes) a matter of deciding a standard interface for test case submissions and developing a most likely virtualized test runner. At that point a continuous integration service that periodically run and publishes results can be setup independently from the rest of the Debian infrastructure and offered to interested eyes, such as Release Team's. Any taker?
- Automated code analysis and in particular automated bug finding is something which is becoming more and more common and finally, after decades of research viable. Successful proprietary tools and businesses are aplenty (a nice and very fun read on the subject is the story of Coverity), as well as FOSS solutions. For instance, the Linux kernel is routinely using Coccinelle to automatically find bugs and even produce the corresponding patches. Add to the above the fact that Debian is one of the largest software collection in existence (and quite probably the largest collection of Free software in existence) and is upstream of the packaging of that software for the most part. That turns Debian into a very peculiar platform for large scale automated code analyses. Not that we can aim at fixing all the bugs we are going to find, or even hope to tame all the false positives we are going to find. But we can offer an important service to the whole ecosystem of Free software and use it to pinpoint important class of bugs from a distribution point of view, such as nasty security bugs (as long as they can be automatically found ). DACA is a very good step in the right direction, even though it is still in its infancy.
-
README.package-testsprovides a standard format to declare per-package tests using the newdebian/tests/controlfile. Tests come as executable files which will be run by theadt-runtool in a testbed where the package(s) to be tested is already installed. This part of the specs has been reified as DEP8 which I'm (supposedly) co-driving with Iustin Pop and Ian (for well-deserved credits). -
README.virtualisation-severdescribes the interface among the test runner and the testbed. A nice separation is provided among the runner and the testbed, enabling different testbed environments with a varying degree of isolation: you can have a "null" testbed which runs tests on your real machines (needless to say, this is highly discouraged, but is provided by theadt-virt-nulltool), a chroot testbed (adt-chroot), or a XEN/LVM based testbed (adt-virt-xenlvm).
- The usage of python-apt needs to be ported to recent API, as several used methods and attributes are now gone.
- Porting from dchroot to schroot is needed for the
adt-virt-chrootbackend. - A kvm backend for the test runner would be nice.
Note: this post is the basis for the TDDD BoF that I will co-host with Tom Marble at DebConf11. If you plan to come, we will appreciate your thoughts on this matter as well as your help in getting the
autopkgtest toolchain up and
running again.
Martin Michlmayr is a Debian developer since 2000 and I share quite a few things with him, starting with his age and involvement in the quality assurance team. He managed to be elected Debian Project Leader in
I'm someone who sometimes
The process is really simple:
Barring a miracle, it looks like I won't be going to Debconf 11 this year which is a shame as that is a part of the world I have yet to visit. Anyway it got me thinking, I've neglected a lot of my Open Source activities this past year or so what with struggling to stay in good financial shape. As Chaturmasa started today in which we take up additional religious duties, I thought it might be a good time to recommit to getting all my projects up to speed again.
So during the next four months I aim to (in no particular order)
5. Describe the problem so that the developer can reproduce it
Ideally your report should include everything required so that the developer can reproduce the problem on his system. If a given document triggers the bug, attach it.
Describe the steps required to reproduce the bug in great details just like you would explain it to your grand-ma. Explain how you expected the program to react and what happened instead.
You can learn much more on how to draft a good bug report in this article:
Ten years ago, I started to use
Here is a short snippet used to select a sensible 
We are happy to announce that the preliminary
As I mentioned in my previous blog post, OMAP4 netboot images were available, but non-functional. I'm pleased to announce that these bugs have now been resolved and it is possible to have a functional install on OMAP4. This also has the added advantage of allowing one special partitioning layouts such as RAID, LVM, or simply having a non-SD based root device. The images are available here: http://ports.ubuntu.com/ubuntu-ports/dists/oneiric/main/installer-armel/current/images/omap4/netboot/
* Alas. Not going to DebConf 11
After testing Emacs, Eclipse, KDevelop and CodeBlocks for writing C++ code, I decided to stick with Netbeans. It seems to be the most simple to configure and yet full of features and plugins. I was having one problem with it that when I focused out the window, and then focused on it again, it would not really grab the focus, in the sense that I would not be able to type without first clicking with the mouse. At first I thought the problem was with Netbeans, then with the JRE. I tried using sun-java6-jre, I tried upgrading my openjdk-6-jre, and nothing worked. I searched a little bit more and got to
When traveling I usually try local brands of beer. This became some sort of hobby, and usually gives me a good possibility to get in contact with the locals. For