A Testing EXercise (From Glenford Myers: The Art of Software Testing A 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 isoceles or equilateral On a sheet of paper, write a set of test cases(i.e, specific sets of data) that you feel would adequately test this program Copyright Nancy Leveson, Sept. 1999
A Testing Exercise: (From Glenford Myers: The Art of Software Testing) A 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, isoceles, or equilateral. On a sheet of paper, write a set of test cases (i.e., specific sets of data) that you feel would adequately test this program. c Copyright Nancy Leveson, Sept. 1999 �
Basic Testing Guidelines A test case has two parts: 1. Description of input data 2. Precise description of correct output for that input a programmer should avoid testing his or her programs A programming organization should not test its own programs The results of each test should be thoroughly inspected (lots of errors are missed) Test cases must be written for invalid and unexpected as well as valid and expected input conditions Copyrigh o Nancy Leveson, Sept 1999
Basic Testing Guidelines A test case has two parts: 1. Description of input data 2. Precise description of correct output for that input A programmer should avoid testing his or her programs. A programming organization should not test its own programs. The results of each test should be thoroughly inspected (lots of errors are missed). Test cases must be written for invalid and unexpected as well as valid and expected input conditions. c Copyright Nancy Leveson, Sept. 1999 �
Basic Testing Guidelines(2) Examining a program to see if it does not do what it is supposed to do is only half the battle. The other half is seeing whether the program does what it is not supposed to do(i.e, must examine for unintended function and side effects Avoid throw-away test cases unless the program is a throw-away program Test cases are a valuable investment --regression testing Do not plan a testing effort under the tacit assumption that no errors will be found Nancy Leveson, Sept. 1999
Basic Testing Guidelines (2) Examining a program to see if it does not do what it is supposed to do is only half the battle. The other half is seeing whether the program does what it is not supposed to do (i.e., must examine for unintended function and side effects. Avoid throw-away test cases unless the program is a throw-away program. Test cases are a valuable investment -- regression testing. Do not plan a testing effort under the tacit assumption that no errors will be found. c Copyright Nancy Leveson, Sept. 1999 �
Basic Testing Guidelines 3) The probability of the existence of more errors in a section of a program is proportional to the number of errors already found in it prob more errors errors already found Testing is an extremely creative and challenging task Exceeds creativity required in designing program Dont put your worst or newest people here Copyright Nancy Leveson, Sept 1999
Basic Testing Guidelines (3) The probability of the existence of more errors in a section of a program is proportional to the number of errors already found in it. prob. of more errors # errors already found Testing is an extremely creative and challenging task. Exceeds creativity required in designing program. Don’t put your worst or newest people here. Copyright Nancy Leveson, Sept. 1999 c �
Building Assurance(Confidence) Dynamic Analysis Static Analysis Quality Assurance(conformance to standards V&v of non-software lifecycle products (e.g, user manual) Acceptance(user)testing Copyright Nancy Leveson, Sept. 1999
Building Assurance (Confidence) Dynamic Analysis Static Analysis Quality Assurance (conformance to standards) V&V of non-software lifecycle products (e.g., user manual) Acceptance (user) testing Copyright Nancy Leveson, Sept. 1999 c �