The bible often speaks of God trying or testing us. For example, Exodus 16:4 says: 4 Then the LORD said to Moses, “Behold, I will rain bread from heaven for you. And the people shall go out and gather a certain quota every day, that I may test them, whether they will walk in My law or not.(All Scriptural Quotes from New King James Version) Such passages are strong evidence that God has given us the ability to choose between alternatives since the"or not" seems to be up to us. But such passages seem to imply something more than the ability to choose otherwise, they imply that at least in some circumstances we are able to choose good or evil.
God is only able to choose between good options; He cannot sin. Fallen man, without grace, can only choose between sinful options. Same for fallen angels. The blessed in heaven can no longer sin. But when God tests man, we are not limited to only good or only evil; we can choose good or evil.
The ability to choose otherwise seems sufficient for moral responsibly - you don't need to be able to choose good or evil to be responsible for your choices. On the other hand, more is at stake in divine testing than moral responsibility: the Father is seeking people to worship Him in spirit and in truth (John 4:23).
And this helps answer the question of why God didn't create a world in which we only do good, or even the question of why God didn't create a world in which everyone gets saved. God wants a relationship with people who can choose to have a relationship with Him or not.
Here's some passages speaking of God testing or trying us.
1 Now it came to pass after these things that God tested Abraham, and said to him, “Abraham!”
...12 And He said, “Do not lay your hand on the lad, or do anything to him; for now I know that you fear God, since you have not withheld your son, your only son, from Me.”
25 So he cried out to the LORD, and the LORD showed him a tree. When he cast it into the waters, the waters were made sweet. There He made a statute and an ordinance for them, and there He tested them, 26 and said, “If you diligently heed the voice of the LORD your God and do what is right in His sight, give ear to His commandments and keep all His statutes, I will put none of the diseases on you which I have brought on the Egyptians. For I am the LORD who heals you.”
20 And Moses said to the people, “Do not fear; for God has come to test you, and that His fear may be before you, so that you may not sin.”
2 And you shall remember that the LORD your God led you all the way these forty years in the wilderness, to humble you and test you, to know what was in your heart, whether you would keep His commandments or not.
Deuteronomy 131 “If there arises among you a prophet or a dreamer of dreams, and he gives you a sign or a wonder, 2 and the sign or the wonder comes to pass, of which he spoke to you, saying, ‘Let us go after other gods’—which you have not known—‘and let us serve them,’ 3 you shall not listen to the words of that prophet or that dreamer of dreams, for the LORD your God is testing you to know whether you love the LORD your God with all your heart and with all your soul.
Deuteronomy 2011 “Beware that you do not forget the LORD your God by not keeping His commandments, His judgments, and His statutes which I command you today, 12 lest—when you have eaten and are full, and have built beautiful houses and dwell in them; 13 and when your herds and your flocks multiply, and your silver and your gold are multiplied, and all that you have is multiplied; 14 when your heart is lifted up, and you forget the LORD your God who brought you out of the land of Egypt, from the house of bondage; 15 who led you through that great and terrible wilderness, in which were fiery serpents and scorpions and thirsty land where there was no water; who brought water for you out of the flinty rock; 16 who fed you in the wilderness with manna, which your fathers did not know, that He might humble you and that He might test you, to do you good in the end—
Judges 2:20-3:420 Then the anger of the LORD was hot against Israel; and He said, “Because this nation has transgressed My covenant which I commanded their fathers, and has not heeded My voice, 21 I also will no longer drive out before them any of the nations which Joshua left when he died, 22 so that through them I may test Israel, whether they will keep the ways of the LORD, to walk in them as their fathers kept them, or not.” 23 Therefore the LORD left those nations, without driving them out immediately; nor did He deliver them into the hand of Joshua.
1 Now these are the nations which the LORD left, that He might test Israel by them, that is, all who had not known any of the wars in Canaan 2 (this was only so that the generations of the children of Israel might be taught to know war, at least those who had not formerly known it), 3 namely, five lords of the Philistines, all the Canaanites, the Sidonians, and the Hivites who dwelt in Mount Lebanon, from Mount Baal Hermon to the entrance of Hamath. 4 And they were left, that He might test Israel by them, to know whether they would obey the commandments of the LORD, which He had commanded their fathers by the hand of Moses.
1 Chronicles 29
17 I know also, my God, that You test the heart and have pleasure in uprightness. As for me, in the uprightness of my heart I have willingly offered all these things; and now with joy I have seen Your people, who are present here to offer willingly to You.
2 Chronicles 32
31 However, regarding the ambassadors of the princes of Babylon, whom they sent to him to inquire about the wonder that was done in the land, God withdrew from him, in order to test him, that He might know all that was in his heart.
17 “What is man, that You should exalt him, That You should set Your heart on him, 18 That You should visit him every morning, And test him every moment?
10 But He knows the way that I take; When He has tested me, I shall come forth as gold.
8 The LORD shall judge the peoples; Judge me, O LORD, according to my righteousness, And according to my integrity within me. 9 Oh, let the wickedness of the wicked come to an end,
But establish the just; For the righteous God tests the hearts and minds. 10 My defense is of God,
Who saves the upright in heart. 11 God is a just judge, And God is angry with the wicked every day.
12 If he does not turn back, He will sharpen His sword; He bends His bow and makes it ready.
13 He also prepares for Himself instruments of death; He makes His arrows into fiery shafts.
4 The LORD is in His holy temple, The LORD’s throne is in heaven; His eyes behold, His eyelids test the sons of men. 5 The LORD tests the righteous, But the wicked and the one who loves violence His soul hates.
Psalm 17:2-42 Let my vindication come from Your presence; Let Your eyes look on the things that are upright.
3 You have tested my heart; You have visited me in the night; You have tried me and have found nothing; I have purposed that my mouth shall not transgress. 4 Concerning the works of men,
By the word of Your lips, I have kept away from the paths of the destroyer.
1 Vindicate me, O LORD, For I have walked in my integrity. I have also trusted in the LORD;
I shall not slip. 2 Examine me, O LORD, and prove me; Try my mind and my heart. 3 For Your lovingkindness is before my eyes, And I have walked in Your truth.
10 For You, O God, have tested us; You have refined us as silver is refined. 11 You brought us into the net; You laid affliction on our backs. 12 You have caused men to ride over our heads; We went through fire and through water; But You brought us out to rich fulfillment.
Psalm 81:7-117 You called in trouble, and I delivered you; I answered you in the secret place of thunder; I tested you at the waters of Meribah. 8 “Hear, O My people, and I will admonish you! O Israel, if you will listen to Me! 9 There shall be no foreign god among you; Nor shall you worship any foreign god.
10 I am the LORD your God, Who brought you out of the land of Egypt; Open your mouth wide, and I will fill it. 11 “But My people would not heed My voice, And Israel would have none of Me.
16 Moreover He called for a famine in the land; He destroyed all the provision of bread.
17 He sent a man before them— Joseph—who was sold as a slave. 18 They hurt his feet with fetters,
He was laid in irons. 19 Until the time that his word came to pass, The word of the LORD tested him.
3 The refining pot is for silver and the furnace for gold, But the LORD tests the hearts.
17 I said in my heart, “ God shall judge the righteous and the wicked, For there is a time there for every purpose and for every work.” 18 I said in my heart, “Concerning the condition of the sons of men, God tests them, that they may see that they themselves are like animals.” 19 For what happens to the sons of men also happens to animals; one thing befalls them: as one dies, so dies the other. Surely, they all have one breath; man has no advantage over animals, for all is vanity.
Isaiah 48“ For My name’s sake I will defer My anger, And for My praise I will restrain it from you,
So that I do not cut you off. 10 Behold, I have refined you, but not as silver; I have tested you in the furnace of affliction
7 Therefore thus says the LORD of hosts: “ Behold, I will refine them and try them; For how shall I deal with the daughter of My people?
20 But, O LORD of hosts, You who judge righteously, Testing the mind and the heart, Let me see Your vengeance on them, For to You I have revealed my cause.
3 But You, O LORD, know me; You have seen me, And You have tested my heart toward You. Pull them out like sheep for the slaughter, And prepare them for the day of slaughter.
Jeremiah 1710 I, the LORD, search the heart, I test the mind, Even to give every man according to his ways,
According to the fruit of his doings
12 But, O LORD of hosts, You who test the righteous, And see the mind and heart, Let me see Your vengeance on them; For I have pleaded my cause before You.
9 I will bring the one-third through the fire, Will refine them as silver is refined, And test them as gold is tested. They will call on My name, And I will answer them. I will say, ‘This is My people’;
And each one will say, ‘The LORD is my God.’”
5 Then Jesus lifted up His eyes, and seeing a great multitude coming toward Him, He said to Philip, “Where shall we buy bread, that these may eat?” 6 But this He said to test him, for He Himself knew what He would do.
2 Corinthians 8
1 Moreover, brethren, we make known to you the grace of God bestowed on the churches of Macedonia: 2 that in a great trial of affliction the abundance of their joy and their deep poverty abounded in the riches of their liberality
1 Thessalonians 2
4 But as we have been approved by God to be entrusted with the gospel, even so we speak, not as pleasing men, but God who tests our hearts
2 My brethren, count it all joy when you fall into various trials, 3 knowing that the testing of your faith produces patience.
1 Peter 1
6 In this you greatly rejoice, though now for a little while, if need be, you have been grieved by various trials, 7 that the genuineness of your faith, being much more precious than gold that perishes, though it is tested by fire, may be found to praise, honor, and glory at the revelation of Jesus Christ
1 Peter 4
12 Beloved, do not think it strange concerning the fiery trial which is to try you, as though some strange thing happened to you; 13 but rejoice to the extent that you partake of Christ’s sufferings, that when His glory is revealed, you may also be glad with exceeding joy.
By faith Abraham, when he was tested, offered up Isaac, and he who had received the promises offered up his only begotten son
10 Because you have kept My command to persevere, I also will keep you from the hour of trial which shall come upon the whole world, to test those who dwell on the earth.
Testing is of individuals, groups, nations or the whole world. Testing is a pervasive theme in scripture; Job even says God tests us at every moment, although some tests are specific to a certain hardship. Some times God tests our faith in His promises, other times He tests our obedience to His commands. Specifically, God tests our hearts and minds. One of the purposes of testing is stated to be so that we may know were we stand; another purpose is stated in terms of God knowing what we will do. Testing is said to be for our good and also to give to every man according to their ways.
One final closing thought - God does not temp us; He tests us. The Devil temps us but God is Holy and does not temp us. 12 Blessed is the man who endures temptation; for when he has been approved, he will receive the crown of life which the Lord has promised to those who love Him. 13 Let no one say when he is tempted, “I am tempted by God”; for God cannot be tempted by evil, nor does He Himself tempt anyone. 14 But each one is tempted when he is drawn away by his own desires and enticed. 15 Then, when desire has conceived, it gives birth to sin; and sin, when it is full-grown, brings forth death. (James 1:12-15). When we are tempted, God does not want us to fail; He provides us a way out. No temptation has overtaken you except such as is common to man; but God is faithful, who will not allow you to be tempted beyond what you are able, but with the temptation will also make the way of escape, that you may be able to bear it. (1 Corinthians 10:13) Satan, however, walks about like a roaring lion, seeking whom he may devour. (1 Peter 5:8) So Christ warns us to watch and pray, lest you enter into temptation (Mark 14:38). Yet circumstantially, trials and temptations may have a lot in common. The key difference between trials and temptations is that the Devil wants you to fall, but God wants you to be able to say " 3 You have tested my heart; You have visited me in the night; You have tried me and have found nothing; I have purposed that my mouth shall not transgress. 4 Concerning the works of men,
By the word of Your lips, I have kept away from the paths of the destroyer. (Psalm 17)