Presentation is loading. Please wait.

Presentation is loading. Please wait.

The Testing Process II1 Program Testing Programs must be tested carefully in order to ensure that they work as planned. Testing is not a casual thing.

Similar presentations


Presentation on theme: "The Testing Process II1 Program Testing Programs must be tested carefully in order to ensure that they work as planned. Testing is not a casual thing."— Presentation transcript:

1 The Testing Process II1 Program Testing Programs must be tested carefully in order to ensure that they work as planned. Testing is not a casual thing. (There is a problem with real programs, they are so complicated that it takes a very long time to understand the program, rather than the computer error.)

2 The Testing Process II2 Black Box Testing Usually done from the program specifications No knowledge of how the program actually does what it does Often done by a separate design team The problems that need to be solved are usually very large. The examples we use are often too simple to need the solution techniques.

3 The Testing Process II3 Example 1: Black Box Problem: Read two numbers, ‘a’ and ‘b’. Put the larger of the numbers into the box ‘c’. Conditions to be tested:

4 The Testing Process II4 Example 1: Black Box both numbers positive –‘a’ larger –‘b’ larger one number positive –‘a’ positive –‘b’ positive both numbers negative –‘a’ larger (less negative) –‘b’ larger one number zero –‘a’ = 0 –‘b’ = 0 both numbers equal –both positive –both negative –both zero other conditions...

5 The Testing Process II5 Example 2: Black Box Test a program that shows the name of the next day each time the “Next Day” button is clicked. Seems to work ok.

6 The Testing Process II6 White Box Testing Uses details of just how the program works. Exhaustive test of each routine used. In real world cases, complete testing is just not possible. Requires a careful choice of just how testing is done.

7 The Testing Process II7 Example: White Box Testing Option Explicit Dim bytD As Byte Dim strT(1 To 7) As String Private Sub cmdDne_Click() End End Sub Private Sub cmdNxt_Click() bytD = bytD + 1 Label1.Caption = strT(bytD) End Sub Private Sub Form_Load() strT(1) = "Sun" strT(2) = "Mon" strT(3) = "Tue" strT(4) = "Wed" strT(5) = "Thr" strT(6) = "Fri" strT(7) = "Sat" bytD = 1 Label1.Caption = strT(bytD) End Sub

8 The Testing Process II8 White Box Testing Example There is a problem when d goes from a value of 7 to 8...

9 The Testing Process II9 White Box Testing Example Private Sub cmdNxt_Click() bytD = bytD + 1 If bytD = 8 Then bytD = 1 End If Label1.Caption = strT(bytD) End Sub Private Sub cmdNxt_Click() bytD = bytD + 1 Label1.Caption = strT(bytD) End Sub


Download ppt "The Testing Process II1 Program Testing Programs must be tested carefully in order to ensure that they work as planned. Testing is not a casual thing."

Similar presentations


Ads by Google