Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.programming > #1888

Re: Question about writing program tests

From Jacob Sparre Andersen <sparre@nbi.dk>
Newsgroups comp.programming
Subject Re: Question about writing program tests
Date 2012-07-05 09:59 +0200
Organization Jacob Sparre Andersen Research & Innovation
Message-ID <87liiyzlir.fsf@adaheads.sparre-andersen.dk> (permalink)
References <decb22b8-858f-48c8-a438-0e754535afad@re8g2000pbc.googlegroups.com>

Show all headers | View raw


mike3 wrote:

> Consider the programming of a bignum package. How would you write
> _tests_ for this -- more specifically, how do you validate the results
> of a bignum addition/subtraction/ multiplication/division routines
> without referring to the bignum package in the first place?

a) Manually calculated results (what you call "hardwired").  Remember to
   make test cases at and around the boundaries, where you are likely to
   make mistakes.

b) Verifying against a separate, independently developed library.
   Preferably one which uses a completely different approach.

c) Use a static analysis tool (this is technically not "testing") to
   verify that the routines do what you want them to.

Greetings,

Jacob
-- 
"Those who profess to favor freedom and yet depreciate
 agitation, are people who want crops without ploughing the
 ground; they want rain without thunder and lightning; they
 want the ocean without the roar of its waters." -- Frederick Douglas

Back to comp.programming | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

Question about writing program tests mike3 <mike4ty4@yahoo.com> - 2012-07-04 19:26 -0700
  Re: Question about writing program tests mike3 <mike4ty4@yahoo.com> - 2012-07-04 23:33 -0700
  Re: Question about writing program tests Jacob Sparre Andersen <sparre@nbi.dk> - 2012-07-05 09:59 +0200
    Re: Question about writing program tests mike3 <mike4ty4@yahoo.com> - 2012-07-05 02:53 -0700
    Re: Question about writing program tests Patricia Shanahan <pats@acm.org> - 2012-07-05 05:19 -0700
      Re: Question about writing program tests "Dmitry A. Kazakov" <mailbox@dmitry-kazakov.de> - 2012-07-05 14:51 +0200

csiph-web