Software Testing - PowerPoint PPT Presentation

1 / 10
About This Presentation
Title:

Software Testing

Description:

Is it sufficient that a program runs without crashing and produces a result? ... What if, sometimes, the system crashes and sometimes it doesn't? ... – PowerPoint PPT presentation

Number of Views:30
Avg rating:3.0/5.0
Slides: 11
Provided by: doolin
Category:

less

Transcript and Presenter's Notes

Title: Software Testing


1
Software Testing
  • Week 10

2
Software Testing
  • Is it sufficient that a program runs without
    crashing and produces a result?
  • What if the result is only correct sometimes?
  • What if, sometimes, the system crashes and
    sometimes it doesnt?
  • What can you, the developer, do to get it right
    all the time?

3
Software Testing - the reality
  • Impossible to test even simple software for all
    possible combinations of input data!
  • Important to choose broad spectrum of
    representative test cases that cover as much as
    possible.
  • Two main approaches to testing -
  • Black Box
  • White Box

4
Black Box Testing
  • Testing from performance viewpoint
  • Assumes cannot see code - black box which
  • receives input
  • produces output
  • how it transforms input into output is hidden

5
Black Box Testing
  • Test software against stated requirements
  • Develop test data sets to examine normal and
    unusual instances
  • Program should meet
  • functional requirements
  • performance requirements, eg
  • speed
  • ease of use

6
White Box Testing
  • Assumes total access to code!
  • Focus of testing is on program logic
  • Test each decision program has to make
  • Selection decisions
  • Iteration decisions
  • Design test data to exercise every possible path
    through code

7
White Box Testing
  • For example a loop is controlled by condition
  • loopnum gt 5
  • Need three test cases
  • loopnum 4
  • loopnum 5
  • loopnum 6
  • Why?
  • To test boundary where true/false changes
  • Called boundary testing

8
Testing
  • Usual to use combination of White Black Box
    approaches
  • Is testing your own software the best approach?
  • More usual to have a separate team testing
    software - impartial!
  • Testing is important to achieve reliability
  • Reliability - given a set of input data, program
    should always produce same result

9
Testing -Example
Input age If age gt17 Then Display message
You are old enough to drive Else Calulate
number of years until driving allowed (17 -
age) Display appropriate message Endif
10
Error trapping
  • This weeks page on the web site has an example
    of a program to write data to a sequential file.
  • This does not include any error trapping.
  • For example if you try to open a file on a floppy
    disk in drive a and there is no disk there, the
    program will crash (Disk not ready) error
    message-see P 405, Schneider).
  • You will be able to think of other instances
    where the program could be improved e.g
    error-trapping so you can not save duplicate
    student numbers.
Write a Comment
User Comments (0)
About PowerShow.com