The purpose of implementing hook_theme either in a custom module or theme is to register it's theme implementations which specify how a particular render array is to be rendered as HTML.
Grey box testing is the combination of both White box testing and Black box testing method. In white box testing, testers are aware of the internal structure of code where as in black box testing testers aren't aware of the internal structure.