Still excited from the Login page example I thought I’d try something a little tougher…one that requires a bit of knowledge (trivia) in addition to just the ability to write test cases.
The Glen Myers triangle problem is a classic problem in computer graphics that involves rendering a 3D triangle onto a 2D display. Here are some test cases for the Glen Myers triangle problem:
- Test the case where all three vertices of the triangle are in front of the viewer.
- Test the case where all three vertices of the triangle are behind the viewer.
- Test the case where two vertices of the triangle are in front of the viewer and one is behind.
- Test the case where two vertices of the triangle are behind the viewer and one is in front.
- Test the case where one vertex of the triangle is in front of the viewer and two are behind.
- Test the case where the triangle is completely contained within the viewer’s field of view.
- Test the case where the triangle is partially contained within the viewer’s field of view.
- Test the case where the triangle is partially outside of the viewer’s field of view.
- Test the case where the triangle is a degenerate triangle (i.e., all three vertices are collinear).
- Test the case where the triangle is a right triangle.
Aha! It’s not so smart after all! That’s not the triangle problem from The Art of Software Testing by Glenford J. Myers (1979). Just a few prompts in and I caught ChatGPT hallucinating!
In the context of generative AI agents like ChatGPT, a hallucination is where the agent makes up “facts” that are not true, generally by making (incorrect) inferences from its existing training data.
Seeing something like this confirmed what I was seeing and reading–that generative AI agents are like eager personal assistants who are so keen to deliver an answer that they’ll guess (make things up) if they don’t know.
So I figured I needed to do what I’d do when a student gave a confident but wrong answer:
Oh, I apologize for misunderstanding your question. Here are some test cases for the triangle classification problem:
- Test the case where all three sides are equal. (equilateral triangle)
- Test the case where two sides are equal and one is different. (isosceles triangle)
- Test the case where all three sides are different. (scalene triangle)
- Test the case where two sides are equal and the third is zero.
- Test the case where all three sides are zero.
- Test the case where two sides are equal and the third is negative.
- Test the case where all three sides are negative.
- Test the case where two sides are equal and the third is very large.
- Test the case where all three sides are very large.
- Test the case where two sides are equal and the third is very small.
Nice…That’s the triangle problem I was thinking about. It didn’t get everything from the Myers book but it was close enough for just getting started.

Leave a Reply
You must be logged in to post a comment.