Software Testing

Prepared by:Raghav

Target Audience

Beginners Intermediate

What do we cover?

Basics of testing Levels of Testing Testing techniques

Software testing
Relative cost per defect 125 100 75 50 25

Req

Design

Code Test Production

Software testing

Points to Ponder: 80% of all defects occur in 20% of the work Test strategies impact test costs Conversion of testing from craft to process can give extensive benefits

Software Testing What hinders effective testing? .

Aspects that hinder Effective testing       Optimism Belief that the system works Negative attitude towards effective testing Conflict between testers and developers Testing is expensive Delivery commitments .

The V Model What is V model? .

The V Model Customer Requirements Software Requirements Architecture (HLD) Detailed Design (LLD) Acceptance System testing Integration testing Unit testing validation Code .

Testing v/s Life Cycle Stage Requirements Design (HL) Design (LL) Code Integration Acceptance Test Activity Acceptance Test .System Test Integration Test Unit Test Unit test / Debug Integration test / debug System test / debug Acceptance test / debug .

DBs.Why Test? Developers not fallible q Bugs in compilers. OS q Certain bugs easier to find in testing q Don’t want customers to find bugs q Post release debugging is expensive q . languages.

Test team Why separate testing team? .

Is Testing everything?   There are other approaches possible to create good software Effective methods are •Inspection •Design style •Static analysis •Language checks •Development environment .

Can Testing be replaced? NO!! Even if we use other methods. inspect. read. cannot do away with testing Review. better methodologies And then TEST    . walkthrough.

(IEEE 83a) .TESTING Definition: Testing is the process of exercising or evaluating a system or system component by manual or automated means to verify that it satisfies specified requirements.

Testing objective    Process of executing a program with an intent of finding an error A good test case is one that has a high probability of finding an as yet undiscovered error A successful test is one that uncovers an as yet undiscovered error .

Testing Involves •Test plan •Generate test conditions. cases •Create required test environment •Execute tests by Initiating application under test Applying inputs that are specified in the already generated test case Compare actual results with expected results Results: Test passed or failed! .

the test has succeeded in discovering a fault! q .A ‘FAILED’ Test The term ‘Test Failed’ is used when the program has failed to give the expected result q Actually.

Definitions •Defect A deviation from specification or standard Anything that causes customer dissatisfaction Verification All QC activities throughout the life cycle that ensure that interim deliverables meet their input specification Validation The ‘test phase’ of the life cycle which assures that the end product meets the user’s needs .

Debugging Debugging is the act of attempting to determine the cause of the symptoms of malfunctions detected by testing or by frenzied user complaints. (Beizer) .

Testing: static and dynamic • Static Testing: Verification performed without executing the system’s code •Code Inspection •Reviews • Dynamic Testing: Verification or validation performed by executing the system’s code .

Testing Techniques • Black Box • White Box • Basis path testing .

Black box testing What is black box testing? .

focuses on functional requirement of the software .Black box testing Also called Behavioural testing.

Black box testing Detects following categories of errors      Incorrect or missing functions Interface errors Errors in data structures and external database access Behaviour or performance errors Initialisation and termination errors .

Types of Black box testing    Boundary value analysis Equivalence partitioning Special value .

BVA(Boundary Value Analysis) What is BVA? .

Boundary value analysis (two variables) X2 d a<=x1 <=b c<=x2 <=d c a b X1 .

BVA Great number of errors tends to occur at the boundaries of the input domain rather than in the ‘center’ BVA leads to a selection of test cases that exercise bounding values .

Equivalence partitioning What is equivalence partitioning? .

helps avoid redundancy • The KEY is the choice of equivalence relation. •Choose one data element from each partitioned set. .Equivalence partitioning testing •EC partitions the data to partition of a set • Partition refers to collection of mutually disjoint subsets whose union is the entire set. • EC based testing allows . .to have a sense of complete testing.

