Answer:
The two groups must be as similar as possible. They should be demographically homogeneous and have similar academic performance so as the only variable that is different is the one is tested (extra homework assigned)
Explanation:
In this case the scientific method is using an experimental group (the 8th grade class that has extra homework problems) and a control group (the 8th grade class that has not extra homework problems) in order to prove if extra homework helps students learn algebra.
In order to be a valid experiments the two groups should present exactly the same characteristics, except for the variable studied, so they must be as homogeneous as possible.