comp.lang.ada
 help / color / mirror / Atom feed
From: Stephen Leake <stephen_leake@stephe-leake.org>
Subject: Re: Strange error
Date: Sun, 25 Jan 2015 03:25:51 -0600
Date: 2015-01-25T03:25:51-06:00	[thread overview]
Message-ID: <858ugri540.fsf@stephe-leake.org> (raw)
In-Reply-To: 3fa7d4c4-f9fe-4d00-9034-a348802087a9@googlegroups.com

Laurent <daemon2@internet.lu> writes:

> Quite obvious could have found that myself by thinking/searching a bit more.
>
> How do you professionals prevent such stupid errors? I am just a noob
> and playing a bit around so it has no impact on anything.

Write tests _first_.

In this case, write a complete set of tests on what insert and delete
should do to an empty list, a 1 element list, a 2 element list, and a 3
element list (3 stands in for 3 .. huge).

Then implement the list, and make the tests pass.


AdaCore AUnit is a nice testing framework.

-- 
-- Stephe

      parent reply	other threads:[~2015-01-25  9:25 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2015-01-22 21:46 Strange error Laurent
2015-01-23  7:45 ` Egil H H
2015-01-23  8:44   ` Laurent
2015-01-23 20:45     ` Laurent
2015-01-23 21:26     ` Randy Brukardt
2015-01-24  1:34       ` Bob Duff
2015-01-24 13:14         ` Brad Moore
2015-01-24 19:12           ` Laurent
2015-01-26 21:44         ` Randy Brukardt
2015-01-24  0:47     ` Bob Duff
2015-01-24 19:08       ` Laurent
2015-01-25  9:25     ` Stephen Leake [this message]
replies disabled

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox