добавить свой файл
  1 ... 4 5 6 7 8 9

Appendix D: Sample Assignments

Assignment 1: Create a first test case chart

In lecture, we brainstormed answers to the following:

The program reads three integer values from a card. The three values are interpreted as representing the lengths of the sides of a triangle. The program prints a message that states whether the triangle is scalene, isosceles, or equilateral.

      • From Glen Myers, The Art of Software Testing

  • Write a set of test cases that would adequately test this program.

  • Please write your name on your answer so that I can return it to you. Hand it in when you are done.

Let’s take one more crack at Myers’ exercise. I’d like a table like this from you that lists 5 good test cases:


Test Case


Why this test is powerful

Expected Result


























Where the columns are defined as:

  • Test—fill in the test case number

  • Test case—be specific about the inputs that you’ll feed the program. For example, 1,1,2

  • Risk—be specific about the error you are trying to detect. For example (from 1,1,2), the risk is that the program might accept a “triangle” that has side 1 + side 2 = side 3.

  • Why this test is powerful—A test is powerful, compared to other tests, if it is more likely to expose a failure than they are. If you test for a specific type of failure (the risk), use a powerful test – one that is at least as likely to expose that failure as any other. To fill in this part of the answer, explain why you think the test you chose is powerful. It might be helpful to provide examples of similar tests that are less powerful than this one. If you think that this test is equivalent to many others (no more, no less powerful), say “Equivalent” and list 2 or 3 other tests that you think are equivalent to this one. This is an easy answer—but if I can easily spot a better test against the same risk, you won’t get credit for saying “equivalent”.

  • Expected result—What should the program do? You might respond, “Error Message.”

Assignment Instructions

  • Feel free to work in groups

  • If you work with others, make sure to name them.

  • If you work in a group, it is OK for the group to hand in one collective answer that you all co-sign. (Just provide your name, I don’t need your student number.) However, if you co-sign it, you must be able to able to explain EVERY test case that you have on the page.

  • I expect better work from a group than from individuals and I will mark accordingly.

  • If you work in a group, I expect 5 tests from each of you. So, if there are two of you in the group, the assignment should contain 10 tests.

  • Please don’t submit 100 tests. Pick 5 good ones per person. Prioritizing among possible tests is one of the important skills of good testers.

Grading Rubric for the Triangle problem

This rubric is given to the students. For each test, the first column indicates the points to be awarded if you give an answer that has the characteristics listed in the second column. Each test can be awarded up to 10 points.

Test Case:


Values for the sides of a triangle not provided or incorrect.


Values for the sides of the triangle provided and correct.



Implausible or generic to the point of no value. Not a risk.


Generic Risk statement, Vague not related to power.


Less clear or less plausible but related to power.


Clear statement of plausible risk not related to power or

Less clear or less plausible risk but related to power.


Clear statement of plausible risk related to power.



No clear linkage between the power discussion and the risk.


Shows that the test can detect the error identified in the risk.


The test can detect an error, indicate how or why and provide some comparison to other tests. Some indication that this is a good test.


Good comparison examples but weak explanation otherwise. A sufficiently strong explanation but without examples. Must indicate this is better than the others.


State the principles under which this is more powerful and gives a persuasive example.

Expected Result:


Expected result not provided or incorrect.


Expected result provided and correct.

<< предыдущая страница   следующая страница >>