Pedagogical pros and cons of requiring undergraduate students to follow open/reproducible research practices? I regularly teach an undergraduate course in which students are expected to complete projects that involve writing code. I also supervise undergraduates in other project and thesis work that involve writing code.

I am considering requiring future students to publicly release their project code, and any other materials needed to reproduce their work, under an open source license. (This would, of course, be stated up front in the syllabus, or before I agree to supervise a thesis student.)

(Fortunately, the research platform on which my students work is very well suited for reproducible research, having been designed specifically with that goal in mind.)

On the one hand, I have this vague idea that it's to the students' benefit to practice participating in open, reproducible science.

On the other hand, students may feel reluctant to release their code (for all of the reasons documented here). Furthermore, I want to avoid things that distract too much from the main goals of the course, which don't directly involve reproducible research.

Are there any specific pedagogical arguments for or against instituting this requirement?

(Note that I'm asking about the pedagogical impact on my students, not the benefit to the broader research community of having my students do open science.)
I applaud your willingness to further your student's contributions to open source. 

There are lots of pros:


Build student's reputations (ancillary to professor and institution)
Create value for society
Students will have an even greater stake in code they know will reflect on themselves, and as a result will go to greater lengths to ensure they demonstrate learning and excellence.


Con:


Students (and stakeholders) may not wish to publish because of fear of negative impact to reputation.


Well, masters' theses and doctoral dissertations are, in most institutions that I'm aware of, are all supposed to be bound and stored accessible to the public, even if the public never reads it. 

In all likelihood, the bad stuff will get rarely read or used. The good stuff will never get enough attention, but it will get far more than the bad. 

Conclusion

It's a risk worth taking, but bounce it off your department head and be certain that they agree. They may decide that since they're undergraduates, it's unfair and not proportionate to require them to publish. Or they may insist that the requirement appear ahead of time in the course catalogue description.