We usually think of a test as a thermometer: it measures learning that happened somewhere else. A large body of research says tests also cause learning. Retrieving an answer from memory strengthens that memory more than seeing the answer again. This is called the testing effect, or retrieval practice.
The classic experiment
Roediger and Karpicke (2006) had students learn short prose passages under three schedules in one session: read the passage four times; read it three times and then write down everything they could recall; or read it once and recall it three times. Students then took a final recall test either five minutes or one week later.