35
Quality Assurance

Quality Analyst Training - Gain America

Embed Size (px)

Citation preview

Page 1: Quality Analyst Training - Gain America

Quality Assurance

Page 2: Quality Analyst Training - Gain America

Verification and validation 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

V & V goals

Page 3: Quality Analyst Training - Gain America

• Verification: The software should conform to its specification (Are we building the product right?)

• Validation: The software should do what the user really requires (Are we building the right product?)

Verification vs. validation

Page 4: Quality Analyst Training - Gain America

Requirements Phase Specification Phase (Analysis) Planning Phase Design Phase Implementation Phase Integration and Testing Maintenance Retirement

“Classical” lifecycle model

Page 5: Quality Analyst Training - Gain America

• Is a whole life-cycle process - V & V must be applied at each stage in the software process.

• Has two principal objectives– The discovery of defects in a system– The assessment of whether or not the

system is usable in an operational situation.

The V & V process

Page 6: Quality Analyst Training - Gain America

• Software inspections and walkthroughs - Concerned with analysis of the static system representation to discover problems (static verification)

• Software testing - Concerned with exercising and observing product behaviour (dynamic verification)– The system is executed with test data and its

operational behaviour is observed

Static and dynamic verification

Page 7: Quality Analyst Training - Gain America

Static and dynamic V&V

Formalspecification

High-leveldesign

Requirementsspecification

Detaileddesign

Program

PrototypeDynamicvalidation

Staticverification

Page 8: Quality Analyst Training - Gain America

• 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

V & V planning

Page 9: Quality Analyst Training - Gain America

The V-model of development

Requirementsspecification

Systemspecification

Systemdesign

Detaileddesign

Module andunit codeand tess

Sub-systemintegrationtest plan

Systemintegrationtest plan

Acceptancetest plan

ServiceAcceptance

testSystem

integration testSub-system

integration test

Page 10: Quality Analyst Training - Gain America

The testing process Requirements traceability Tested items Testing schedule Test recording procedures Hardware and software requirements Constraints

The structure of a software test plan

Page 11: Quality Analyst Training - Gain America

Informal examination of a product (document) Made up of:

◦ developers◦ client◦ next phase developers◦ Software Quality Assurance group leader

Produces:◦ list of items not understood◦ list of items thought to be incorrect

Walkthroughs

Page 12: Quality Analyst Training - Gain America

Involve people examining the source representation with the aim of discovering anomalies and defects

Do not require execution of a system so may be used before implementation

May be applied to any representation of the system (requirements, design, test data, etc.)

Very effective technique for discovering errors

Software inspections

Page 13: Quality Analyst Training - Gain America

Many different defects may be discovered in a single inspection. In testing, one defect may mask another so several executions are required

The reuse domain and programming knowledge so reviewers are likely to have seen the types of error that commonly arise

Inspection success

Page 14: Quality Analyst Training - Gain America

Inspections and testing are complementary and not opposing verification techniques

Both should be used during the V & V process Inspections can check conformance with a

specification but not conformance with the customer’s real requirements

Inspections cannot check non-functional characteristics such as performance, usability, etc.

Inspections and testing

Page 15: Quality Analyst Training - Gain America

Formalised approach to document reviews Intended explicitly for defect DETECTION

(not correction) Defects may be logical errors, anomalies in

the code that might indicate an erroneous condition (e.g. an un-initialised variable) or non-compliance with standards

Program inspections

Page 16: Quality Analyst Training - Gain America

A precise specification must be available Team members must be familiar with the

organisation standards Syntactically correct code must be available An error checklist should be prepared Management must accept that inspection will

increase costs early in the software process Management must not use inspections for staff

appraisal

Inspection pre-conditions

Page 17: Quality Analyst Training - Gain America

System overview presented to inspection team Code and associated documents are

distributed to inspection team in advance Inspection takes place and discovered errors

are noted Modifications are made to repair discovered

errors Re-inspection may or may not be required

Inspection procedure

Page 18: Quality Analyst Training - Gain America

Made up of at least 4 members Author of the code being inspected Inspector who finds errors, omissions and

inconsistencies Reader who reads the code to the team Moderator who chairs the meeting and notes

discovered errors Other roles are Scribe and Chief moderator

Inspection teams

Page 19: Quality Analyst Training - Gain America

