QA in Construction Flashcards

1
Q

3 things that programmers must accomplish

A

1) Syntactically correct (grammar)
2) Software must be consistant with standards sanctioned by the project and organization
3) Software must implement algorithms and data structures in accord with design specs

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

Code Analysis

A

Verification and validation that is automated

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

Code Review

A

Verification and Validation that is not automated

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

Dynamic analysis

A

analysis techniques while programs are running

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

Static analysis

A

Examine software when it is not running

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

Formal Reviews

A

Code inspections because each participant has a well-defined role ,the activity follows a well-defined process, and the activity is guided by a checklist.

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

Rate of code review should be about how many lines of code per hour?

A

200 lines for preparation and team inspection should not exceed 150 per hour

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

What should code inspection checklist have on it?

A

Specific defects that inspectors should look for during preparation

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

Ex of things on code checklist

A
  • naming conventions
  • are variable names confusing?
  • is every variable and attribute correctly typed
  • method returns correct value
  • appropriate access modifiers
  • nested if statements should be converted into switch statement
  • all exceptions handled
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

Simplest type of static analysis

A

Syntax Checking

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

Syntax Checking

A

ensures that the software obeys grammatical rules of language it is written in. Most frequently performed by a language-sensitive editor.

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

Something to be aware of Syntax Checkers

A

Editors do not always correctly identify the root cause of the problem

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

Style Checking

A

Standards related to typography based on a style guide. (upper and lower case, naming, spaces, tabs, brackets)

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

First style checker was called?

A

Lint

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

Usage checkers

A

look for 3 things:

  • suspicious or error prone constructs (uninitialized variables, use of division operator)
  • non-portable constructs (may have range problem)
  • memory allocation inconsistencies.
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

Difference between usage and idiom checkers

A

Idiom checkers are more varied

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

Formal Methods

A

refer to the class of static analysis tools that rely on mathematical models

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

Types of Formal Methods (3)

A

Model checking
Data Flow analysis
Symbolic evaluation

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

Model Checking

A

the process of automatically determining if a program or sub program satisfies certain requirements. The inputs to a model checker are the program or sub-program and formal specs of requirements. Requirements specified using logical expressions.

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

Data Flow Analysis

A

Process of enumerating the set of possible values calculated at various points in a program or sub-program using ideas from graph theory

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

Symbolic evaluation

A

Process of automatically tracing the execution of a program or sub-program using symbolic values rather than numeric values. Used to identify the values that will cause different statements to be executed.

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

Unit Testing

A

The testing of individual units or sub-programs in isolation. One value for each sub-program argument and one corresponded expected output. To determine faults in sub-program

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

False negative

A

the conclusion that there are no faults due to an incomplete test suit

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

False Positive

A

Incorrect expected value (conclusion that there is a fault when there isn’t)

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

Black Box Testing

A

testing the processing details of the component, system or product are presumed to be unknown. The person developing the tests only knows what can go into the tested unit and what should come out

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

Clear/White/open box

A

Person developing the tests knows exactly how the componenet, sub-system or product is built and how it should operate. Combo of two is generally required for effective testing

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

What does clear box testing focus on?

A

Coverage of tests.

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

How to measure coverage?

A

Control Flow Graph (CFG)

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

Describe control flow graph:

A

action node - represents a piece of code with one entry point and one exit point (statement represented as an action)
decision node - represents the start of a piece of code with one entry point and multiple exit points

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

Statement Coverage

A

The percentage of statements exercised when a set of tests cases is executed.

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

Branch Coverage

A

Percentage of branch directions taken when a set of tests cases is executed. Identifies the outbound edges from decision nodes that have and have not been traversed.

32
Q

Path Coverage

A

The percentage of all execution paths taken when a set of test cases executes.

33
Q

Is 100% path coverage achievable for large programs

A

NO

34
Q

Test Driven Development

A

TTD A process in which tests are developed as the code is and for very small increments in functionality.

35
Q

Are all tests supposed to be created before the program is written?

A

No, You want to have some written before (black box) and then others for (TTD) written after the code that focus on coverage (clear box).

36
Q

Complete enumeration/exhaustive testing

A

Creates a test suite that contains all possible inputs. Usually a huge number b/c has to do every value 2^32 for integer and 2^64

37
Q

Oracle

A

Another sub-program that is known to output the correct answers

38
Q

Randomization

A

“brute force” approach which can be done in either a structured or unstructured fashion. Stat with the completely enumerated test suit and then select tests from that suite in some probabilistic fashion ( looking for possible error triggers).