Special value What is special value testing? .

experience with similar programs Ad-hoc/seat of pants/skirt testing No guidelines.Special value testing • • • • • • Select test data on the basis of features of a function to be computed Tester uses her/his domain knowledge. use best engineering judgment Special test cases/Error guessing Is useful – don't discount effectiveness ! .

product / code • Alpha / Beta testing • Acceptance testing – customer expectations – notion of stability (time) • Certification testing – external compliance – third party .Levels of testing What does each level of testing uncover? • • • Unit testing – implementation deficiencies – Code / LLD Integration testing – interface deficiencies – architecture / HLD System testing – requirement deficiencies – SRS • Regression testing – fix has not broken existing functionality .

Unit Testing What is Unit testing? .

Smallest testable piece of software q A unit can be compiled / assembled / linked / loaded.Unit Testing Unit. and put under a test harness q Unit testing is done to show that the unit does not satisfy the functional specification and/or its implemented structure does not match the intended design structure q .

Integration Testing What is integration testing? .

Integration Testing Integration is the process of aggregating components to create larger components. q Integration testing done to show that even though components were individually satisfactory. the combination is incorrect or inconsistent q .

Integration problems What are the general integration problems? .

Types of Integration problems Configuration / version control q I/O format. protocol mismatches q Conflicting data views/ usage q Data integrity violated q Wrong parameters q .

Integration test approach • • • Top down Bottom up Sandwich M0 M11 M12 M13 M21 M22 M23 M31 .

Top down integration • • • Modules are integrated by moving downward Depth-first or breadthfirst manner Verifies major control or decision points early in the test process Stubs replace low-level modules M0 M11 M12 M13 • M21 M22 M23 M31 .

Bottom – up integration • Construction and testing with atomic modules Stubs are NOT needed Drivers are needed • • .

g.Module has high cyclomatic complexity .. • • • • Interface integrity Functional validity Information content Performance • • .Has special nonfunctional (e. .Module used by lot of other modules .Integration testing – some thoughts • • How to choose integration order – incremental May be based on criticality of interfaces/module Risk reduction principle may be used Critically based on . performance) requirements What to check for ….

System testing What is system testing? .

to inconsistencies between components or planned interactions between components q Concern: issues. security.. performance.g.System Testing A system is the big component q System testing is aimed at revealing bugs that cannot be attributed to a component as such. recovery) q . behaviours that can only be exposed by testing the entire integrated system (e.

System testing is… • • • • • • • Functionality Testing Stress testing Usability testing Security testing Performance testing Storage testing Internationalization testing • • • • • • • Compatibility testing Installation testing Reliability testing Recovery testing Supportability testing Compliance testing … .

Acceptance Testing Aims at uncovering ‘implied requirements’ q Aims at evaluating ‘fitness for use’ q Should not find bugs which should have been found in earlier testing phases q .

Regression Testing  Testing after changes been made to ensure that no unwanted changes were made .

Test Strategy This defines the scope and general directions for testing for a project q Should be developed for each project q Should be reviewed and approved with the project plan q .

etc Test plans should be prepared as soon as the corresponding document in the development life cycle is produced . schedules. functions that will be tested for a specific level of testing.Test Plan   Test plans specify the test conditions. features. Plans also contain other information about resources.

Test specification What is test specification? .

in parallel. or in some combination of consecution.Test Case q A sequence of steps. that creates the desired test conditions that the test case is designed to evaluate . and other actions. sub steps. performed serially.

Is complete testing possible? q To prove that a program is free of bugs is •Practically impossible •Theoretically a mammoth exercise .

Stop Criteria When to stop testing? .

STOP Criteria Time runs out – Poor criteria q A certain number of errors found q Require a certain test coverage q Stop when testing becomes unproductive q .

Software testing Exercise Prepare a checklist for testing .

IV & V What is Independent Verification & Validation? .

Sign up to vote on this title
UsefulNot useful