אבן עזרא
Ibn Ezra on Exodus 17:2
Q — At Refidim the people complain about water and Moshe responds "מה תריבון עמדי מה תנסון את ה'" — and the place is then named "מסה ומריבה." But if the people had no water, what testing of God is going on? They're thirsty!
A — Ibn Ezra picks up a textual signal: the verse says "וירב העם" (the people), not "כל העם" (all the people, as in the manna episode). Two distinct groups: one truly out of water — who fought Moshe (מריבה); a second group that still had water saved from the previous stop at Alush — who deliberately TESTED God to see if He would provide (מסה). Moshe addresses each group separately: "מה תריבון עמדי" (to the thirsty — fighting won't help, we'll all call out to God), "מה תנסון את ה'" (to the testers). The double name follows: מסה for the testers, מריבה for the strivers. Bonus: the chiastic "מסה ומריבה / על ריב בני ישראל / ועל נסותם את ה'" — Ibn Ezra notes "משפט לשון הקודש" that Tanach typically explains the LATER-mentioned item first. And the warning in Devarim ("לא תנסו את ה' אלקיכם כאשר נסיתם במסה") names only מסה — the testing was the worse sin.
וירב. הזכיר העם, ולא כל העם, כאשר הזכיר בדבר המן, כי שתים כתות היו. האחד אין להם מים לשתות, והיא העושה מריבה עם משה. והשנית, יש להם מים שהביאו מאלוש, והיא הרוצה לנסות את ה' אם יתן מים... וזאת הכת השניה הכעיסה ה' יותר מן הראשונה, על כן אמר לא תנסו את ה' אלהיכם כאשר נסיתם במסה.