By all accounts, forty years was an awfully long time to wander in the desert. In Deuteronomy 8,
Abravanel provides three reasons for the testing trek.

“And you shall remember all the way which God your Almighty has led
you these forty years in the wilderness, that He might afflict you, to test
you, to know what was in your heart – whether you would keep His
commandments, or not.”

Here is the backstory. Moses anticipated that his co-religionists would try to shirk their Torah
responsibilities, claiming the commandments too burdensome. They might, the prophet figured, point
to negative health repercussions for arduous Torah study. Moreover, Moses calculated, the people
might seek to evade their religious responsibilities, asserting that the time commitment would sap their
energy to earn fair wages; they’d slip below the poverty line.

Moses prepared rebuttals about an alleged impairment or quality of life, let us call them. "And you shall
remember all the way which God your Almighty has led you these forty years in the desert." Should the
truth be told, at God's hand, wandering Jews had suffered not a little during the wilderness trek. "He
sent hardships to test you, to know what is in your heart…."

Forty years of tribulation in a merciless wasteland is, of course, no picnic. Snakes, scorpions, parched
throats, hostile landscapes incapable of supporting fig trees and vineyards and pomegranates – the trek
had been grueling.

Yet still, the "madness" of the wandering in the desert was not without its method – three methods to
be exact. One, forty years of "hardships" is apt payback for a people who exited Egypt laden with
egregious sin, baggage aplenty. To wit, they had irreverently spoken out against the Creator and the
prophet. A laborious slog would wear out ornery and incorrigible campers, men with an attitude.

Two, "to test you" should be viewed as an open ended, obstacle course. In Egypt, Hebrews were used to
construction work, toiling in bricks and mortar. Still, they had not undergone any other types of pain or
difficulty. They needed the hellish experience of the journey through the wasteland to break them.
Dismal desert conditions would probe and push them to their limits.

Three,"to know what is in your heart, whether you would keep His commandments or not." To start
with, this verse does not suggest that God lacked foreknowledge about the people's intent, and thus He
devised a test to gain clarity. Before His heavenly throne there are no gaps in knowledge. Similarly, we
reject the notion that He desired, by putting Hebrews to the test, to impart the results to those
undergoing the test, as one commentator puts forth. The key to understanding our verse lies with the
verb "to know." That is, the Hebrew letter prefix here does not come to teach causality or "for the
purpose of knowing"

Rather, here is the upshot. The Maker marched them up, down, and around sand dunes, exposing them
to dust storms for forty years precisely because He knew "what was in your heart, whether you would
keep His commandments or not." He understood His campers all too well. Plumbing their mischievous
minds, God found much ill. They would jettison the commandments in the Holy Land at first chance. For
that reason, He marshalled them to a barren hellhole, where an expendable generation perished.

But for our purposes here, at the end of God's experiment, He would select the best and most stout of
moral rectitude to bring into the land. They would cling tenaciously to Torah observance – through thick
and thin.

"To know what is in your heart, whether you would keep His commandments or not" – the Maker
accurately evaluated fair weather Hebrews' potential for leading upstanding lives, winnowing out chaff.
Interesting, this message lurks hidden within the phrase (but does not jump out of it), "whether you
would keep His commandments or not." It reflects God's concern for the people's honor, and not
trumpeting their lack of commitment. Similarly, and out of heightened sensitivity, "He sent hardships to
test you to know what is in your heart" should be understood as if said in an undertone.

In sum, Abravanel ascertained God’s rationales for causing the Jews to wander decade after decade.