use of assert in Java [vs. exceptions]

J

Joshua Cranmer

Tom said:
At no point before the 501 launch did the engineers perform a
whole-system integration test. They never put the whole software package
together on a testbed and see if it worked.

It seems to me that a lot of famous software engineering failures seem
to involve the following confluence of events:
* An old version of software which has some hardware limitation
* Part of the software relies on that hardware limitation implicitly
* The software is ported to a new hardware which does not have said
limitation
* No one tests the software under the new stuff, since it worked under
the old hardware and why would the new stuff cause it to fail?

Yes, adequate testing would pretty much preclude every major engineering
failure in history, whether it be software engineering, civil
engineering, etc. But often times, people justify that the tests are not
needed--an underappreciation for the impact of even minor design changes.
 
J

John B. Matthews

Joshua Cranmer said:
It seems to me that a lot of famous software engineering failures
seem to involve the following confluence of events: * An old version
of software which has some hardware limitation * Part of the software
relies on that hardware limitation implicitly * The software is
ported to a new hardware which does not have said limitation * No one
tests the software under the new stuff, since it worked under the old
hardware and why would the new stuff cause it to fail?

Yes, adequate testing would pretty much preclude every major
engineering failure in history, whether it be software engineering,
civil engineering, etc. But often times, people justify that the
tests are not needed--an underappreciation for the impact of even
minor design changes.

In the context of Java, would it be fair to say that software tested
with assertions enabled should again be tested with assertions enabled
after modification? I'm guessing it would be possible to enforce this at
build time in a <junit> task using the <assertions> subelement.
 
J

Joshua Cranmer

Giovanni said:
You only need to build sufficient test suites with test coverage
proportional to the cyclomatic complexity.

There is a hidden danger here: failures in software engineering occur
when there is insufficient testing, which tends to result from the
assumption that you adequately tested the code. Dijkstra famously
quipped that "Testing cannot prove the absence of bugs, only the
presence of bugs." I find it unreasonable to assume that, for a
sufficiently large project, all of the relevant codepaths can be tested
and, at least in terms of these basic contract violations, be bug-free.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,766
Messages
2,569,569
Members
45,042
Latest member
icassiem

Latest Threads

Top