Lecture4Testing

Lecture4Testing - Testing Testing can show only the...

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

View Full Document Right Arrow Icon
Testing Testing can show only the presence of bugs – not their absence Edsger Dijkstra
Background image of page 1

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

View Full DocumentRight Arrow Icon
Unit Tests Use unit tests to test classes individually Write a test harness to run a test
Background image of page 2
Test Harness A test harness feeds parameters to the methods Example: public static void main (String [ ] args) { Product spam = new Product (“spam”, 100, 4.99); spam.sell( 5); //’sell’ 5 cans of spam System.out.println ( “Remaining count should be 95 and is “ + spam.getInventoryCount( ) ); }
Background image of page 3

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

View Full DocumentRight Arrow Icon
Positive Tests Tests that consist of legitimate inputs, and you expect the program to handle them correctly spam.sell( 5); //’sell’ 5 cans of spam
Background image of page 4
Boundary test cases Boundary test cases are test cases that are at the boundary of acceptable inputs You expect the program to handle them correctly Example, spam.sell (100); Or spam.sell (101);
Background image of page 5

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

View Full DocumentRight Arrow Icon
Regression Testing A test suite is a set of tests for repeated testing Regression testing involves repeating previously run tests to ensure that known failures of prior versions do not appear in new versions
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

This note was uploaded on 10/13/2008 for the course CSC 216 taught by Professor Miller during the Spring '08 term at N.C. State.

Page1 / 21

Lecture4Testing - Testing Testing can show only the...

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

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