Checklist of common errors should be used to drive the inspection

Error checklist is programming language dependent

The 'weaker' the type checking, the larger the checklist

Examples: Initialization, Constant naming, loop termination, array bounds, etc.

Inspection checklists

Page 20: Quality Analyst Training - Gain America

500 statements/hour during overview 125 source statement/hour during individual

preparation 90-125 statements/hour can be inspected Inspection is therefore an expensive process Inspecting 500 lines costs about 40 man/hours

effort (@ $50/hr = $2000!!!)

Inspection rate

Page 21: Quality Analyst Training - Gain America

• Can reveal the presence of errors NOT their absence

• A successful test is a test which discovers one or more errors

• The only validation technique for non-functional requirements

• Should be used in conjunction with static verification to provide full V&V coverage

Program testing

Page 22: Quality Analyst Training - Gain America

“Program testing can be a very effective way to show the presents of bugs but is hopelessly inadequate for showing their absence” [Dijkstra]

Fault: “bug” incorrect piece of code Failure: result of a fault Error: mistake made by the

programmer/developer

Execution based testing

Page 23: Quality Analyst Training - Gain America

• Defect testing and debugging are distinct processes

• Verification and validation is concerned with establishing the existence of defects in a program

• Debugging is concerned with locating and repairing these errors

• Debugging involves formulating a hypothesis about program behaviour then testing these hypotheses to find the system error

Testing and debugging

Page 24: Quality Analyst Training - Gain America

The debugging process

Locateerror

Designerror repair

Repairerror

Re-testprogram

Testresults Specification Test

cases

Page 25: Quality Analyst Training - Gain America

Testing phases

Componenttesting

Integrationtesting

Software developer Independent testing team

Page 26: Quality Analyst Training - Gain America

Component testing ◦ Testing of individual program components◦ Usually the responsibility of the component

developer (except sometimes for critical systems)◦ Tests are derived from the developer’s experience

Integration testing◦ Testing of groups of components integrated to

create a system or sub-system◦ The responsibility of an independent testing team◦ Tests are based on a system specification

Testing phases

Page 27: Quality Analyst Training - Gain America

• Only exhaustive testing can show a program is free from defects. However, exhaustive testing is impossible

• Tests should exercise a system's capabilities rather than its components

• Testing old capabilities is more important than testing new capabilities

• Testing typical situations is more important than boundary value cases

Testing priorities

Page 28: Quality Analyst Training - Gain America

• Test data Inputs which have been devised to test the system

• Test cases Inputs to test the system and the predicted outputs from these inputs if the system operates according to its specification

Test data and test cases

Page 29: Quality Analyst Training - Gain America

Test cases and test scenarios comprise much of a software systems testware.

Black box test cases are developed by domain analysis and examination of the system requirements and specification.

Glass box test cases are developed by examining the behavior of the source code.

Development of test cases

Page 30: Quality Analyst Training - Gain America

Test to specification:◦ Black box, ◦ Data driven◦ Functional testing◦ Code is ignored: only use specification

document to develop test cases Test to code:

◦ Glass box/White box◦ Logic driven testing◦ Ignore specification and only examine the code.

Methods of testing

Page 31: Quality Analyst Training - Gain America

An approach to testing where the program is considered as a ‘black-box’

The program test cases are based on the system specification

Test planning can begin early in the software process

Black-box testing

Page 32: Quality Analyst Training - Gain America

Black-box testing

Ie

Input test data

OeOutput test results

System

Inputs causinganomalousbehaviour

Outputs which revealthe presence ofdefects

Page 33: Quality Analyst Training - Gain America

• Sometime called structural testing or glass-box testing

• Derivation of test cases according to program structure

• Knowledge of the program is used to identify additional test cases

• Objective is to exercise all program statements (not all path combinations)

White-box testing

Page 34: Quality Analyst Training - Gain America

Statement coverage - ◦ Test cases which will execute every statement at least

once.◦ Tools exist for help◦ No guarantee that all branches are properly tested. Loop

exit? Branch coverage

◦ All branches are tested once Path coverage - Restriction of type of paths:

◦ Linear code sequences◦ Definition/Use checking (all definition/use paths)◦ Can locate dead code

Types of structural testing

Page 35: Quality Analyst Training - Gain America

White-box testing

Componentcode

Testoutputs

Test data

DerivesTests