For faith to be established, it must be tested. With regard to this testing Peter, in his first letter, speaks thus: ‘Although you may have to be saddened for a little while by various temptations so that the testing of your faith (which is much more precious than gold tested by fire) may be found in praise and glory and honor, at the appearing of Jesus Christ.’
Faith is tested by temptation so that we may come to know its nature and its greatness, either in others, as an example and testimony of faith, or in the person who is tempted, as a comfort in his labor, a foundation for his hope, and eagerness in persevering. For before temptation, one’s faith is not even known to oneself. That is why it is written in the book of Wisdom, ‘If someone has not been tempted, what do they know?’; and a little further on: ‘Someone who is not experienced knows little.’
God, however, does not permit us to be tempted beyond our capacity, and he therefore arranges for temptation to have a certain outcome so that we can sustain it. And the outcome of temptation has manifold advantages. For when, in tribulation, the testimony of faith is restored by the constancy of virtue, our neighbor is edified; but in us the merit of faith is increased, our confidence in our progress more powerfully strengthened, charity more ardently inflamed, the name of God more splendidly honored and his mercy more gloriously magnified and more wonderfully glorified.
God tests faith: not so that he, who knows all things before they come to be, may begin to know [something], but so that he may make his power known in us for the augmentation of his grace and glory. Yet for all that, he is said to know when he makes us know what he deigns to reveal to us about ourselves. That is the reason for this [passage]: ‘Test me, O God, and know my heart’ and so on. ‘Test me,’ he says, ‘and know my heart.’ It is as if he said: ‘By testing it, make my heart known to me.’
Baldwin of Forde, The Commendation of Faith, Chapter 36: On the Testing of Faith (CF 59, pages 128-129)