150 likes | 271 Views
Introduction to Software Testing Lecture 5: Supporting Material Dr Kathryn Merrick Tuesday 17 th March, 2009. Overview. Types of software errors Types of testing Developing a test plan Reference: Text book Ch 10. Quiz. Why do programmers need to test their software?
E N D
Introduction to Software Testing Lecture 5: Supporting Material Dr Kathryn Merrick Tuesday 17th March, 2009
Overview • Types of software errors • Types of testing • Developing a test plan Reference: Text book Ch 10.
Quiz • Why do programmers need to test their software? • To keep management happy • To ensure the program works as required • They don’t • What is a bug? • Something you find in the garden • A syntax or logic error in program code • Don’t know, I doesn’t get them • When should testing occur? • At the end of development • Throughout development • As infrequently as possible Joking A Management B Tester C Programmer
1. Why Test Software? • Ensure it meets client requirements • Health and safety of future users • Protect your reputation as a programmer
2. What is a Bug? • The term has been seen in texts as far back as 1878 • Problems with radar electronics during World War II were referred to as bugs • Operators at the Harvard Faculty Computation Laboratory traced an error in the Mark II to a moth trapped in a relay • In programming a bug is an error. It can be: • A syntax error • A logic error
Demo 1: Common Syntax Errors in MATLAB
Logic Errors Program compiles and runs BUT… Does not produce correct results OR Program produces logically correct results BUT… Does not meet client specifications
3. When to Test? • Different types of testing should occur at different stages of software development: • White box testing: done by programmers throughout development. • Black box testing: done by a test team towards the end of development.
Demo 2: White box testing using code tracing
Demo 3: White box testing using the MATLAB debugger
Black Box Testing: Developing a Test Plan • Include tests for: • Normal usage scenarios • Abnormal usage scenarios • Boundary cases
Demo 4: Black box testing for the meteor_simulator
Summary • After today’s lecture you should be able to: • Describe the difference between syntax and logic errors • Define white box and black box testing • Develop a test plan for black box testing • Use code tracing and graphical debuggers as tools for white box testing