Week 9 - Testing & Debugging Flashcards

1
Q

How are test harnesses different to test cases?

A

Test harnesses are like the placeholder, whereas the test cases are the actual values which we are passing in to see if the program will work properly or not.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

Why do we use validation?

A

Validation reduces the variety of inputs and only allows for certain inputs otherwise you can’t continue.

This is implemented with Reg Exp’s.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

How is defensive programming implemented?

A

Through adding placeholders, using conditional statements and structured code.

(if statements)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

How can we debug code?

A

It can be done either bottom up or top down as well as tracking variables and using binary chops.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What is an efficient way to test that a program will work?

A

Try to test the program by entering no values, 1 value and then 3 values.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

Test Harnesses

A

Small programs used to specify a program’s function and output as well as to test modules.

They are useful in testing hypotheses for outputs of certain inputs.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

Binary Chop

A

Is similar to a number guessing game in that you continue to divide the program into the possible sections where the issue could be.

(50-100, 75-100, 90-100, 95-100, 98!)

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

Top Down Debugging

A

Looking at all of the modules and then fixing the problems from there.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

Bottom Up Debugging

A

Testing each of the modules as you make them to know where the issues are coming from.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly