| One thing I do with my beginning programming students (since their programs are tiny) is make them write out "test plans" on paper before they can write their program code. They have to write the inputs and then the expected results. It gets them thinking about the concept of using tests as part of the design practice. Later, I give them the unit tests and they have to write the code. This is usually a rewritten version of a previous program so they see the text-based test plans in action as unit tests. Then I might give them the empty test and an empty implementation, asking them to fill in the test first, then the implementation. Finally I ask for a completely new feature, and they have to figure out how to write the test. And I ask them to go about it with a test plan. After a few semesters of this, I think I'm ready to say that this is successful for getting the "beginners" there. It doesn't address everything, but I think it's a good start. |