Lab3 - CS 241 Lab 3 Lab 3: Testing CS 241 PURPOSE In order...

Info iconThis preview shows pages 1–2. Sign up to view the full content.

View Full Document Right Arrow Icon
CS 241 Lab 3 1 | P a g e Lab 3: Testing CS 241 PURPOSE In order to call a programming project of any magnitude complete, you must first test it to verify that it works as intended. Unlike many other types of projects (such as carpentry or home im- provement), the only way to be sure that a programming project will work properly in any situa- tion is to try as hard as you can to break it. While this may sound a little extreme at first, consider this: someone is eventually going to try to break your software, whether intentionally (in the case of lab TA’s grading) or not (end users who haven’t got a clue). It’s better to create a robust project the first time around than to do damage control later – and in the case of this class, it will result in a higher grade anyway! TESTING STRATEGY As stated above, the only way to thoroughly test a project is to try every way you can think of to break it. It isn’t enough to simply show that the program produces correct output for a correct input. Though important, this is only a small part of the testing process. You must also show that the project can handle incorrect input and boundary conditions. Boundary conditions test the conditions at the edges of correct behavior – for example, the boundary conditions of an array or similar data structure are the elements at the very ends of the array, and those just beyond the ends. In other words, there will be tests the program should pass as well as tests the program should fail – although even a failed test should not cause the program to crash. SAMPLE CODE
Background image of page 1

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

View Full DocumentRight Arrow Icon
Image of page 2
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 05/03/2010 for the course CS 240 taught by Professor Staff during the Spring '08 term at Wright State.

Page1 / 3

Lab3 - CS 241 Lab 3 Lab 3: Testing CS 241 PURPOSE In order...

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

View Full Document Right Arrow Icon
Ask a homework question - tutors are online