3 ms·
https://en.wikipedia.org/wiki/Test-driven_development https://en.wikipedia.org/wiki/Test-driven_development is good for teaching programming
by known 10y ago
https://en.wikipedia.org/wiki/Test-driven_development https://en.wikipedia.org/wiki/Test-driven_development is good for teaching programming
- teach 10y agoI disagree with this for true, absolute beginners. In order to do TDD, students have to know enough to write an object with methods or -- at minimum -- a function. My students do seven assignments before they even see a variable. They've done 25 assignments before they write an if statement. They do 76 assignments before they see a function. My second-year kids can do TDD and it works pretty well. But for students with literally zero experience coding, TDD means you're skipping a LOT of basics. Or throwing a lot of unnecessary complexity at them before they even know the basics.
- akkartik 10y agoDo you have any pointers to such assignments? I've been teaching programming 1-on-1 with mild success by introducing concepts related to teaching fairly early: http://akkartik.name/post/mu http://akkartik.name/post/mu. But I'm very conscious of what I don't know, and eager to learn more.
- teach 10y agoThese were my classroom assignments in 2012. My current assignments use my book, but the basic sequence is the same. https://programmingbydoing.com/ https://programmingbydoing.com/
- akkartik 10y agoThanks! Drat, I just realized that I mistyped my original comment. I meant to say, "I've been teaching programming 1-on-1 with mild success by introducing concepts related to _testing_ fairly early.." Hopefully that wasn't too confusing.
- lfowles 10y agoI think TDD for beginners works if you approach it from a different angle. The teacher should already have a TDD suite ready that the student then verifies against. This is how several of my college classes approached assignments. The only issue I had at the very beginning was not understanding that we shouldn't modify the tests ;)
- teach 10y agoAgain, my students have to do over 70 labs before they can even write a function. If you can write a TDD suite to test those first 69 labs then my hat's off to you. I think we have different definitions of the word "beginner".
- laurieg 10y agoTeaching programming with test driven development is like teaching French to absolute beginners. In French. Over the phone. Absolute beginners have trouble looking at foo = bar; and understanding that variables do something different on either side of the equals symbol (which helpfully is doing a different job to what it does in their math class). TDD I just adding another layer of misunderstanding and complexity when you need simplicity and clear concepts.
- psyklic 10y agoI have tried teaching TDD to complete beginners (mandated curriculum), and it was a disaster. Unfortunately, only a few students were able to write tests that meaningfully deviated from the examples we discussed. The issue is they were struggling with writing the main routines themselves. So, writing tests that did nothing initially (and gave no feedback) was very difficult. They often could not tell if they were doing it correctly.
- wpietri 10y agoI'd believe it. What I have seen work is automated tests used as a way to guide learners forward. A friend did it to teach Ruby novices and he was very happy with the approach. I even got to try it myself recently. The IntelliJ people have a nice setup for learning their new language Kotlin. Every exercise is driven by automated tests: http://try.kotlinlang.org/ http://try.kotlinlang.org/ I'd love to see this approach tried seriously with programming novices. Partly because I think it's a good learning experience. And partly because people get used to testing from the beginning.