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


Groups > comp.programming > #1888

Re: Question about writing program tests

Path csiph.com!usenet.pasdenom.info!weretis.net!feeder4.news.weretis.net!nuzba.szn.dk!news.jacob-sparre.dk!munin.jacob-sparre.dk!pnx.dk!.POSTED!not-for-mail
From Jacob Sparre Andersen <sparre@nbi.dk>
Newsgroups comp.programming
Subject Re: Question about writing program tests
Date Thu, 05 Jul 2012 09:59:08 +0200
Organization Jacob Sparre Andersen Research & Innovation
Lines 25
Message-ID <87liiyzlir.fsf@adaheads.sparre-andersen.dk> (permalink)
References <decb22b8-858f-48c8-a438-0e754535afad@re8g2000pbc.googlegroups.com>
NNTP-Posting-Host 95.209.246.217.bredband.3.dk
Mime-Version 1.0
Content-Type text/plain; charset=us-ascii
X-Trace munin.nbi.dk 1341475149 16079 95.209.246.217 (5 Jul 2012 07:59:09 GMT)
X-Complaints-To news@jacob-sparre.dk
NNTP-Posting-Date Thu, 5 Jul 2012 07:59:09 +0000 (UTC)
User-Agent Gnus/5.13 (Gnus v5.13) Emacs/23.2 (gnu/linux)
Cancel-Lock sha1:EHEduCGElW+tbBDhAxMQCydptas=
Xref csiph.com comp.programming:1888

Show key headers only | 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