Testing & Debugging Flashcards

1
Q

What is the definition of Unit Testing?

A

Testing individual UNITS of code to determine whether they are FIT to use.

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

Is Unit Testing a method of White or Black Box testing and why?

A

It’s White Box Testing as the STRUCTURE of the code fragment is tested rather than the FUNCTIONALITY

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

Steps to replicating and fixing issues during unit testing? (4)

A
  1. Manually replicate issue
  2. FIND or WRITE failing tests
  3. FIX production code
  4. Check tests PASS
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Definition of testing?

A

a PROCESS intended to SHOW that a computer system (hardware & or software) DOES or DOESN’T work

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

Definition of debugging?

A

the PROCESS of FINDING and FIXING ERRORS in a computer system so that it behaves as expected.

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

Should unit tests rely on each other?

A

No they should each be INDEPENDENT. The test case methods should give the same result regardless of the ORDER in which they are executed.

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

Should test case methods start with the word “test”?

A

Not necessarily

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

After failing tests show the problem exists, what strategies can we use to isolate the source? (5)

A
Architectural 
Back tracking
Brute Force
Binary Search
Cause Elimination
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

After deciding on a debugging strategy we must pick a tactic, our options? (8)

A
Print Statements
Rubber Ducking
Minimise execution path
Looking for Common Problems
Online Debugger
Test Cases 
Git Commits & Blame
Profiling
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What does the Architectural debug strategy refer to?

A

Narrowing down the location in the ARCHITECTURE

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

Meaning of the Backtracking strategy?

A

Find ERROR LINE and WORK BACKWARDS through code till you find CAUSE 321 (1234567)

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

Meaning of Brute Force Strategy?

A

Read code from start to finish 1234567

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

Meaning of Binary Search strategy?

A

start at MIDDLE of execution 4

  • if problem has manifested at this point look for error in 1234
  • else in 4567
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

Meaning of Cause elimination?

A
  • IDENTIFY all possible causes

- Rule them out one by one

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

Meaning of rubber ducking as a tactic?

A

Explain exactly what the code is doing to someone else

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

Meaning of profiling as a tactic?

A

Dynamic program analysis like in C (e.g memory or time complexity )

17
Q

What is the 3 Layer Architecture in Stendhal? Where does middle out testing fit in?

A

Presentation Logic
Service Layer API : Acceptance test
Business Logic
Data Logic

18
Q

How can you control the scope of a new feature to minimize risk (of regression) ?

A

Make the feature accessible to object(s) of a specific type at first

19
Q

What is test first development?

A

Writing test first to use on stubs

20
Q

Acceptance Test vs Unit

A

feature/design
customer/technology
specification/design

21
Q

What is the anatomy of an automated test?

A

setup
execution
validation
cleanup

22
Q

How is minimizing the scope a form of incremental development?

A
  • bring simple (useable) version online first
  • fix issues
  • expand
23
Q
  • B class is ready
  • A is supposed to call it
  • A is not ready for testing yet
  • solution??
A

Create a DRIVER for B , this can call B
Driver B -> B
later:
A->B

24
Q

What is a Driver if you think about it hard enough?

A

The driver is actually a test for B. This is an example of test after dev

25
Q

When is a stub of class B necessary?

A

when Test B is ready but B isn’t ready for testin’

26
Q

Will test code with stubs compile?

A

Yas

27
Q

What is the concept of Wishful Thinking?

A

When writing tests for code that doesn’t exist:

  • decide what the “perfect classes/methods” would be like
  • write the test AS THOUGH THEY EXIST
28
Q

When are failing acceptance tests not a problem?

A

When the tests describe features that are needed but not yet fully implemented

29
Q

When are failing acceptance tests a problem?

A

When they describe COMPLETED features that have been added to the game

30
Q

Benefits of Test First approach?

A
  • client-centred design

- we never “forget” to write tests

31
Q

What is the only difference between TFirstD and TDrivenD?

A

Tests DRIVE the design
Red phase: design client API
Green: refactor