Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > comp.programming > #782
| From | Ian Collins <ian-news@hotmail.com> |
|---|---|
| Newsgroups | comp.programming |
| Subject | Re: Unit testing, what is it? |
| Date | 2011-08-26 08:07 +1200 |
| Message-ID | <9bnob9Fau3U1@mid.individual.net> (permalink) |
| References | <17e0fe2b-954c-4a5c-85d2-b4eac052fa13@b20g2000vbz.googlegroups.com> |
On 08/26/11 04:15 AM, nroberts wrote: > I've recently started at a new job after 5 years working somewhere > else, which wasn't able to teach me much so I taught myself. I > implemented what I read about unit testing using the Boost.Test > framework (was working in C++). > > My idea of a unit test is to take some chunk of a program, often a > single class or small set of classes meant to work as a cohesive > entity, and link that part and only that part of the program to a > driver that asserts the behavior I expect from the unit and outputs a > report for me. Generally I make sure there's a way to turn off > verbosity so the build system can use the return code to tell me > simply whether the test passes or fails. Then I have a growing set of > these programs that are compiled and run as part of my build process. > > I was rather surprised to find that something quite different goes by > the name "unit test" at the new employer, but maybe I'm the one that's > wrong. Here they compile the program, which is a small part of a > large, multitiered framework, and run another program that requests > data from it; this client is somewhat configurable in what data it > requests. Then they manually check things like the log and database > to see what's there and make sure it's correct. You are much closer to the mark. A good definition and description of unit tests can be found here: http://c2.com/cgi/wiki?UnitTest > At some level I suppose this way does test certain aspects of the > code, and probably stresses particular "units" within it, but are > these actually "unit tests"? Does it matter? That depends on their definition of "unit". These look more like system tests to me. The real teat is does a failure identify the function that cased the tests to fail, or do they have to do more work to track it down? -- Ian Collins
Back to comp.programming | Previous | Next — Previous in thread | Find similar | Unroll thread
Unit testing, what is it? nroberts <roberts.noah@gmail.com> - 2011-08-25 09:15 -0700 ReĀ : Unit testing, what is it? vincent_belliard <vincent@famillebelliard.fr> - 2011-08-25 12:57 -0700 Re: Unit testing, what is it? Ian Collins <ian-news@hotmail.com> - 2011-08-26 08:07 +1200
csiph-web