[Novalug] coding for testing

Mark Smith mark@winksmith.com
Sun Mar 11 03:38:55 EDT 2012


to be clearer, i'm not interested in an interface which is implemented
such that only QA ever sees it.  I would agree that such an interface
is a horrible idea.  the QA department needs to test what the user will
be seeing!

a possible example would be an interface such as the following:

	create object
	destroy object

so, that's the user interface, but let's further say, it would be useful
to get some useful statistics about the object such as how long it's
been in existance.

	stat object

let's say that no customers are interested in what could be reported here.
but from a QA perspective it's extremely useful because the stats of
the object is a signficant measure of performance (fill in your blank).

so, development reports they won't create the "stat object" functionality
because no customers wants it.	on the other hand, it would be extremely
useful just for QA.

in any case, the "stat object" functionality is visible to the end
customer as part of the normal interface.  there isn't one version
that goes to QA and other version that goes to the customer.  it's just
something that was installed into the interface that QA finds helpful
in testing the final product.


On Fri, Mar 09, 2012 at 02:28:25PM +0000, Jason Kohles wrote:
> I'm going to disagree with everybody here, although hopefully my reasoning
> makes sense.  :)
> 
> I don't think what we're talking about is whether testing itself is useful
> (I doubt anybody would argue that), but rather we're talking about
> changing the application code base specifically for testing.  Having spent
> decades as both a programmer and a system administrator, my argument would
> be against changing the codebase to support testing except in very unusual
> (and extremely limited) circumstances.
> 
> The reason is that the tests should be handling the code exactly as it is,
> exactly as it will be used in the wild.  If you end up with a bunch of
> code that looks like this:
> 
> if ( $RUNNING_TESTS ) {
> # do a bunch of stuff
> } else {
> # do a bunch of other stuff
> }
> 
> well, now you need tests to test the test parts, as well as tests to test
> the non-test parts, which quickly leads toŠ
> 
> if ( $RUNNING_TESTS ) {
>     if ( $RUNNING_TEST_TESTS ) {
>         if ( $RUNNING_TEST_TEST_TESTS ) {
>             # you see where I'm going with this?  :)
>         }
>     } else {
>     }
> } else {
> }
> 
> Basically my argument would be that all your test-supporting code should
> be outside the application code base (though whether the application
> programmers, or a QA programmer should be writing that test code is an
> argument for the project team)..
> 
> -- 
> Jason Kohles
> Palantir Technologies | UNIX Systems Engineer
> jkohles@palantir.com  | 703.957.5784
> 
> 
> 
> 
> 
> 
> 
> On 3/9/12 9:06 AM, "Keith Howell" <keith.c.howell@gmail.com> wrote:
> 
> If it is a big enough company, then have the QA department hire an
> independent programmer and then reduce the programming group by one
> programmer. Or at least threaten to do this :)
> 
> They need to realize that all of you work for the same company. Costs
> incurred in the QA process add to the cost of the product, just as time
> spent in the development group does.
> 
> Failures in the wild from the QA team missing an obscure outlier case in
> the code have their own associated costs which could well exceed the
> annual budget for the whole programming group. Pointing out some of
> these hidden costs to management might well have some new directives
> heading down the chain.
> 
> In any case, the programmer that writes the function is more qualified
> to write the test case and should be able to do it in less time that an
> independent programmer.
> 
> -- 
> Keith
> 
> On 03/08/2012 09:22 PM, Mark Smith wrote:
> > I'm sure they think the code needs to be tested.  I think the problem
> > that I'm trying to indicate, poorly, is that they refuse to create any
> > additional code which, in their estimation, will only be useful to QA.
> > 
> > Perhaps another way of wording my question is, what percentage of
> >software
> > development companies make special changes which may benefit just the
> > testing phase?
> > 
> > As an example, a particular test we do takes several days to do and is
> > a serious draw on resources.   The hardware we use isn't cheap and the
> > time we take is even more expensive.   There are faster ways of running
> > these tests, but in their estimation, it doesn't seem like the kind of
> > thing that a "regular" customer will ever run into.  Their decision is
> > that this work will not be done because it's only the QA department that
> > has to incur the expense of running this particular test.
> > 
> > Another more vague example would, uhm, let's say the creation of a
> > function call that would probably only ever be called regularly from QA.
> > Let's say, further that it is a function that reports the amount of time
> > that some particular operation took.
> > 
> > And so on...
> > 
> > So, I do believe that they believe there's a need for testing, but they
> > don't want to make any changes to help that process.
> > 
> > 
> > On Thu, Mar 08, 2012 at 08:46:07PM -0500, John Warren wrote:
> >> My very strong opinion on this is, "Avoiding anything, no matter how
> >> trivial, to help automated and manual testing is a sure sign of some
> >> impending, dark and laborious coder crisis that will make you question
> >>why
> >> you work where you work."  Yeah, not good in IMHO.
> >>
> >> On Thu, Mar 8, 2012 at 8:22 PM, Mark Smith <mark@winksmith.com> wrote:
> >>> I was having a discussion at the office today.  The coders here are
> >>> entirely against writing a single lick of code where it's purpose
> >>> will be to support the testing of the software.
> >>>
> >>> That got me to wondering... I wonder how other software developers
> >>> feel about writing code to help software testing.  Is my company just
> >>> a one-off?  or do the majority of software developers feel the same
> >>>way?
> > 
> 
> _______________________________________________
> Novalug mailing list
> Novalug@calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug



> _______________________________________________
> Novalug mailing list
> Novalug@calypso.tux.org
> http://calypso.tux.org/mailman/listinfo/novalug


-- 
Mark Smith
mark@winksmith.com
mark@tux.org



More information about the Novalug mailing list