Software Engineering Quiz 2 (Lecture 8) - Software Testing Verification and Validation
Inspection rate
- 500 statements/hour during overview - 125 sources statement/hour during individual preparation - 90-125 statement/hour can be inspected - inspection is therefore an expensive process
interface faults
- Do all function and method calls have the correct number of parameters? - Do formal and actual parameter types match? - IF components access shared memory, do they have the same model of the shared memory structure?
Storage management faults
- If a linked structure is modified, have all links been correctly reassigned? - If dynamic storage is used, has space been allocated correctly? - Is space explicitly de-allocated after it is no longer required? - Have all possible error conditions been taken into account?
Input/out faults
- are all input variables used? - are all output variables assigned a value before they are output? - can unexpected inputs cause corruption?
data faults
- are all program variables initialized before their values are used? - have all constants been named? - should the upper bound of arrays be equal to the size of the array or Size -1?
Formal methods
- can be used when a mathematical specification of the system is produced - they are the ultimate static veriication technique - the involve detailed mathematical analysis of the specification and may develop formal arguments that a program conforms to tis mathematical specification
program testing
- can reveal the presence of errors not their absence - the only validation technique for non-functional requirements as the software has to be executed to see how it behaves - should be used in conjunction with static verification to provide full validation and verification coverage
stages of static analysis
- control flow analysis - data use analysis - interface analysis - information flow analysis - path analysis
control faults
- for each conditional statement, is the condition correct? - Is each loop certain to terminate? - Are compound statements correctly bracketed? - In case statements, are all possible cases accounted for? - If a break is required after each case in case statements, has it been included?
Use of Static Analysis
- particularly valuable when a language such as C is used which has weak typing and hence many errors are undetected by the complier - less cost-effective for languages like Java that have strong type checking and can therefore detect many errors during compilation
The V&V Goals
- should establish confidence that the software is fit for purpose - this does not mean completely free of defects - rather it must be good enough for its intended use and the type of use will determine the degree of confidence that is needed
Inspections and testing
-complementary and not opposing verification techniques - both should be used during the V&V process -
Software Inspections
-involves people examining the sources representation with the aim of discovering anomalies and defects. - do not require execution of a system so may be used before implementation - they may be applied to any representation of the system - they have been shown to be an effective technique for discovering program errors
the structure of a software test plan
-the testing process -the requirements traceability -tested items -testing schedule -testing recording procedures -hardware and software requirements -constraints
Exception management faults
Have all possible error conditions been taken into account?
Arguments against formal methods
Require specialized notation that cannot be understood by domain experts - very expensive to develop a specification and even more expensive to show that a program meets that specification - it may be possible to reach the same level of confidence in a program more cheaply using other V & V techniques
initialization, constant naming, loop termination, array bounds
What are examples of inspections checklists?
The V&V process
a whole life-cycle process, must be applied at each stage in software process. Main principal objects are the discovery of defects in a system and the assessment of whether or not the system is useful and useable in a operational situation
program inspections
are very effective in discovering errors
inspections
can check conformance with a specification but not conformance with the customer's real requiremnts - cannot check non-functional characteristics such as performance, usability, etc.
static analysis tools
can discover program anomalies which may be an indication of faults in the code
verification and validation plannign
careful planning is required to get the most out of testing and inspection processes - planning should start early in the development process - the plan should identify the balance between static verification and testing - test planning is about defining standards for the testing process rather than describing product tests
control flow analysis
check for loops with multiple exit or entry points, finds unreachable code, etc.
interface analysis
checks the consistency of routine and procedure declaration and their use
software inspectiosn
concerned with analysis fo the static system representation to discover problems (static verification) - may be supplement by tool-based document and code analysis
software testing
concerned with exercising and observing product behavior (dynamic verification) - the system is executed with test data and its operational behavior is observed
testing and debugging
defect testing and debugging are distinct processes - verification and validation is concerned with establishing the existence of defects in program -debugging is concerned with locating and repairing these errors -debugging involves formulating a hypothesis about program behavior then testing these hypotheses to find the system error
V&V confidence
depends on system's purpose user exceptions and marking environment
Data use analysis
detects uninitialized variables, variables written twice without an intervening assignment, variables which are declared but never used, etc.
marketing environment
getting a product to market early may be more important than finding defects in the program
path analysis
identifies path through the program and sets out the statements executed in that path. Again, potentially useful in the review process
information flow analysis
identifies the dependencies of output variables. Does not detect anomalies itself but highlights information for code inspection or review
static verification techniques
involve examination an analysis of the program for error detection
inspection checklist
list of common errors should be used to drive inspection - the weaker the type checking the larger the checklist
error checklists
programming languages dependent and reflect the characteristic errors that are likely to arise in the language
test plan
should be drawn up to guide the testing process
automated static analysis
software tools for source text processing that parse program text and discover potentially erroneous conditions and bing these to the attention of the V&V team. They are very effective as an aid to inspections- they are a supplement to be not a replacement fo r inspections
Program code in inspections
systematically checked by a small team to locate software faults
software functoin
the level of confidence depends on how critical the software is to an organisation
user expectation
users mat have low expectations of certain kinds of software
validation
we are building the right system (you can build the perfect wrong system)
verification
we are building the system right (to the specification)