automated coding standard validation?

I

Ian Collins

Al said:
Little comfort to the customer who manages to break it, but a good
reason for making the customer responsible for the specification.
Yes, we normally do this by making the customer (or a proxy if there
isn't a single customer) responsible for the acceptance tests, which
validate the specification against the customer's requirements.
 
K

Keith Thompson

Ian Collins said:
That's where we differ, when you use TDD, your units test /are/ your
live runnable specification. So if they pass, the code meets its
specification.

I'm skeptical. I don't believe that tests of program behavior can
prove correctness.

For example, suppose the code works properly when plain char is
signed, but breaks when it's unsigned. No amount of testing can
detect such a bug *unless* (a) you test on a platform where plain char
is unsigned, or (b) you make the signedness of plain char one of the
acceptance criteria (which is possible only if you happen to think of
it).

There are plenty of potential system dependencies that are far more
subtle than the signedness of plain char. I don't see how you can
think of all of them, let alone test for all of them.

Remember that undefined behavior can always result in your program
behaving exactly as it should -- until it fails at the most
embarrassing possible moment.
 
I

Ian Collins

Keith said:
I'm skeptical. I don't believe that tests of program behavior can
prove correctness.
I agree that tests can only prove correctness on the platform where the
tests are run. That's where the Java/PHP/.NET crowd have a distinct
advantage when doing TDD.
For example, suppose the code works properly when plain char is
signed, but breaks when it's unsigned. No amount of testing can
detect such a bug *unless* (a) you test on a platform where plain char
is unsigned, or (b) you make the signedness of plain char one of the
acceptance criteria (which is possible only if you happen to think of
it).
In my shop, acceptance tests were always run on the target platform(s).
There are plenty of potential system dependencies that are far more
subtle than the signedness of plain char. I don't see how you can
think of all of them, let alone test for all of them.
No one can, that's why we use at least two levels of testing (developer,
customer acceptance and in my case, end user). Problems found in
acceptance testing require a unit test to be added in order to fix the
problem, so the unit tests become more comprehensive over time. the
signedness of char would be one of these conditions.
Remember that undefined behavior can always result in your program
behaving exactly as it should -- until it fails at the most
embarrassing possible moment.
I have too many bite marks to forget that one!
 
R

Richard Bos

Keith Thompson said:
I'm skeptical. I don't believe that tests of program behavior can
prove correctness.

Whereas I don't believe that correctness proofs can assert that the
program works correctly in practice.

Richard
 
A

Al Balmer

Whereas I don't believe that correctness proofs can assert that the
program works correctly in practice.
In the same sense - it meets the specification. Unfortunately,
specifications are often incorrect, and almost always incomplete.
 
I

Ian Collins

Al said:
In the same sense - it meets the specification. Unfortunately,
specifications are often incorrect, and almost always incomplete.
At least when you are using your tests as a runnable specification, it
will remain current and adapt to meet changes to requirements.
 
E

ena8t8si

Ian said:
Why use a tool at all? Just adopt some agile practices such as
collective code ownership and pair programming. Way more effective than
a tool.

The usual hit-and-run tactics of agile/extreme programming
zealots. Great claims, no evidence.
 
E

ena8t8si

Ian said:
...
Sorry if techniques for developing reliable C applications are
considered off topic here.

Apology accepted.
I was simply trying to point out there are often (but not always)
process techniques that can replace tools.

When you find a more appropriate newsgroup for the
topic, please be sure to offer some substantation
rather than just argument by REPEATED ASSERTION.
 
I

Ian Collins

The usual hit-and-run tactics of agile/extreme programming
zealots. Great claims, no evidence.
I'm happy with the evidence provided by the continued success of my
teams and their products. But as you said else thread, techniques for
developing reliable C applications are considered off topic here.
 
E

ena8t8si

Ian said:
I'm happy with the evidence provided by the continued success of my
teams and their products.

If you care only about whether _you're_ happy with
your conclusions, then kindly keep your opinions
to yourself. Other people are more discriminating.
But as you said else thread, techniques for
developing reliable C applications are considered off topic here.

Yes, that's why I'd added OT: in the Subject line. HELLO!
 
I

Ian Collins

If you care only about whether _you're_ happy with
your conclusions, then kindly keep your opinions
to yourself. Other people are more discriminating.
I don't, I care that my clients and customers are happy.
 

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
474,184
Messages
2,570,978
Members
47,561
Latest member
gjsign

Latest Threads

Top