Re: A simple unit test framework
Gianni Mariani wrote:
Pete Becker wrote:
...
When I was a QA manager I'd bristle whenever any developer said they'd
"let testers" do something. That's simply wrong. Testing is not an
adjunct to development. Testing is a profession, with technical
challenges that differ from, and often exceed in complexity, those
posed by development. The skills required to do it well are vastly
different, but no less sophisticated, than those needed to write the
product itself. Most developers think they can write good tests, but
in reality, they simply don't have the right skills, and test suites
written by developers are usually naive. A development manager who
gives testers "complete freedom" is missing the point: that's not
something the manager can give or take, it's an essential part of
effective testing.
The most successful teams I worked with were teams that wrote their own
tests.
I find the distinction of being a "programmer" or a "test programmer" to
be counter productive.
I do, too, because those particular terms suggest a false hierarchy. A
better distinction might be between an application programmer and a test
programmer. The fact remains that developers rarely have the skills to
write good tests or the mindset to write good tests.
Testability is a primary objective. (one of my tenets for good software
development).
Without somthing being testable, it can't be maintained. Maintaining
and developing are the same thing. Hence, can't be tested means can't
be developed.
Yes, there are edge cases where the developer is unable to fully test
the code. That's ok, tests don't have to be perfect first time, as
problems are found the developer gets to learn and develop better tests.
I almost always now resort to at least one monte-carlo test.
(construct/randomly twiddle/destruct) large numbers of times in random
orders with random data.
Yup. Typical developer-written test: I don't understand testing well
enough to do it right, so I'll do something random and hope to hit a
problem. <g>
As I've said several times, developing and testing involve two distinct
sets of skills. Developers think they're good at testing, but any
professional tester will tell you that they aren't.
--
-- Pete
Roundhouse Consulting, Ltd. (www.versatilecoding.com)
Author of "The Standard C++ Library Extensions: a Tutorial and
Reference." (www.petebecker.com/tr1book)