In Psalm 139:1, David affirms that Yahweh, the covenant making and covenant keeping Great I AM, has searched him. This is a term inferring an examination or testing. For instance, when the Lord says that he searches the heart in Jer. 17:10, there is a parallel line that follows, which states, I test the mind. Just as heart and mind are parallel in the OT, so are search and test. Now don’t think of a test or examination in the educational realm which is designed to assess one’s knowledge and comprehension. This is not a theological examination, but a purity assessment. The final 2 verses of this Psalm, which start off with very similar language, make that very clear.
Furthermore, because the Lord has searched David with such piercing clarity, David is convinced that the Lord knows him. This is a complete and thorough knowledge of all that David is. If we compare it to the medical realm, this knowledge is not equivalent to what is concluded after an annual exam performed by a doctor; no, the Lord’s knowledge of his people is much more comparable to the findings of having every test and scan available performed on your body. There would be not one inch of your body left unchecked. In the same way, God is fully capable of examining and then knowing every nook and cranny of your soul.
Now there are a couple ways to process this, depending on whether or not one is walking wholeheartedly before the Lord. If there is unrepentant sin or sin that is even slightly coddled, this can be a terrifying truth. On the other hand, if one, like David, has dealt with or is dealing with one’s sins and is walking before God with a clean conscience in the proper fear of the Lord, being known by God to this extent is a great comfort. In that case, this knowledge is not only wonderful, but precious (vv.6, 17).