Lec06b - make sure that the system does what it is intended...

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

View Full Document Right Arrow Icon
COMP 2710 Software Construction Unit Testing Dr. Xiao Qin Auburn University http://www.eng.auburn.edu/~xqin xqin@auburn.edu Fall, 2011 These slides are adapted from notes by Dr. Winard Britt
Background image of page 1

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

View Full DocumentRight Arrow Icon
Designing Test Cases and Testing How can we demonstrate success? How do we know if we’ve failed? Did we do what we set out to do in the first place? How do we guarantee robustness of our system?
Background image of page 2
Types of Testing Unit Testing Isolate a single function or class and test only that. This generally requires holding other functions constant or at least making them predictable (remember drivers and stubs?) System Wide/Integration Testing Does the whole system meet its goals? Does the whole system work correctly? System Test Cases should map back to Use Cases!
Background image of page 3

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

View Full DocumentRight Arrow Icon
Test Cases Should always be designed BEFORE you ever write the first line of code. Ideally, somebody who isn’t you should write them. Test cases should be carefully designed to
Background image of page 4
Background image of page 5

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

View Full DocumentRight Arrow Icon
Background image of page 6
Background image of page 7

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

View Full DocumentRight Arrow Icon
Background image of page 8
Background image of page 9

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

View Full DocumentRight Arrow Icon
Background image of page 10
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: make sure that the system does what it is intended to do and that it does it correctly! Inspiration comes from ANALYSIS and DESIGN How to know what to test? Bugs hide in corners Check normal cases and boundary cases Divide the possible input space into equivalence classes (!). Exhaustive testing is neither practical nor necessary. Testing Functions Examples for values: string empty string, medium length, very long Array empty array, first element, last element Int zero, mid-value, high-value Testing the preconditions/postconditions: Are they true? Boolean logic, assertions Test Cases - Example Test Cases - Exercise Let us test a trivial function like sqrt(), Unit Testing An Example 1-9 Conclusion Code responsibly, the grade you save may be your own. Oh yeah, and you might save lives or make lots of money too. That counts too....
View Full Document

This note was uploaded on 12/07/2011 for the course COMP 2710 taught by Professor Staff during the Fall '08 term at Auburn University.

Page1 / 10

Lec06b - make sure that the system does what it is intended...

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

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