Chat with us, powered by LiveChat
back to blog

A physical example of black box testing

Last updated: 30.09.20
A physical example of black box testing

A few days ago, I ended up buying a pair of sunglasses from a local drugstore for 5 euros to replace another pair of cheap sunglasses I lost. I had bought that for 15 euros. Now 15-20 euro sunglasses I can believe, but 5 euro got me thinking about Quality of sunglasses and how to go about measuring it.

What is a pair of sunglasses for me? Their lenses “somehow” reflect and/or absorb UV light. The actual implementation details are irrelevant, I don’t work for the manufacturer. I only want to determine if it will serve me as an end customer. Which means I will conduct black box tests without knowledge of or access to internal mechanics of the glasses.

Now to take any form of deliberate measurement I need an actuator and a sensor. I drew a block diagram below to remind those who already come from that sort of education.

Finding an UV radiation detector is not hard, the paper money in your wallet has UV reactive ink print as a safety feature. If the UV intensity is high enough some of the ink on paper money will visibly glow. The LEDs that produce a not so precise blend of UVA/UVB light are really cheap, they work on single digit voltages and mA currents. Their intensities are generally on par with what paper money requires. I am planning to shine a UV LED on an Euro banknote with and without a pair of sunglasses held in between and observe the difference.

I went to a bunch of toy stores, stationery stores, novelty stores etc. to look for a small toy with a UV LED. I was really lucky and ended up finding a secret message pen with a UV LED and UV reactive ink.

Now here is the most important bit about using a tool you didn’t construct yourself. Test your testing tools. Somebody made those tools with certain assumptions, these assumptions may not actually align with what you need OR how the product is advertised. The first thing I did was to check if the pen does what it claims to do. I illuminated the ink reservoir with its own LED and saw the characteristic faint green glow of UV reactive chemicals. I have a minimum amount of domain knowledge, just enough to recognise that the tool is working as intended based on this observation.

Now that I am fairly confident that the pen works as advertised, I will try to see if it also meets my initial expectation by highlighting the UV reactive ink on the money. It does.

Now I will try once again with sunglasses in the middle. It is noticeably fainter.

Now at this point I actually met my initial goal. And determined that the cheap sunglasses actually block UVA/UVB. For my personal use this is fine.

On the other hand I have a pair of sunglasses with expensive lenses and I want to see if there is a significant difference. I wrote some letters on a piece of paper with the pen itself and turned off the lights to minimise interference. The calibration run is seen in the first picture. Second is the shot with the expensive sunglasses and third is the cheap sunglasses.

Well the measurements aren’t the most precise as I am eyeballing it. But the cheap pair of glasses seem to block UV better than the expensive ones. Which brings us to the subject of measuring the right thing and knowing what to look for.

Now you have to remember the purple light you see is not UV light, UV light is invisible. The purple light is a byproduct of how physics works. In an ideal world the filtering glass wouldn’t block any of the visible color but only block invisible UV light that lights up the letters. As in, all the color would all be there, just the same as the first picture, but the letters would stay invisible when behind the sunglasses. An eye actively adjusts how much light it lets in, depending on the signal strength of the visible light that it receives. If I am wearing the cheap sunglasses, my eyes will get less visible light and let more light in which also means more of the unfiltered UV radiation will get in. The expensive glasses obviously also let more UV through; but they also let a lot of visible light through which would trigger my eyes to try and protect themselves. I can’t intuitively make a value judgement based on my current domain knowledge. This has turned into a quadratic optimisation problem and human intuition is notoriously bad at it.

To sum up: the basic test was successful. The cheap glasses do block UV light. The comparative test yielded ambiguous results. I do not know if it’s actually worth having expensive glasses.

Please enable JavaScript to view the comments powered by Disqus.