software testing methodologies - aditya engineering college 1

16
7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 1/16 Software Testing Methodologies Course Page R07 Regulation - Dept. of CSE & IT Aditya Engineering College HOME SCHEDULE RESOURCES GLOSSARY ASSIGNMENTS QUICK LINKS BRIEF OVERVIEW UNI T I Purpose of Testing Dichotomies Model for Testing Consequences of Bugs Taxonomy of Bugs Summary UNI T I I Basics of Path Testing Predicates, Path Predicates and Achievable Paths Path Sensitizing Path Instrumentation Application of Path Testing Summary UNI T I I I Transaction Flows Transaction Flow Testing Techniques Implementation Basics of Data Flow Testing Strategies in Data Flow Testing Application of Data Flow UNIT I - INTRODUCTION INTRODUCTION: This unit gives a brief introduction to testing, the need for testing, types of bugs and their consequences. At the end of this unit, the student will be able to: Understand the importance of testing and debugging. Interpret a model for testing and understand the process of testing. Discuss the limitations of testing. Identify the consequences and understand the importance of bugs. Classify the bugs into different categories. PURPOSE OF TESTING: TOP Testing consumes atleast half of the time and work required to produce a functional program. MYTH: Good programmers write code without bugs. (Its wrong!!!) History says that even well written programs still have 1-3 bugs per hundred statements. Productivity and Quality in software: In production of comsumer goods and other products, every manufacturing stage is subjected to quality control and testing from component to final stage. If flaws are discovered at any stage, the product is either discarded or cycled back for rework and correction. Productivity is measured by the sum of the costs of the material, the rework, and the discarded componenets, and the cost of quality assurance and testing. There is a trade off between quality assurance costs and manufacturing costs: If sufficient time is not spent in quality assurance, the reject rate will be high and so will be the net cost. If inspection is good and all errors are caught as they occur, inspection costs will dominate, and again the net cost will suffer. Testing and Quality assurance costs for 'manufactured' items can be as low as 2% in consumer products or as high as 80% in products such as space-ships, nuclear reactors, and aircrafts, where failures threaten life. Where as the manufacturing cost of a software is trivial. The biggest part of software cost is the cost of bugs: the cost of

Upload: haibye424

Post on 27-Dec-2015

148 views

Category:

Documents


3 download

DESCRIPTION

SW

TRANSCRIPT

Page 1: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 1/16

Software Testing Methodologies Course PageR07 Regulation - Dept. of CSE & IT

Aditya Engineering College

HOME SCHEDULE RESOURCES GLOSSARY ASSIGNMENTS

QUICK LINKS

BRIEF

OVERVIEW

UNIT I

Purpose of

Testing

Dichotomies

Model for

Testing

Consequences

of Bugs

Taxonomy of

Bugs

Summary

UNIT II

Basics of Path

Testing

Predicates, Path

Predicates and

Achievable

Paths

Path Sensitizing

Path

Instrumentation

Application of

Path Testing

Summary

UNIT III

Transaction

Flows

Transaction

Flow Testing

Techniques

Implementation

Basics of Data

Flow Testing

Strategies in

Data Flow

Testing

Application of

Data Flow

UNIT I - INTRODUCTION

INTRODUCTION:

This unit gives a brief introduction to testing, the need for testing, types of bugs andtheir consequences.

At the end of this unit, the student will be able to:

Understand the importance of testing and debugging.

Interpret a model for testing and understand the process of testing.

Discuss the limitations of testing.

Identify the consequences and understand the importance of bugs.

Classify the bugs into different categories.

PURPOSE OF TESTING:

TOP

Testing consumes atleast half of the time and work required to produce afunctional program.

MYTH: Good programmers write code without bugs. (Its wrong!!!)

History says that even well written programs still have 1-3 bugs per hundredstatements.

Productivity and Quality in software:In production of comsumer goods and other products, everymanufacturing stage is subjected to quality control and testing fromcomponent to final stage.

If flaws are discovered at any stage, the product is either discarded orcycled back for rework and correction.

Productivity is measured by the sum of the costs of the material, therework, and the discarded componenets, and the cost of qualityassurance and testing.

There is a trade off between quality assurance costs and manufacturingcosts: If sufficient time is not spent in quality assurance, the reject ratewill be high and so will be the net cost. If inspection is good and allerrors are caught as they occur, inspection costs will dominate, andagain the net cost will suffer.

Testing and Quality assurance costs for 'manufactured' items can be aslow as 2% in consumer products or as high as 80% in products suchas space-ships, nuclear reactors, and aircrafts, where failures threatenlife. Where as the manufacturing cost of a software is trivial.

