בְּחָנֵ֣נִי יְהוָ֣ה וְנַסֵּ֑נִי צרופה [צָרְפָ֖ה] כִלְיוֹתַ֣י וְלִבִּֽי׃
여호와여 나를 살피시고 시험하사 내 뜻과 내 마음을 단련하소서
Rashbam
והאלוקים נסה את אברהם, G’d now subjected Avraham to a painful test, something which was bound to cause him grief. Whenever the root נסה occurs, such as in Job 4,2 or Exodus 17,7 or Psalms 26,2 the connotation is an unpleasant one for the one being subjected to it. In this instance, G’d, so to speak, indicated to Avraham that he had been foolish to think that he could guarantee’s Yitzchok’s and his descendants well being into the future, as he might have to terminate his life before he even had produced any offspring who would be called upon to honour his father’s deal with Avimelech. We find that the ark of the covenant spent seven months in Philistine captivity as a result of Avraham having made such an unauthorised pact with Avimelech (Samuel I 6,1). The seven months corresponded to the seven sheep Avraham had gratuitously given to Avimelech. G’d swore that as a result the Philistines would fight seven wars against the Israelites in which they would be victorious. These wars occurred during the time of Shimshon, Chofni, Pinchos, Sha-ul, and the three sons of Sha-ul who were killed. Another approach: as a result of Avraham’s high-handed act seven altars (public altars equivalent of temples) were destroyed by the enemies of the Jewish people after they entered the Holy Land Land, They were: Moses’ Tabernacle, Gilgal, Nov, Shiloh, Givon and the two Temples in Jesrusalem. (copied from Midrash Shemuel by the editor of Rash’bam) According to still another version G’d’s ark would repose in the land of the Philistines for 7 months.
Rashi
If I think, let it 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 (?).
Rashi
in order that You be justified in Your conduct like במנהגך, in Your conduct. I had the strength to overpower my evil inclination, but, so that they should not say, “The servant overpowered his master,”for I said to You (Ps. 26: 2), “Test me, O Lord, and try me,” and You tested me and I was not found perfect, in order that You should be justified and not I (Sanh. 107a). Another explanation: in order that You be justified in Your conduct If You forgive me, You will be justified in Your judgment against all the wicked who do not repent, so that they will not be able to say, “If we had repented, it would not have availed us.”