On the subject of testing God, Luther writes:
Deuteronomy 6 teaches us to trust that God will take care of us in good and bad times. We shouldn't become overconfident in times of plenty, but we also need to patiently endure times of adversity. God will never leave us. He will be near us in our troubles. Unbelievers don't have this confidence in God, because they put their trust in earthly things.
If what we need isn't available to us, we have to rely on God's promises. If we don't rely on God, we are testing him. This is what Moses was writing about when he said, "as you did at Massah." At Massah, Israel complained and asked, "Is the LORD among us or not?" (Ex 17.7). The people didn't trust God's promises because he didn't fulfill them in the time, place, or manner they expected. Therefore, they gave up and stopped believing. When we try to dictate to God the time, place, and manner for him to act, we are testing him. At the same time, we're trying to see if he is really there. When we do this we are putting limits on God and trying to make him do what we want. It's nothing less than trying to deprive God of his divinity. But we must realize that God is free--not subject to any limitations. He must dictate to us the place, manner, and time that he will act.
(from Faith Alone: A Daily Devotional / LW 9:74)
When we talk, think, and write about testing God, we generally think along the same lines Luther discusses here. At the same time, however, we usually fail to draw the conclusion that Luther rightly draws. "If what we need isn't available to us, we have to rely on God's promises. If we don't rely on God, we are testing him" (emphasis mine).
In other words, testing God and/by relying on ourselves is, at its core, a manifestation of the sin of unbelief. We usurp God's throne, make ourselves out to be God, and attempt to take control because we do not trust God...we do not believe as we ought.
"I believe; help my unbelief!" (Mk 9.24, ESV)