Context: Educators often encourage students to engage in active learning by generating explanations for the material being learned, a method called self-explanation. Studies have also demonstrated that repeated testing improves retention. However, no studies have directly compared the two learning methods. Methods: Forty-seven Year 1 medical students completed the study. All students participated in a teaching session that covered four clinical topics and was followed by four weekly learning sessions. In the learning sessions, students were randomised to perform one of four learning activities for each topic: testing with self-generated explanations (TE); testing without explanations (T); studying a review sheet with self-generated explanations (SE), and studying a review sheet without explanations (S). Students repeated the same activity for each topic in all four sessions. Six months later, they took a free-recall clinical application test on all four topics. Results: Repeated testing led to better long-term retention and application than repeatedly studying the material (p < 0.0001, η2 = 0.33). Repeated generation of self-explanations also improved long-term retention and application, but the effect was smaller (p < 0.0001, η2 = 0.08). When data were collapsed across topics, both testing conditions produced better final test performance than studying with self-explanation (TE = 40% > SE = 29% [p = 0.001, d = 0.70]; T = 36% > SE = 29% [p = 0.02, d = 0.48]). Studying with self-explanation led to better retention and application than studying without self-explanation (SE = 29% > S = 20%; p = 0.001, d = 0.68). Our analyses showed significant interaction by topic (p = 0.001, η2 = 0.06), indicating some variation in the effectiveness of the interventions among topics. Conclusions: Testing and generating self-explanations are both learning activities that can be used to produce superior long-term retention and application of knowledge, but testing is generally more effective than self-explanation alone.