Have each student contribute test cases to a class-wide testing suite for assignments in order to get students thinking about edge cases and improving their implementations.

  • Use this testing suite on every turned in assignment.
    • Using the testing suite on each submission will provide accountability for their test cases and give students more ownership over the course.
  • Encourage students to create robust test cases that break as many submitted implementations as possible to motivate students better test case writing.
    • Tell students the goal of creating test cases is to break the most submitted assignments.
    • Knowing that their classmates are going to be trying to break their implementations should help encourage students to write and submit more robust work.
  • Thinking about edge cases will get students to think through how their code should handle each case.
    • Have students write test cases before they write code to get them thinking about what could possibly go wrong and how to avoid it.
      • Be sure to stress the importance of recognizing edge cases when talking about writing test cases.

More about this tip

External Source
Interview with Ellen Spertus