The biggest part of software cost is the cost of bugs: the cost of

Page 2: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 2/16

Testing

Summary

UNIT IV

Domains and

Paths

Nice and Ugly

domains

Domain Testing

Domain and

Interface

Testing

Domains and

Testability

Summary

UNIT V

Path products

and Path

expression

Reduction

Procedure

Applications

Regular

Expressions and

Flow Anomaly

Detection

Summary

UNIT VI

Logic Based

Testing

Decision Tables

Path

Expressions

KV Charts

Specifications

Summary

detecting them, the cost of correcting them, the cost of designing teststhat discover them, and the cost of running those tests.

For software, quality and productivity are indistinguishable because thecost of a software copy is trivial.

Testing and Test Design are parts of quality assurance should also focus on bugprevention. A prevented bug is better than a detected and corrected bug.

Phases in a tester's mental life can be categorised into the following 5 phases:1. Phase 0: (Until 1956: Debugging Oriented) There is no difference

between testing and debugging. Phase 0 thinking was the norm in earlydays of software development till testing emerged as a discipline.

2. Phase 1: (1957-1978: Demonstration Oriented) The purpose oftesting here is to show that software works. Highlighted during the late1970s. This failed because the probability of showing that softwareworks 'decreases' as testing increases. i.e. The more you test, themore likely you'ill find a bug.

3. Phase 2: (1979-1982: Destruction Oriented) The purpose of testing isto show that software doesnt work. This also failed because thesoftware will never get released as you will find one bug or the other.Also, a bug corrected may also lead to another bug.

4. Phase 3: (1983-1987: Evaluation Oriented) The purpose of testing isnot to prove anything but to reduce the perceived risk of not working toan acceptable value (Statistical Quality Control). Notion is that testingdoes improve the product to the extent that testing catches bugs and tothe extent that those bugs are fixed. The product is released when theconfidence on that product is high enough. (Note: This is applied tolarge software products with millions of code and years of use.)

5. Phase 4: (1988-2000: Prevention Oriented) Testability is the factorconsidered here. One reason is to reduce the labour of testing. Otherreason is to check the testable and non-testable code. Testable codehas fewer bugs than the code that's hard to test. Identifying the testingtechniques to test the code is the main key here.

Test Design: We know that the software code must be designed and tested, butmany appear to be unaware that tests themselves must be designed and tested.Tests should be properly designed and tested before applying it to the acutalcode.

Testing is'nt everything: There are approaches other than testing to create bettersoftware. Methods other than testing include:

1. Inspection Methods: Methods like walkthroughs, deskchecking,formal inspections and code reading appear to be as effective as testingbut the bugs caught donot completely overlap.

2. Design Style: While designing the software itself, adopting stylisticobjectives such as testability, openness and clarity can do much toprevent bugs.

3. Static Analysis Methods: Includes formal analysis of source codeduring compilation. In earlier days, it is a routine job of the programmerto do that. Now, the compilers have taken over that job.

4. Languages: The source language can help reduce certain kinds ofbugs. Programmers find new bugs while using new languages.

5. Development Methodologies and Development Environment: Thedevelopment process and the environment in which that methodology isembedded can prevent many kinds of bugs.

TOP

DICHOTOMIES:

Page 3: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 3/16

TOP

Testing Versus Debugging: Many people consider both as same. Purpose oftesting is to show that a program has bugs. The purpose of testing is to find theerror or misconception that led to the program's failure and to design andimplement the program changes that correct the error.

Debugging usually follows testing, but they differ as to goals, methods and mostimportant psychology. The below tab le shows few important differences betweentesting and debugging.

Testing Debugging

Testing starts with knownconditions, uses predefinedprocedures and has predictableoutcomes.

Debugging starts from possiblyunknown intial conditions and the endcan not be predicted exceptstatistically.

Testing can and should beplanned, designed and scheduled.

Procedure and duration of debuggingcannot be so constrained.

Testing is a demonstration oferror or apparent correctness.

Debugging is a deductive process.

Testing proves a programmer'sfailure.

Debugging is the programmer'svindication (Justification).

Testing, as executes, shouldstrive to be predictable, dull,constrained, rigid and inhuman.

Debugging demands intutive leaps,experimentation and freedom.

Much testing can be donewithout design knowledge.

Debugging is impossible withoutdetailed design knowledge.

Testing can often be done by anoutsider.

Debugging must be done by an insider.

Much of test execution anddesign can be automated.

