back to blog

A physical example of black box testing


Last updated: 30.09.20
None

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.

https://lh4.googleusercontent.com/RePKZYbtRpRAIHxioWkvDfNSiVKPMue7bniJQqlxSTxxx8o4Ul5BRRvr_Vkn1X_PxbN10lTNApjq9JoU95ARLiW94m2wgW_RRpFd3Kl5Gf5BoZTwBD7mLhOyHOx_wVakyX8DX-eF

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.

https://lh4.googleusercontent.com/iDaF2jGBJQqdjImbctrwKPQx1LTfSPFQG5x6CS-wIgbSrWfMe-Y-ZJJVswn9Qk7L3TEbIHuX5FA47e3YO20yIitMJ7yt9a2OJfrvMYZ1Y9FKhGUNlnR7MZPdxweqO5pIO9Mn8J0ehttps://lh3.googleusercontent.com/XcCKlkr4mtA39ZmctrBTwMgOw9wm2JuWoBX8yQ5CuHdVLu-TTlTiGeHzyMOf2eyt45iW9ydbVif4uatiONsX7eNcrR77yFW2GUSaHnWFyJhuY6PJ1qWcH7jxZQwMcycLeyL9HhK2

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

https://lh3.googleusercontent.com/9ugfxEeYSbN3hHPOyup57QakRj6Jp-R8RlwpZQZaDiSHUllbQowx1PkMWksdNv6vxnkF0C_u5YWQSUl3zGkgl9fwkdMsYYztPzQFwDFih7cLKaG8gmvhFS9s2WNVje1jMYQsThJq

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.


https://lh4.googleusercontent.com/96UtC3N3uuy-DfulNeH_-k3NoazT3QC-jQA0cQuG8Cj0mr_D4KNvqzsTCy2s1UMTKZLX7Ck3E-0rHp-3GhKgma4Jph5AWjFU11GsQnHRJ0R0c3wuJOUB3-Mya79t9cwzoIXnB21Thttps://lh3.googleusercontent.com/NKaakvv5eNZoAub4opY4eleZlZTAcFDRWbElHp557cr9V18umvvGJWmXlG37NUZQupDF9MjEQAmWZqu7md0onOqPLMrMypvVSnaMfH2c4w1uYH6azSWRhcknhHtFFuP9d7SVWvBT

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.