This is an archived copy of the Xen.org mailing list, which we have preserved to ensure that existing links to archives are not broken. The live archive, which contains the latest emails, can be found at http://lists.xen.org/
Home Products Support Community News


Re: [Xen-API] xen-api-libs unit tests

To: Dave Scott <Dave.Scott@xxxxxxxxxxxxx>
Subject: Re: [Xen-API] xen-api-libs unit tests
From: Sergei Lebedev <superbobry@xxxxxxxxx>
Date: Fri, 18 Nov 2011 02:35:02 +0400
Cc: xen-api <xen-api@xxxxxxxxxxxxxxxxxxx>
Delivery-date: Thu, 17 Nov 2011 14:35:57 -0800
Dkim-signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:from:date:message-id:subject:to :cc:content-type; bh=YQH7vYe4RlBwm4ftxAS7R3NW/AQZLn2Plz4yxX1u8oo=; b=I8r5fXgsipbJ5By2QeuIAx7VcTEcS3KPfTKgkLjiJfYaUwujXl0AyvOuc+X5A2J6pW Yf5CXNmGmkgfIHzdfI3gaEmxalEqW5xoe2lTGygFT8p4zGl7gVDY4gFZb3RZFIArH/6Y HXRwmxrqj1kwDhs308PdqVrZd8kofwnkm/2eI=
Envelope-to: www-data@xxxxxxxxxxxxxxxxxxx
In-reply-to: <81A73678E76EA642801C8F2E4823AD21BC34A44BA6@xxxxxxxxxxxxxxxxxxxxxxxxx>
List-help: <mailto:xen-api-request@lists.xensource.com?subject=help>
List-id: Discussion of API issues surrounding Xen <xen-api.lists.xensource.com>
List-post: <mailto:xen-api@lists.xensource.com>
List-subscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=subscribe>
List-unsubscribe: <http://lists.xensource.com/mailman/listinfo/xen-api>, <mailto:xen-api-request@lists.xensource.com?subject=unsubscribe>
References: <81A73678E76EA642801C8F2E4823AD21BC34A44BA6@xxxxxxxxxxxxxxxxxxxxxxxxx>
Sender: xen-api-bounces@xxxxxxxxxxxxxxxxxxx
Hello Dave,

Two things:

1. Have you considered switching (at least partly) to property based testing [*], which works nicely for pure functions (for example most of the stuff from `stdext` can be covered in no time).

2. This is a bit unrelated, but anyway -- why don't you use ExtLib or Batteries, instead of `stdext`? Obviously, the goal is the same for all three of these libraries. And it would be really nice to see Batteries or ExtLib in a project as big as XenAPI.


[*] http://kaputt.x9c.fr

On Tue, Nov 15, 2011 at 3:01 PM, Dave Scott <Dave.Scott@xxxxxxxxxxxxx> wrote:

I've added some more unit tests to xen-api-libs which can be run at build time:


I've also added a "make test" target to the makefile which is invoked as part of the RPM build. I encourage everyone to (i) design their code to be testable; (ii) add some unit tests where the effort is worth it; and (iii) hook 'em in to the "make test" target. When deciding whether a particular test is worth it or not, I try to imagine myself refactoring the code in about a years time, when I've forgotten how it all works :)


xen-api mailing list

xen-api mailing list
<Prev in Thread] Current Thread [Next in Thread>