Boost logo

Boost :

Subject: Re: [boost] How do you test complex transformations?
From: Vicente Botet (vicente.botet_at_[hidden])
Date: 2011-03-18 17:18:43


Steven Watanabe-4 wrote:
>
> AMDG
>
> On 03/18/2011 10:23 AM, Vicente Botet wrote:
>> I know that my question is not directly associated to Boost, but it could
>> be
>> interesting to share the best techniques so we can improve the test of
>> some
>> Boost libraries, existing or future.
>>
>> A transformation complex is complex if I can not associate mentally the
>> output associated to a given input. Think for example on dividing two bit
>> integers.
>>
>> One technique could be to make the transformation by hand and keep track
>> of
>> the input -> output association.
>> Another technique consist in re-implementing the algorithm and check that
>> both implementations match.
>>
>> Do you know other techniques? Does some Boost libraries have such a kind
>> of
>> transformations? How they are tested?
>
> * Compute the inverse transformation and check
> that you get back the original value. e.g.
> q, r = div(a, b);
> assert(r + q * b == a);
> * Combine multiple transformations in
> different ways which should produce
> identical results. e.g.
> assert(a/b/c == a/(b * c) == a/c/b)
>
> In Christ,
> Steven Watanabe
>

Hi Steven,

I really like the two guidelines. Very clever.

Thanks,
Vicente

--
View this message in context: http://boost.2283326.n4.nabble.com/How-do-you-test-complex-transformations-tp3387869p3388489.html
Sent from the Boost - Dev mailing list archive at Nabble.com.

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk