Testing & Debugging Flashcards
What is the definition of Unit Testing?
Testing individual UNITS of code to determine whether they are FIT to use.
Is Unit Testing a method of White or Black Box testing and why?
It’s White Box Testing as the STRUCTURE of the code fragment is tested rather than the FUNCTIONALITY
Steps to replicating and fixing issues during unit testing? (4)
- Manually replicate issue
- FIND or WRITE failing tests
- FIX production code
- Check tests PASS
Definition of testing?
a PROCESS intended to SHOW that a computer system (hardware & or software) DOES or DOESN’T work
Definition of debugging?
the PROCESS of FINDING and FIXING ERRORS in a computer system so that it behaves as expected.
Should unit tests rely on each other?
No they should each be INDEPENDENT. The test case methods should give the same result regardless of the ORDER in which they are executed.
Should test case methods start with the word “test”?
Not necessarily
After failing tests show the problem exists, what strategies can we use to isolate the source? (5)
Architectural Back tracking Brute Force Binary Search Cause Elimination
After deciding on a debugging strategy we must pick a tactic, our options? (8)
Print Statements Rubber Ducking Minimise execution path Looking for Common Problems Online Debugger Test Cases Git Commits & Blame Profiling
What does the Architectural debug strategy refer to?
Narrowing down the location in the ARCHITECTURE
Meaning of the Backtracking strategy?
Find ERROR LINE and WORK BACKWARDS through code till you find CAUSE 321 (1234567)
Meaning of Brute Force Strategy?
Read code from start to finish 1234567
Meaning of Binary Search strategy?
start at MIDDLE of execution 4
- if problem has manifested at this point look for error in 1234
- else in 4567
Meaning of Cause elimination?
- IDENTIFY all possible causes
- Rule them out one by one
Meaning of rubber ducking as a tactic?
Explain exactly what the code is doing to someone else