Westminster Confession of Faith, Chapter 19, Section 6:
Although true believers be not under the law, as a covenant of works, to be thereby justified, or condemned; yet is it of great use to them, as well as to others; in that, as a rule of life informing them of the will of God, and their duty, it directs and binds them to walk accordingly; discovering also the sinful pollutions of their nature, hearts, and lives; so as, examining themselves thereby, they may come to further conviction of, humiliation for, and hatred against sin, together with a clearer sight of the need they have of Christ, and the perfection of his obedience. It is likewise of use to the regenerate, to restrain their corruptions, in that it forbids sin: and the threatenings of it serve to show what even their sins deserve; and what afflictions, in this life, they may expect for them, although freed from the curse thereof threatened in the law. The promises of it, in like manner, show them God’s approbation of obedience, and what blessings they may expect upon the performance thereof: although not as due to them by the law as a covenant of works. So as, a man’s doing good, and refraining from evil, because the law encourageth to the one, and deterreth from the other, is no evidence of his being under the law; and, not under grace.