The Apostle calls temptations the testing of faith. Faith is taken here in a general sense, as the Christian foundation of the whole structure of Christian moral life.
If this structure is not firm, then faith in God and the Redeemer, Who love man and desire his salvation, is not firm. If this faith is firm, then the whole structure of moral life is firm.
Therefore the tests of the firmness of this structure of life are called tests precisely of faith.
The testing of faith through temptations produces patience. This is the moral steadfastness of man, forged through struggle, in humility and awareness of one's own powerlessness.
Without it, his moral condition may be subjected to the influence of every wind of doctrines, actions, and circumstances. With it, the Christian sails firmly and safely over the stormy waves of worldly life, like a ship with good ballast, guided wisely and patiently.
This mighty power of man's moral perfection, like every moral power, is strengthened and grows through exercise and experience. This exercise and experience is the struggle with various temptations.
Consequently, every temptation, when struggled against, strengthens this power and makes a man morally firmer, higher, and purer. That is, it brings undeniable benefit.
And if this is so, then temptations must be received not with sorrow or faintheartedness, but with joy.
"Temptations bring great joy to the zealous, because through them the testing of such people is revealed, and testing leads to perfect action" (Theophylact).