QA in Construction Flashcards
3 things that programmers must accomplish
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
Code Analysis
Verification and validation that is automated
Code Review
Verification and Validation that is not automated
Dynamic analysis
analysis techniques while programs are running
Static analysis
Examine software when it is not running
Formal Reviews
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.
Rate of code review should be about how many lines of code per hour?
200 lines for preparation and team inspection should not exceed 150 per hour
What should code inspection checklist have on it?
Specific defects that inspectors should look for during preparation
Ex of things on code checklist
- 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
Simplest type of static analysis
Syntax Checking
Syntax Checking
ensures that the software obeys grammatical rules of language it is written in. Most frequently performed by a language-sensitive editor.
Something to be aware of Syntax Checkers
Editors do not always correctly identify the root cause of the problem
Style Checking
Standards related to typography based on a style guide. (upper and lower case, naming, spaces, tabs, brackets)
First style checker was called?
Lint
Usage checkers
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.
Difference between usage and idiom checkers
Idiom checkers are more varied
Formal Methods
refer to the class of static analysis tools that rely on mathematical models
Types of Formal Methods (3)
Model checking
Data Flow analysis
Symbolic evaluation
Model Checking
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.
Data Flow Analysis
Process of enumerating the set of possible values calculated at various points in a program or sub-program using ideas from graph theory
Symbolic evaluation
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.
Unit Testing
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
False negative
the conclusion that there are no faults due to an incomplete test suit
False Positive
Incorrect expected value (conclusion that there is a fault when there isn’t)
Black Box Testing
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
Clear/White/open box
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
What does clear box testing focus on?
Coverage of tests.
How to measure coverage?
Control Flow Graph (CFG)
Describe control flow graph:
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
Statement Coverage
The percentage of statements exercised when a set of tests cases is executed.