The wages of sin are death. There are none righteous, no not one. The righteousness of God is by faith of Jesus Christ unto all and upon all them that believe. For those who believe on Him that justifieth the ungodly, their faith is counted for righteousness. We are justified freely by his grace through the redemption that is in Christ Jesus.
Salvation is conditional on righteousness.
Righteousness is conditional on faith. Faith may be tested Just as acidity may be tested using well know reactions, faith may be tested. James tells us that genuine faith produces a reaction - works. Works, such as feeding the poor, or caring for the sick are examples of fruit which faith produces. They are done without the expectation of reward or recognition.