Automated debugging is still a dream.

Function Versus Structure: Tests can be designed from a functional or astructural point of view. In functional testing, the program or system is treated asa blackbox. It is subjected to inputs, and its outputs are verified for conformanceto specified behaviour. Functional testing takes the user point of view- botherabout functionality and features and not the program's implementation. Structuraltesting does look at the implementation details. Things such as programmingstyle, control method, source language, database design, and coding detailsdominate structural testing.

Both Structural and functional tests are useful, both have limitations, and bothtarget different kinds of bugs. Functional tets can detect all bugs but would takeinfinite time to do so. Structural tests are inherently finite but cannot detect allerrors even if completely executed.

Designer Versus Tester: Test designer is the person who designs the testswhere as the tester is the one actually tests the code. During functional testing,the designer and tester are probably different persons. During unit testing, thetester and the programmer merge into one person.

Tests designed and executed by the software designers are by nature biasedtowards structural consideration and therefore suffer the limitations of structuraltesting.

Modularity Versus Efficiency: A module is a discrete, well-defined, smallcomponent of a system. Smaller the modules, difficult to integrate; larger themodules, difficult to understand. Both tests and systems can be modular. Testingcan and should likewise be organised into modular components. Small,independent test cases can be designed to test independent modules.

Small Versus Large: Programming in large means constructing programs thatconsists of many components written by many different programmers.

Page 4: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 4/16

Programming in the small is what we do for ourselves in the privacy of our ownoffices. Qualitative and Quantitative changes occur with size and so must testingmethods and quality criteria.

Builder Versus Buyer: Most software is written and used by the sameorganization. Unfortunately, this situation is dishonest because it cloudsaccountability. If there is no separation between builder and buyer, there can beno accountability.

The different roles / users in a system include:1. Builder: Who designs the system and is accountable to the buyer.

2. Buyer: Who pays for the system in the hope of profits from providingservices.

3. User: Ultimate beneficiary or victim of the system. The user's interestsare also guarded by.

4. Tester: Who is dedicated to the builder's destruction.

5. Operator: Who has to live with the builders' mistakes, the buyers'murky (unclear) specifications, testers' oversights and the users'complaints.

TOP

MODEL FOR TESTING:

TOP

Figure 1.1: A Model for Testing

Above figure is a model of testing process. It includes three models: A model of theenvironment, a model of the program and a model of the expected bugs.

ENVIRONMENT:A Program's environment is the hardware and software required to makeit run. For online systems, the environment may include communicationlines, other systems, terminals and operators.

The environment also includes all programs that interact with and areused to create the program under test - such as OS, linkage editor,loader, compiler, utility routines.

Because the hardware and firmware are stable, it is not smart to blamethe environment for bugs.

PROGRAM:Most programs are too complicated to understand in detail.

The concept of the program is to be simplified inorder to test it.

If simple model of the program doesnot explain the unexpectedbehaviour, we may have to modify that model to include more facts anddetails. And if that fails, we may have to modify the program.

BUGS:Bugs are more insidious (deceiving but harmful) than ever we expectthem to be.

An unexpected test result may lead us to change our notion of what abug is and our model of bugs.

Some optimistic notions that many programmers or testers have aboutbugs are usually unable to test effectively and unable to justify the dirtytests most programs need.

OPTIMISTIC NOTIONS ABOUT BUGS:1. Benign Bug Hypothesis: The belief that bugs are nice, tame

Page 5: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 5/16

and logical. (Benign: Not Dangerous)

2. Bug Locality Hypothesis: The belief that a bug discoveredwith in a component effects only that component's behaviour.

3. Control Bug Dominance: The belief that errors in thecontrol structures (if, switch etc) of programs dominate thebugs.

4. Code / Data Separation: The belief that bugs respect theseparation of code and data.

5. Lingua Salvator Est: The belief that the language syntaxand semantics (e.g. Structured Coding, Strong typing, etc)eliminates most bugs.

6. Corrections Abide: The mistaken belief that a corrected bugremains corrected.

7. Silver Bullets: The mistaken belief that X (Language, Designmethod, representation, environment) grants immunity frombugs.

8. Sadism Suffices: The common belief (especially byindependent tester) that a sadistic streak, low cunning, andintuition are sufficient to eliminate most bugs. Tough bugsneed methodology and techniques.

9. Angelic Testers: The belief that testers are better at testdesign than programmers are at code design.

TESTS:Tests are formal procedures, Inputs must be prepared, Outcomesshould predicted, tests should be documented, commands need to beexecuted, and results are to be observed. All these errors are subjectedto error

We do three distinct kinds of testing on a typical software system.They are:

1. Unit / Component Testing: A Unit is the smallest testablepiece of software that can be compiled, assembled, linked,loaded etc. A unit is usually the work of one programmer andconsists of several hundred or fewer lines of code. UnitTesting is the testing we do to show that the unit does notsatisfy its functional specification or that its implementationstructure does not match the intended design structure. AComponent is an integrated aggregate of one or more units.Component Testing is the testing we do to show that thecomponent does not satisfy its functional specification or thatits implementation structure does not match the intendeddesign structure.

2. Integration Testing: Integration is the process by whichcomponents are aggregated to create larger components.Integration Testing is testing done to show that eventhough the componenets were individually satisfactory (afterpassing component testing), checks the combination ofcomponents are incorrect or inconsistent.

3. System Testing: A System is a big component. SystemTesting is aimed at revealing bugs that cannot be attributedto components. It includes testing for performance, security,accountability, configuration sensitivity, startup and recovery.

Role of Models: The art of testing consists of creating , selecting, exploring, andrevising models. Our ability to go through this process depends on the number ofdifferent models we have at hand and their ability to express a program'sbehaviour.

PLAYING POOL AND CONSULTING ORACLESTesting is like playing a pool game. Either you hit the ball to any pocket

Page 6: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 6/16

(kiddie pool) or you specify the pocket in advance (real pool). So is thetesting. There is kiddie testing and real testing. In kiddie testing, theobserved outcome will be considered as the expected outcome. In Realtesting, the outcome is predicted and documented before the test isrun.

The tester who cannot make that kind of predictions does notunderstand the program's functional objectives.

Oracles: An oracle is any program, process, or body of data thatspecifies the expected outcome of a set of tests as applied to a testedobject. Example of oracle : Input/Outcome Oracle - an oracle thatspecifies the expected outcome for a specified input.

Sources of Oracles: If every test designer had to analyze and predictthe expected behaviour for every test case for every component, thentest design would be very expensive. The hardest part of test design ispredicting the expected outcome, but we often have oracles that reducethe work. They are:

1. Kiddie Testing: run the test and see what comes out. If youhave the outcome in front of you, and especially if you havethe values of the internal variables, then it is much easier tovalidate that outcome by analysis and show it to be correctthan it is to predict what the outcome should be and validateyour prediction.

2. Regression Test Suites: Today's software development andtesting are dominated not by the design of new software butby rework and maintenance of existing software. In suchinstances, most of the tests you need will have been run on aprevious versions. Most of those tests should have the sameoutcome for the new version. Outcome prediction is thereforeneeded only for changed parts of components.

3. Purchased Suits and Oracles: Highly standardizedsoftware that differ only as to implementation often hascommercially available test suites and oracles. The mostcommon examples are compilers for standard languages.

4. Existing Program: A working, trusted program is anexcellent oracle. The typical use is when the program isbeing rehosted to a new language, operating system,environment, configuration with the intention that the behaviorshould not change as a result of the rehosting.

IS COMPLETE TESTING POSSIBLE?If the objective of the testing were to prove that a program is free ofbugs, then testing not only would be practically impossible, but alsowould be theoretically impossible.

Three different approaches can be used to demonstrate that aprogram is correct.They are:

1. Functional Testing:Every program operates on a finite number ofinputs. A complete functional test would consistsof subjecting the program to all possible inputstreams.

For each input the routine either accepts thestream and produces a correct outcome, acceptsthe stream and produces an incorrect outcome, orrejects the stream and tells us that it did so.

For example, a 10 character input string has 280possible input streams and correspondingoutcomes, so complete functional testing in thissense is IMPRACTICAL.

But even theoritically, we can't execute a purely

Page 7: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 7/16

functional test this way because we don't know thelength of the string to which the system isresponding.

2. Structural Testing:The design should have enough tests to ensurethat every path through the routine is exercised atleast once. Right off that's is impossible becausesome loops might never terminate.

The number of paths through a small routine canbe awesome because each loop multiplies thepath count by the number of times through theloop.

A small routine can have millions or billions ofpaths, so total Path Testing is usuallyIMPRACTICAL.

3. Formal Proofs of Correctness:Formal proofs of correctness rely on a combinationof functional and structural concepts.

Requirements are stated in a formal language (e.g.Mathematics) and each program statement isexamined and used in a step of an inductive proofthat the routine will produce the correct outcomefor all possible input sequences.

The IMPRACTICAL thing here is that such proofsare very expensive and have been applied only tonumerical routines or to formal proofs for crucialsoftware such as system’s security kernel orportions of compilers.

Each approach leads to the conclusion that complete testing, in thesense of a proof is neither theoretically nor practically possible.

THEORITICAL BARRIERS OF COMPLETE TESTING:"We can never be sure that the specifications are correct"

"No verification system can verify every correct program"

"We can never be certain that a verification system is correct"

Not only all known approaches to absoulte demonstrations of correctnessimpractical, but they are impossible. Therefore, our objective must shift from aabsolute proof to a 'suitably convincing' demonstration.

TOP

CONSEQUENCES OF BUGS:

TOP

IMPORTANCE OF BUGS: The importance of bugs depends on frequency,correction cost, installation cost, and consequences.

1. Frequency: How often does that kind of bug occur? Pay more attentionto the more frequent bug types.

2. Correction Cost: What does it cost to correct the bug after it is found?The cost is the sum of 2 factors: (1) the cost of discovery (2) the cost ofcorrection. These costs go up dramatically later in the developmentcycle when the bug is discovered. Correction cost also depends onsystem size.

3. Installation Cost: Installation cost depends on the number ofinstallations: small for a single user program but more for distributed

Page 8: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 8/16

systems. Fixing one bug and distributing the fix could exceed the entiresystem's development cost.

4. Consequences: What are the consequences of the bug? Bugconsequences can range from mild to catastrophic.

A reasonable metric for bug importance is

Importance= ($) = Frequence * (Correction cost + Installationcost + Consequential cost)

CONSEQUENCES OF BUGS: The consequences of a bug can be measure interms of human rather than machine. Some consequences of a bug on a scale ofone to ten are:

1. Mild: The symptoms of the bug offend us aesthetically (gently); amisspelled output or a misaligned printout.

2. Moderate: Outputs are misleading or redundant. The bug impacts thesystem's performance.

3. Annoying: The system's behaviour because of the bug isdehumanizing. E.g. Names are truncated orarbitarily modified.

4. Disturbing: It refuses to handle legitimate (authorized / legal)transactions. The ATM wont give you money. My credit card is declaredinvalid.

5. Serious: It loses track of its transactions. Not just the transaction itselfbut the fact that the transaction occurred. Accountability is lost.

6. Very Serious: The bug causes the system to do the wrongtransactions. Instead of losing your paycheck, the system credits it toanother account or converts deposits to withdrawals.

7. Extreme: The problems aren't limited to a few users or to fewtransaction types. They are frequent and arbitrary instead of sporadicinfrequent) or for unusual cases.

8. Intolerable: Long term unrecoverable corruption of the databaseoccurs and the corruption is not easily discovered. Seriousconsideration is given to shutting the system down.

9. Catastrophic: The decision to shut down is taken out of our handsbecause the system fails.

10. Infectious: What can be worse than a failed system? One that corruptother systems even though it doesnot fall in itself ; that erodes thesocial physical environment; that melts nuclear reactors and starts war.

FLEXIBLE SEVERITY RATHER THAN ABSOLUTES:Quality can be measured as a combination of factors, of which numberof bugs and their severity is only one component.

Many organizations have designed and used satisfactory, quantitative,quality metrics.

Because bugs and their symptoms play a significant role in suchmetrics, as testing progresses, you see the quality rise to a reasonablevalue which is deemed to be safe to ship the product.

The factors involved in bug severity are:1. Correction Cost: Not so important because catastrophic

bugs may be corrected easier and small bugs may takemajor time to debug.

2. Context and Application Dependency: Severity dependson the context and the application in which it is used.

3. Creating Culture Dependency: Whats important dependson the creators of software and their cultural aspirations. Testtool vendors are more sensitive about bugs in their softwarethen games software vendors.

4. User Culture Dependency: Severity also depends on userculture. Naive users of PC software go crazy over bugs where

Page 9: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 9/16

as pros (experts) may just ignore.

5. The software development phase: Severity depends ondevelopment phase. Any bugs gets more severe as it getscloser to field use and more severe the longer it has beenaround.

TOP

TAXONOMY OF BUGS:

TOP

There is no universally correct way categorize bugs. The taxonomy is not rigid.

A given bug can be put into one or another category depending on its history andthe programmer's state of mind.

The major categories are: (1) Requirements, Features and Functionality Bugs (2)Structural Bugs (3) Data Bugs (4) Coding Bugs (5) Interface, Integration andSystem Bugs (6) Test and Test Design Bugs.

