{[ promptMessage ]}

Bookmark it

{[ promptMessage ]}

Lec01_SciOfPgm_Prop_Logic

# Lec01_SciOfPgm_Prop_Logic - Illinois Institute of...

This preview shows pages 1–3. Sign up to view the full content.

This preview has intentionally blurred sections. Sign up to view the full version.

View Full Document
In testing, we run a program and verify that it behaves correctly. F. Neither Reasoning or Testing is Better Than the Other In real life, we need both testing and reasoning; neither is always better than the other. Testing is a reality check on reasoning: We want to test because our reasoning might be wrong. Reasoning needs to be done to fi nd good test cases (and avoid bad ones). Usually there exist a large/in fi nite number of test cases; we want to concentrate on important ones. Simple example of using reasoning to generate test cases: Take the statement if (x >= 0) z := z+x; (“:=” means assignment) Say our speci fi cation is “If z c before the statement, then z > c after the statement”. Write this for now as /* z >= c */ if (x >= 0) z := z+x; else ++z; /* z > c */ What are good test cases? x equal to 0? 1? -1? How about 2, 3, 4, 5, .... ?
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

### Page1 / 8

Lec01_SciOfPgm_Prop_Logic - Illinois Institute of...

This preview shows document pages 1 - 3. Sign up to view the full document.

View Full Document
Ask a homework question - tutors are online