Richard Phillips shares some great thoughts on the subject of testing—especially for the believer. First, he pulls in high caliber thinkers to explain the purpose of the tests.
“Testings reveal the state of our hearts—a crisis neither makes nor mars a man, but it does manifest him. While all is smooth sailing we appear to be getting along nicely. But are we? Are our minds stayed upon the Lord, or are we, instead, complacently resting in His temporal mercies? When the storm breaks, it is not so much that we fail under it, as that our habitual lack of leaning upon God, of daily walking in dependency upon Him, is made evident.” ~ A.W. Pink
“Trials …have a tendency to distinguish between true religion and false, and to cause the difference between them evidently to appear.” ~ Jonathan Edwards
So tests actually reveal the genuineness of our faith and level of maturity. Probably a big reason we become so flustered in the middle of any test is that we discover that we're not as strong as we thought we are. The trial brings to the surface the real "us" and looking into a very accurate mirror, we find ourselves to be repulsive.
Phillips goes on to write about how, in spite of the pain, disillusionment and fear experienced in the test, the saint is to remain tender and humble throughout the dark night of the soul, and even profit from what is learned about God and himself.
“Salvation is not a matter of knowing God’s blessings—after all, many people who do not know God know his blessings—but it is a matter of knowing him, understanding his character and his ways, and more and more trusting him in all things.
If you are not growing in your knowledge of God, your understanding and appreciation of his ways, let this be a warning to you. We are to be students of God’s character, learning what God is like through the circumstances of our lives and especially through the Bible, and growing in our love for him. How is God manifesting his power and grace? Can we look back and discern his once-hidden wisdom, his goodness, his patience, his holiness and love? This is the way to worship him, and indeed, the way to keep our sinful hearts from hardening [Heb. 3:7-12].
Let me put it another way. What should you be looking for when you read your Bible? There is nothing more important than for you to study God himself. ‘What does this Scripture tell me about God, about his character, and about his ways?’ ‘How can I know him better and trust him more?’ The study of the attributes of God is one of the most vital of all subjects, for to know God is to trust him and to worship him with both awe and gratitude.”
(Taken from Hebrews: Reformed Expository Commentary, 99-101.)