REQUIREMENTS, FEATURES AND FUNCTIONALITY BUGS: Variouscategories in Requirements, Features and Functionlity bugs include:

1. Requirements and Specifications Bugs:Requirements and specifications developed fromthem can be incomplete ambiguous, or self-contradictory. They can be misunderstood orimpossible to understand.

The specifications that don't have flaws in themmay change while the design is in progress. Thefeatures are added, modified and deleted.

Requirements, especially, as expressed inspecifications are a major source of expensivebugs.

The range is from a few percentage to more than50%, depending on the application andenvironment.

What hurts most about the bugs is that they arethe earliest to invade the system and the last toleave.

2. Feature Bugs:Specification problems usually createcorresponding feature problems.

A feature can be wrong, missing, or superfluous(serving no useful purpose). A missing feature orcase is easier to detect and correct. A wrongfeature could have deep design implications.

Removing the features might complicate thesoftware, consume more resources, and fostermore bugs.

3. Feature Interaction Bugs:Providing correct, clear, implementable andtestable feature specifications is not enough.

Features usually come in groups or relatedfeatures. The features of each group and theinteraction of features with in the group are usuallywell tested.

Page 10: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 10/16

The problem is unpredictable interactions betweenfeature groups or even between individual features.For example, your telephone is provided with callholding and call forwarding. The interactionsbetween these two features may have bugs.

Every application has its peculiar set of featuresand a much bigger set of unspecified featureinteraction potentials and therefore result in featureinteraction bugs.

Specification and Feature Bug Remedies:Most feature bugs are rooted in human to humancommunication problems. One solution is to use high-level,formal specification languages or systems.

Such languages and systems provide short term support butin the long run, does not solve the problem.

Short term Support: Specification languages facilitateformalization of requirements and inconsistency andambiguity analysis.

Long term Support: Assume that we have a greatspecification language and that can be used to createunambiguous, complete specifications with unambiguouscomplete testsand consistent test criteria.

The specification problem has been shifted to a higher levelbut not eliminated.

Testing Techniques for functional bugs: Most functional testtechniques- that is those techniques which are based on a behavioraldescription of software, such as transaction flow testing, syntax testing,domain testing, logic testing and state testing are useful in testingfunctional bugs.

STRUCTURAL BUGS: Various categories in Structural bugs include:1. Control and Sequence Bugs:

Control and sequence bugs include paths left out,unreachable code, improper nesting of loops, loop-back or loop termination criteria incorrect, missingprocess steps, duplicated processing,unnecessary processing, rampaging, GOTO's, ill-conceived (not properly planned) switches,sphagetti code, and worst of all, pachinko code.

One reason for control flow bugs is that this area isamenable (supportive) to theoritical treatment.

Most of the control flow bugs are easily tested andcaught in unit testing.

Another reason for control flow bugs is that use ofold code especially ALP & COBOL code aredominated by control flow bugs.

Control and sequence bugs at all levels are caughtby testing, especially structural testing, morespecifically path testing combined with a bottomline functional test based on a specification.

2. Logic Bugs:Bugs in logic, especially those related tomisundertanding how case statements and logicoperators behave singly and combinations

Also includes evaluation of boolean expressions indeeply nested IF-THEN-ELSE constructs.

If the bugs are parts of logical (i.e. boolean)processing not related to control flow, they are

Page 11: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 11/16

characterized as processing bugs.

If the bugs are parts of a logical expression (i.econtrol-flow statement) which is used to direct thecontrol flow, then they are categorized as control-flow bugs.

3. Processing Bugs:Processing bugs include arithmetic bugs,algebraic, mathematical function evaluation,algorithm selection and general processing.

Examples of Processing bugs include: Incorrectconversion from one data representation to other,ignoring overflow, improper use of grater-than-or-eual etc

Although these bugs are frequent (12%), they tendto be caught in good unit testing.

4. Initialization Bugs:Initialization bugs are common. Initialization bugscan be improper and superfluous.

Superfluous bugs are generally less harmful butcan affect performance.

Typical initialization bugs include: Forgetting toinitialize the variables before first use, assumingthat they are initialized elsewhere, initializing tothe wrong format, representation or type etc

Explicit declaration of all variables, as in Pascal,can reduce some initialization problems.

5. Data-Flow Bugs and Anomalies:Most initialization bugs are special case of dataflow anamolies.

A data flow anomaly occurs where there is a pathalong which we expect to do somethingunreasonable with data, such as using anuninitialized variable, attempting to use a variablebefore it exists, modifying and then not storing orusing the result, or initializing twice without anintermediate use.

