It is important to make sure that when conducting a controlled experiment to test an hypothesis, all the variables are the same in two test groups except for the independent variable.
In a controlled experiment, the group that is testing the independent variable is called the experimental group. The other group that does not test this variable is called the control group. By comparing both groups, one can see the effect (if there is one) of the independent variable on the research. How the group reacts to the independent variable is called the dependent variable.
All other variables in each group are kept the same. This will allow the researcher to see if the tested variable is responsible for a result in the research.
For example--a researcher may wish to test the hypothesis that exercise before an exam will result in higher test scores. The independent variable is exercise and the test scores are the dependent variable. Two groups are organized into an experimental or tested group and a control group. The experimental group gets to exercise for a pre-determined amount of time before taking an exam. The control group does not exercise and simply takes the exam.
However, all other variables are kept the same in each group--amount of participants, same exam, same room, same amount of males and females, same age group, etc. This will allow the researcher to see whether her hypothesis is accepted or rejected.
I have included a link to the steps a scientist follows when conducting a controlled experiment.