39
Q

Boundary Value Analysis

A

Idea that failure triggers tend to be found at the “boundaries” of the sets of inputs and outputs.

40
Q

Other popular value-based heuristics for individual parameters

A
  • number 0 for dividing by zero
  • very large and very small numbers (underflow and overflow)
  • characters or string version of digits and numbers
  • equal value params
  • different relative value params
  • small and large arrays
  • arrays w/ 1 or 0 elements
  • unsorted arrays
  • arrays with duplicates and no duplicates
41
Q

Equivalence class

A

Partitioning test cases into sets in which each test case in the set is expected to trigger the same failure. Helps so don’t have to create more than one test case from each equivalence class.

42
Q

Ideal test should do what?

A

Correct the fault and NOT introduce a new fault

43
Q

Regression Testing

A

Running all tests over again after making any software change (even just editing comments)

44
Q

Assertion

A

relates actual output to expected output

45
Q

What unit testing tool do we use?

A

JUnit

46
Q

Advantages of Unit Testing

A
  • easy to isolate different tests
  • easy to construct isolate tests
  • reports generated are easy to read and highlight the failed tests
  • can be supplemented with code coverage tools
47
Q

Symptom

A

A characteristic of a failure that can be observed

48
Q

Error

A

Something that a person does that gives rise to a fault

49
Q

Trigger Condition

A

Condition that causes a product to fail

50
Q

Symptom and Error in a program that divides by 0

A

Symptom = the program crashes
Fault- the omission of statements that checks the user-supplied value and display an error message
Trigger Condition - dividing by zero

51
Q

Debugging process (5) steps

A
Stabilize
Localize
Correct
Verify
Globalize
52
Q

Stabilize

A

Understand the symptom and trigger condition of test so failure can be reproduced

53
Q

Localize

A

Locate the fault (form hypothesis and then tests if your hypothesis for the error was correct)

54
Q

Correct

A

Fix Fault

55
Q

Verify

A

Test fix, make sure not introduce new fault

56
Q

Globalize

A

Look for and fix similar defects in other parts of the system

57
Q

Debug Code

A

Includes both temporary output statements that can be used to monitor state information and temporary input statements that can be used to pause the execution of a component

58
Q

Biggest disadvantages of debug code:

A
  • chunkiness
  • can obscure the code it is meant to debug
  • can take a significant amount of time to add
  • it can be difficult to know what is output
  • can print a lot of stuff
59
Q

Debugger

A

A tool that can be used to trace the execution of a code without having to modify it in any way

60
Q

Breakpoint

A

Pauses the execution of a program. Can start executing a program but pause execution when particular statement is reached

61
Q

Step into

A

If statement is a call to a sub0program, enter the sub-program and execute each of its statements one at a time

62
Q

Step over

A

Ignores internal details

63
Q

Step out

A

Get out of a sub-program, continuing execution of its code until it returns then pausing again after the return

64
Q

Watches

A

monitor state information. Can monitor values contained in different variables to see how they change.

65
Q

Profiling

A

The process of measuring the amount of time (or space) used by sub-programs and statements during a particular execution of a program.

66
Q

What kind of analysis is Profiling?

A

Dynamic b/c occurs while the program is executing

67
Q

Refactoring

A

changing code without altering its behavior. To improve structure

68
Q

When should refactoring be done (3)?

A
  • duplication of code
  • lack of clarity (code hard to understand)
  • code smell
69
Q

Code smell

A

Comments that duplicate code, classes that do nothing but hold data, failure to hide info, tight coupling, low cohesion, bloated classes, lazy classes, long methods, reliance on switch statements instead of classes

70
Q

Introduce explain variable

A

refactoring technique that adds temp variable to make code easier to understand

71
Q

Inline temporary variable

A

refactoring technique get rid of temp variables that make code harder to understand

72
Q

Extract sub-program

A

refactoring technique that splits a sub-program into two or more sub-programs

73
Q

Inline sub-program

A

refactoring technique when sub-program is too short to warrant being a separate identity get rid of it

74
Q

What kind of testing should unit and integration testing be (black or clear)?

A

Clear

75
Q

Test-driven development (TDD)

A

A style of coding in which writing tests is integral to the coding process itself. Has many tests that check behavior in ways that do not depend on code (because they are written before the code) -> high quality tests

76
Q

Essential factors of TDD

A
testing framework is assumed
tests are written before code
tests and code are written incrementally
code is only written to pass tests 
Refactoring is expected