DATA BUGS:Data bugs include all bugs that arise from the specification ofdata objects, their formats, the number of such objects, andtheir initial values.

Data Bugs are atleast as common as bugs in code, but theyare foten treated as if they didnot exist at all.

Code migrates data: Software is evolving towards programs inwhich more and more of the control and processing functionsare stored in tables.

Because of this, there is an increasing awareness that bugsin code are only half the battle and the data problems shouldbe given equal attention.

Dynamic Data Vs Static data:Dynamic data are transitory. Whatever theirpurpose their lifetime is relatively short, typicallythe processing time of one transaction. A storageobject may be used to hold dynamic data ofdifferent types, with different formats, attributesand residues.

Dynamic data bugs are due to leftover garbage in a

Page 12: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 12/16

shared resource. This can be handled in one of thethree ways: (1) Clean up after the use by the user(2) Common Cleanup by the resource manager (3)No Clean up

Static Data are fixed in form and content. Theyappear in the source code or database directly orindirectly, for example a number, a string ofcharacters, or a bit pattern.

Compile time processing will solve the bugscaused by static data.

Information, parameter, and control: Static or dynamicdata can serve in one of three roles, or in combination ofroles: as a parameter, for control, or for information.

Content, Structure and Attributes: Content can be anactual bit pattern, character string, or number put into a datastructure. Content is a pure bit pattern and has no meaningunless it is interpreted by a hardware or software processor.All data bugs result in the corruption or misinterpretation ofcontent. Structure relates to the size, shape and numbersthat describe the data object, that is memory location usedto store the content. (e.g A two dimensional array).Attributes relates to the specification meaning that is thesemantics associated with the contents of a data object.(e.g. an integer, an alphanumeric string, a subroutine). Theseverity and subtlelty of bugs increases as we go fromcontent to attributes because the things get less formal inthat direction.

CODING BUGS:Coding errors of all kinds can create any of the other kind ofbugs.

Syntax errors are generally not important in the scheme ofthings if the source language translator has adequate syntaxchecking.

If a program has many syntax errors, then we should expectmany logic and coding bugs.

The documentation bugs are also considered as coding bugswhich may mislead the maintenance programmers.

INTERFACE, INTEGRATION, AND SYSTEM BUGS:Various categories of bugs in Interface, Integration, andSystem Bugs are:

1. External Interfaces:The external interfaces are the meansused to communicate with the world.

These include devices, actuators,sensors, input terminals, printers, andcommunication lines.

The primary design criterion for aninterface with outside world should berobustness.

All external interfaces, human ormachine should employ a protocol. Theprotocol may be wrong or incorrectlyimplemented.

Other external interface bugs are: invalidtiming or sequence assumptions relatedto external signals

Page 13: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 13/16

Misunderstanding external input oroutput formats.

Insufficient tolerance to bad input data.

2. Internal Interfaces:Internal interfaces are in principle notdifferent from external interfaces butthey are more controlled.

A best example for internal interfacesare communicating routines.

The external environment is fixed andthe system must adapt to it but theinternal environment, which consists ofinterfaces with other components, canbe negotiated.

Internal interfaces have the sameproblem as external interfaces.

3. Hardware Architecture:Bugs related to hardware architectureoriginate mostly from misunderstandinghow the hardware works.

Examples of hardware architecturebugs: address generation error, i/odevice operation / instruction error,waiting too long for a response, incorrectinterrupt handling etc.

The remedy for hardware architectureand interface problems is two fold: (1)Good Programming and Testing (2)Centralization of hardware interfacesoftware in programs written byhardware interface specialists.

4. Operating System Bugs:Program bugs related to the operatingsystem are a combination of hardwarearchitecture and interface bugs mostlycaused by a misunderstanding of what itis the operating system does.

Use operating system interfacespecialists, and use explicit interfacemodules or macros for all operatingsystem calls.

This approach may not eliminate thebugs but at least will localize them andmake testing easier.

5. Software Architecture:Software architecture bugs are the kindthat called - interactive.

Routines can pass unit and integrationtesting without revealing such bugs.

Many of them depend on load, and theirsymptoms emerge only when thesystem is stressed.

Sample for such bugs: Assumption thatthere will be no interrupts, Failure toblock or un block interrupts, Assumptionthat memory and registers wereinitialized or not initialized etc

Page 14: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 14/16

Careful integration of modules andsubjecting the final system to a stresstest are effective methods for thesebugs.

