RASHI
1.
You have visited [me] at night.
at evening time for the iniquity of Bathsheba, concerning which it is stated (Shmuel II - II Samuel 11:2) “And it came to pass at the time of evening, that David arose, ...”
2.
You have refined me...
You have tested me.
[NOTE:
(צָרַף) (tsaraph) - to smelt, refine, test
Smelting a metal (ex. gold, silver) separates impurities.
So this line can be interpreted with a positive connotation (found no impuriities),
OR with a negative connotation (the refining process did not produce a fully clean outcome).
Multiple translations exist with different interpretations.
]
...and found nothing;
You have not found in me Your desire.
I determined, [that] should not pass my mouth.
If it enters my thoughts again to be tried before You, let it not pass my mouth to say again, “Try me, O Lord, and test me,” as I have already said, as is written (26: 2) “ Try me, O Lord, and test me,” for David asked the Holy One, blessed be He, “Why do they say, ‘the God of Abraham,’ yet they do not say, ‘the God of David’?” He replied, “I tested him with ten tests, and he was found perfect.” He [David] said, “Try me and test me,” as appears in tractate Shabbath (?).