From: John McCormick on
On Aug 10, 12:32 pm, Ada novice <ycalleecha...(a)gmx.com> wrote:
> On Aug 9, 7:05 pm, John McCormick <mccorm...(a)cs.uni.edu> wrote:
>
> > I'm very happy you have found my Ada textbooks useful!  It is always
> > nice when someone notices a book author's name.  Feel free to contact
> > me directly if you have any questions on the material in the books.
> > The OO material in the data structures book is elementary.  Check out
> > the Barnes or Ben-Ari books for an in depth treatment.  Should you
> > want to go on to learn about Ada's concurrent features, I have a new
> > book coming out at the end of the year: Building Parallel, Embedded,
> > and Real-Time Applications with Ada,www.cambridge.org/9780521197168
> > It is aimed at introducing the topics to novices with a background in
> > sequential programming.
>
> I do remember author names of books that have caught my attention :).
> I have been looking at around 15 books (published since 1980) in Ada
> and your two books are certainly very accessible to anyone wishing to
> learn Ada well. I'm a PhD student in mechanical engineering wishing to
> learn and use Ada for scientific numerical programming. So far, Ada
> with its strong typing has enabled me to make much less mistakes than
> I was doing earlier with C. And I have also learned a few aspects of
> software engineering. As my interest is in scientific numerical
> programming, only the first half or so of your Data Structures book is
> relevant to me as I see it today. I wish that authors in future Ada
> books to also focus a bit more on the numerics annex of Ada 05 and
> give some useful examples which can help someone to build his/her
> mathematical library.
>
> I know Ben-Ari books. They are also well-written though at this
> instant in time seem a bit advanced for me in some parts of the books.
> Barnes' books are perhaps more challenging. What's make them
> challenging in my opinion is the lack of complete examples but I
> understand that complete examples would make less space for more
> discussions. I'm not at this moment into concurrent features but I'm
> certain that your forthcoming book will be pleasurable to read and I
> would definitely read the book at some point in the future. Studying a
> book on concurrency will in my opinion help to break one's habit of
> always finding a solution using sequential logic that we tend to pick
> up from other programming languages around and thus will surely help
> to build better codes. I shall contact you directly if I have
> questions relating to your books.
>
> Thanks.
> YC

Thanks for the kind words about my books. It is those little things
that keep an author going. The first edition of Programming and
Problem Solving with Ada did have a chapter devoted to numerics. Or
what constituted numerics in Ada 83. I had a great story about the
Patriot missle failure to motivate the need to understand what
Freshman see as a useless topic. But when the publisher wanted to
shorten the text for the 2nd edition, they polled the schools using
the book and found that none covered the numberics chapter.

Great to see a non CS type interested in Ada. My 1977 PhD is in
geology. I got into computing through computational crystallography
and into embedded systems through the laboratory control of crystal
deformation experiments. Started off with building analog control
computers and then made the leap to digital. As the high pressure
apparatus beside which I sat contained the potential energy equavalent
to several sticks of dynamite I became very concerned with software
safety.

John
From: Yannick Duchêne (Hibou57) on
Le Thu, 05 Aug 2010 20:18:20 +0200, Tero Koskinen <tero.koskinen(a)iki.fi> a
écrit:
> http://www.adacommons.org/AUnit_Calculator_Example
Seems there is a tiny error there:
“Assert (Calc.Sum (2, 3) = 5, "test 2 +5 = 5");”
instead of
“Assert (Calc.Sum (2, 3) = 5, "test 2 + 3 = 5");”


--
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
-- i.e. forget about previous premises which leads to conclusion
-- and start with new conclusion as premise.
From: Yannick Duchêne (Hibou57) on
Le Wed, 04 Aug 2010 16:19:45 +0200, Ada novice <posts(a)gmx.us> a écrit:

> Hi, being a beginner in Ada and in software engineering, I came across
> a textbook mentioning aunit for writing test drivers. I write quite
> simple Ada programs and was wondering if it's worth to learn aunit and
> use it even on simple programs. I understand that it can be a time-
> saver.
I've never used AUnit and your thread was the opportunity to get time to
learn about it.

Just came to this link which seems nice as a starting point:
http://libre.adacore.com/wp-content/files/auto_update/aunit-docs/aunit.html
This is not only about changes in a last version, this is also an
accessible introduction.
From: Yannick Duchêne (Hibou57) on
Le Thu, 05 Aug 2010 22:39:00 +0200, Ada novice <posts(a)gmx.us> a écrit:
> gnatmake -Pcalc
> ./harness -v

It seems there is another GNAT 2010 trick here. In project files (*.gpr
files), this may be required to turn all "-gnatwa.Xe" into "-gnatwa.X".
"-gnatwa.Xe" tells GPRBuild to treat warnings as error, and there are
warnings like
“math-test.adb:13:07: warning: call to obsolescent procedure "Assert"
declared at aunit-assertions.ads:113”
which occurs and would otherwise makes the compilation failed (as this end
up to be treated as error).

About AUnit: just seen about what it is, how it is set up and how it
works. Seems a question is still pending : “how to be sure the test cover
all relevant case ?”. I do not see a way to be sure testing cover all
cases. That is the main limitation of this kind of approach. May be this
is nice for regression tests and tests cases revealed during application's
life time... however, I don't believe this can be used too much soon in a
development stage. Pretty sure this is best used just after real use or
deployment has been started.


--
There is even better than a pragma Assert: a SPARK --# check.
--# check C and WhoKnowWhat and YouKnowWho;
--# assert Ada;
-- i.e. forget about previous premises which leads to conclusion
-- and start with new conclusion as premise.
From: Simon Wright on
"Yannick Duchêne (Hibou57)" <yannick_duchene(a)yahoo.fr> writes:

> About AUnit: just seen about what it is, how it is set up and how it
> works. Seems a question is still pending : “how to be sure the test
> cover all relevant case ?”. I do not see a way to be sure testing
> cover all cases. That is the main limitation of this kind of
> approach. May be this is nice for regression tests and tests cases
> revealed during application's life time... however, I don't believe
> this can be used too much soon in a development stage. Pretty sure
> this is best used just after real use or deployment has been started.

gcov
(http://gcc.gnu.org/onlinedocs/gcc-4.5.0/gnat_ugn_unw/Code-Coverage-of-Ada-Programs-using-gcov.html#Code-Coverage-of-Ada-Programs-using-gcov)
will help to tell which bits of code your tests haven't exercised at
all. And it's free.

For more capable test coverage tools you'll probably have to pay.