6. Control and Sequence Bugs (Systems Level):These bugs include: Ignored timing,Assuming that events occur in aspecified sequence, Working on databefore all the data have arrived fromdisc, Waiting for an impossiblecombination of prerequisites, Missing,wrong, redundant or superfluous processsteps.

The remedy for these bugs is highlystructured sequence control.

Specialize, internal, sequence controlmechanisms are helpful.

7. Resource Management Problems:Memory is subdivided into dynamicallyallocated resources such as bufferblocks, queue blocks, task controlblocks, and overlay buffers.

External mass storage units such asdiscs, are subdivided into memoryresource pools.

Some resource management and usagebugs: Required resource not obtained,Wrong resource used, Resource isalready in use, Resource dead lock etc

Resource Management Remedies: Adesign remedy that prevents bugs isalways preferable to a test method thatdiscovers them.

The design remedy in resourcemanagement is to keep the resourcestructure simple: the fewest differentkinds of resources, the fewest pools,and no private resource management.

8. Integration Bugs:Integration bugs are bugs having to dowith the integration of, and with theinterfaces between, working and testedcomponents.

These bugs results from inconsistenciesor incompatibilities betweencomponents.

The communication methods includedata structures, call sequences,registers, semaphores, communicationlinks and protocols results in integrationbugs.

The integration bugs do not constitute abig bug category(9%) they areexpensive category because they areusually caught late in the game andbecause they force changes in severalcomponents and/or data structures.

9. System Bugs:

Page 15: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 15/16

System bugs covering all kinds of bugsthat cannot be ascribed to a componentor to their simple interactions, but resultfrom the totality of interactions betweenmany components such as programs,data, hardware, and the operatingsystems.

There can be no meaningful systemtesting until there has been thoroughcomponent and integration testing.

System bugs are infrequent(1.7%) butvery important because they are oftenfound only after the system has beenfielded.

TEST AND TEST DESIGN BUGS:Testing: testers have no immunity to bugs. Testsrequire complicated scenarios and databases.

They require code or the equivalent to execute andconsequently they can have bugs.

Test criteria: if the specification is correct, it iscorrectly interpreted and implemented, and aproper test has been designed; but the criterion bywhich the software's behavior is judged may beincorrect or impossible. So, a proper test criteriahas to be designed. The more complicated thecriteria, the likelier they are to have bugs.

Remedies: The remedies of test bugs are:1. Test Debugging: The first remedy for

test bugs is testing and debugging thetests. Test debugging, when comparedto program debugging, is easierbecause tests, when properly designedare simpler than programs and donothave to make concessions to efficiency.

2. Test Quality Assurance: Programmershave the right to ask how quality inindependent testing is monitored.

3. Test Execution Automation: Thehistory of software bug removal andprevention is indistinguishable from thehistory of programming automation aids.Assemblers, loaders, compilers aredeveloped to reduce the incidence ofprogramming and operation errors. Testexecution bugs are virtually eliminatedby various test execution automationtools.

4. Test Design Automation: Just asmuch of software development has beenautomated, much test design can beand has been automated. For a givenproductivity rate, automation reducesthe bug count - be it for software or be itfor tests.

Page 16: Software Testing Methodologies - Aditya Engineering College 1

7/11/2014 SOFTWARE TESTING METHODOLOGIES - ADITYA ENGINEERING COLLEGE

http://www.mcr.org.in/sureshmudunuri/stm/unit1.php#testing_purpose 16/16

TOP

SUMMARY:

TOP

The biggest part of software cost is the cost of bugs: the cost of detecting them,the cost of correcting them, the cost of designing tests that discover them, andthe cost of running those tests.

Testing is'nt everything: There are approaches other than testing to create bettersoftware.

If the objective of the testing were to prove that a program is free of bugs, thentesting not only would be practically impossible, but also would be theoreticallyimpossible.

The importance of a bug depends on its frequency, the correction cost, theconsequential cost, and the application.

Test techniques are like antibiotics - their effectiveness depends on the target -what works against a virus may not work against bacteria or fungi. The testtechniques you use must be matched to the kind of bugs you have.

Because programmers learn from their mistakes, the effectiveness of testtechniques, just as antibiotics, erodes with time. TEST SUITES WEAR OUT.

A comprehensive bug taxonomy (classification) is a prerequisite to gatheringuseful bug statistics. Adopt a taxonomy, simple or elaborate, but adopt one andclassify all bugs within it.

Continually gather bug statistics (in accordance to your taxonomy) to determinethe kind of bugs you have and the effectiveness of your current test techniquesagainst them.

TOP

© 2010 Suresh Babu Mudunuri, Associate Professor, Aditya Engineering College