לְמַ֛עַן נַסּ֥וֹת בָּ֖ם אֶת־יִשְׂרָאֵ֑ל הֲשֹׁמְרִ֣ים הֵם֩ אֶת־דֶּ֨רֶךְ יְהוָ֜ה לָלֶ֣כֶת בָּ֗ם כַּאֲשֶׁ֛ר שָׁמְר֥וּ אֲבוֹתָ֖ם אִם־לֹֽא׃
that by them I may prove Israel, whether they will keep the way of the LORD to walk therein, as their fathers did keep it, or not.’
Rashi on Judges
Whether they observe. The letter ה is vocalized with the abridged pasach,15This vocalization is used to express inquiry. as it expresses the inquiry involved in testing.
Metzudat David on Judges
IN ORDER TO TEST: It wants to teach that because of this, Hashem chose this punishment, and not others in order to test Israel if they will serve their GD or if not. And this is why its written "if they will guard."