Unit Testing

Instructor notes for Unit Testing

These are general notes about this assignment. They primarily for course instructors. These notes may also be useful to you if you are a student, particularly if you had to miss class or if you need a reminder of what happened. However, beware:

  • This is just a sketch. Actual lectures, demos, and discussions will include many details that do not appear in these notes.
  • An individual instructor might decide to do something additional or even entirely different that doesn’t appear in these notes.
  • There is often spontaneous discussion in class. That won’t appear in these notes.

This page is therefore not a substitute for attending class and taking your own notes.

Instructor notes: unit testing

From Dan, fall 2025: let’s ask chatbots to make an assignment and see what they do.

Prompt:

You are a college computer science teacher, teaching an introductory Java course. Write an assignment on unit testing. The focus should be on the concepts of unit testing and not the details of Java and junit. Include exercises that show the limitations of unit testing including missed test cases, incomplete code coverage, why 100% coverage is not sufficient, and how code can still have bugs even with good test cases. Think hard and make a high quality, well sequenced, and efficient prompt that has questions on explaining code and its flaws as well as writing short snippets of code. Include a markdown-formatted version of the assignment prompt. Include text for the student explaining the overall purpose and concepts in the assignment and how the assignment will be assessed.

Neither response is a drop-in replacement but both have some good exercises, ideas, and questions. We could consider using those in the future.