BDBD is Psalm 26:2-3

After asking the Lord to vindicate him, David makes a rather unusual and bold request. To support his claim of living a blameless life he wants the Lord to test him. When I want to test the quality of an item, I invoke a procedure for critical evaluation. If it is important I will rigorously determine the quality and truth of a claim.

David’s request to be tested was not something new. Perhaps he was thinking of Abraham when he was asked to offer his son Isaac as a sacrifice to test him. (Genesis 22) Or perhaps David read the times when Israel grumbled against Moses and Aaron. Then the Lord God said, “I will rain down bread from heaven for you. The people are to go out each day and gather enough for that day. In this way, I will test them and see whether they will follow my instructions… to know what was in their heart… so that in the end it might go well with them.” (Exodus 16:4-5, 17:2; Deuteronomy 8:2, 16) Or he read when they received the ten commandments Moses relayed to them, “Do not be afraid. God has come to test you, so that the fear of God will be with you to keep you from sinning.” (Exodus 20:20)

God tests those he loves. I have been and will undergo tests, to see the quality of my faith and love. (Galatians 6:4; 2 Corinthians 8:8) “Blessed is the man who perseveres under trial because when he has stood the test, he will receive the crown of life that God has promised to those who love him.” (James 1:12)