These are about how to put your faith to work so that the invisible (faith) will be visible. None of these passges is for the purpose of examining your works to see if you really have faith or if you really are regenerate. These passages are to believers who generally know they are saved because of Christ's work, not their own.
13"You are the salt of the earth. But if the salt loses its saltiness, how can it be made salty again? It is no longer good for anything, except to be thrown out and trampled by men. 14"You are the light of the world. A city on a hill cannot be hidden. 15Neither do people light a lamp and put it under a bowl. Instead they put it on its stand, and it gives light to everyone in the house. 16In the same way, let your light shine before men, that they may see your good deeds and praise your Father in heaven.
1 Peter 2
11 Beloved, I beg you as sojourners and pilgrims, abstain from fleshly lusts which war against the soul, 12 having your conduct honorable among the Gentiles, that when they speak against you as evildoers, they may, by your good works which they observe, glorify God in the day of visitation.
14 What does it profit, my brethren, if someone says he has faith but does not have works? Can faith save him? 15 If a brother or sister is naked and destitute of daily food, 16 and one of you says to them, “Depart in peace, be warmed and filled,” but you do not give them the things which are needed for the body, what does it profit? 17 Thus also faith by itself, if it does not have works, is dead. 18 But someone will say, “You have faith, and I have works.” Show me your faith without your works, and I will show you my faith by my works.