I stumbled upon some black box techniques, but I don't really get how it works. I found sources saying that black box techniques are techniques in which you input something in a program and check if the output matches with the wanted result, if it doesn't, there's an error somewhere.
Let's help with the terminology first:
- Black Box Testing typically means testing the application without knowledge of the internal code (structures, workings, etc). 1
- Black Box Testing get it's name from Black Box devices.
- When I think of Test Techniques I think of ways design, run and interpret the results of tests.
- That would make Black Box techniques, test techniques commonly used in a black box approach.
- Knowing if an output is correct requires you to have an Oracle, or a something that helps us decide if the program passed or failed the test. It could be a specification, a reference program, etc.
How can a software tester without any knowledge of the program do these tests?
That would be knowledge of the code, not knowledge of the program.
For example, if we take a look at the test technique Domain Testing, also known as Boundary Analysis and Equivalence Class Partition, and if we use the Schema laid out in the awesome book The Domain Testing Workbook by Cem Kaner the first thing we do is Characterize the Variable.
There's a lot to this but let me see if I can sum it up:
- We look at a program (from a black box perspective) for variables (things we can change) and make a list of all of the interesting ones
- Then we analyze a few interesting variables to understand them by their data type, range of valid values, special cases, responses to invalid values, etc, etc.
- Then we try to understand it's primary dimension or it's primary purpose
It goes on from there until we are able to select a few powerful tests, all without knowing or using knowledge of the internal code.
It's worth noting that many test techniques can be approached from both black box and glass box (or white box) ways.