Beefy Boxes and Bandwidth Generously Provided by pair Networks
go ahead... be a heretic
 
PerlMonks  

Re: (OT) Black- vs. white-box testing

by tilly (Archbishop)
on Oct 26, 2005 at 03:04 UTC ( #502932=note: print w/replies, xml ) Need Help??


in reply to (OT) Black- vs. white-box testing

If I had realized that you made this into a meditation, then Re^12: Corner cases are not always "code smell" would have been a response to this node rather than being buried deep in that thread.

To clarify one point, if you create a private API to allow tests of private functions, I consider that to be white-box testing. Those are tests that cover internal aspects of behaviour that nobody else should rely on, which might change in future versions.

I feel that people who include private functions as part of the specification either have or are in great danger of missing the entire point of modularity. Loose coupling means that you pretend that you don't know about privates.

Replies are listed 'Best First'.
Re^2: (OT) Black- vs. white-box testing
by dragonchild (Archbishop) on Oct 26, 2005 at 13:26 UTC
    To clarify one point, if you create a private API to allow tests of private functions, I consider that to be white-box testing. Those are tests that cover internal aspects of behaviour that nobody else should rely on, which might change in future versions.

    I would consider this black-box testing of the private API. The API you expose to the world and the API you expose to your code are rarely going to be identical. Of course, you should test the complete API, not just the API you expose to the world. If the rest of the world considers this white-box, then, in my public API, I'll consider this white-box as well. What it maps to in my personal implementation of this spec is irrelevant. :-)


    My criteria for good software:
    1. Does it work?
    2. Can someone else come in, make a change, and be reasonably certain no bugs were introduced?
      The reason why I call that white-box testing is that the private API is often explicitly designed to shine a white light on otherwise dark corners of the implementation. For instance in the regex example, you might have a flag that is available telling you which version was actually run. That allows something which should be invisible (whether you've turned on the optimization) to be tested.

Log In?
Username:
Password:

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://502932]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (4)
As of 2019-10-19 02:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Notices?