God tests the millions of pieces of creation that have free will. Will they choose to cleave to Him - their literal Maker - or will they do the other thing? That is the test.
A being created by an infallible being, should technically not err when given free choices as well...