You are on page 1of 9

Testing:"Testing is a Process of Checking a Program and finding the errors from the program".

Ones source code has been generated software must be tested to uncover and correct as many errors as possible before delivering to your customer. Your goal is to design a series of test cases that have a high likely hood of finding errors for that some software techniques provides systematic guiders for designing test cases. With the help of testing we can find errors from the software and can create error free and effective software. Good software depends on three maters 1. Proper communication between user and developer 2. Ability of developer 3. Time for developing Testing Objective:Following are the testing objectives.

Testing is a process of executing a program with the interface of finding an error. A good test case is one that has high probability of finding and undiscovered error. A successful test is one that uncovers and as yet undiscovered error

Testing Principle:A software engineer must understand the basic principal that guide software testing principle which software engineer can apply.

All tests should be traceable to customer requirement. Test should be planed long before testing begins means test planning can begin as soon as the requirement model is complete detail definition of test cases can begin as soon as the design model has been prepared therefore all test can be planed and design before any code has been generated.

The Pareto principle applies to the software testing. This principle states that 80% all errors uncovered during testing will likely be traceable to 20% of program component during our testing phase 80% error should detected and corrected.

Testing should begin in the small and progress to words testing in the large. The first test planned and executed normally. Focus an individual components or model as testing progresses. Focus shift in attempt to find errors in integrated clusters of components and finally in entire system.

Executive testing is not possible.

It is impossible to execute every combination of each path during testing but it is possible to cover program logic & to ensure that all conditions in the component level design have been.

To be most effective testing should be conducted by an independent third party most effective means testing that has highest probability of finding error the software engineer who created the system is not best person to conduct all tests for the software.

Types of Testing:There are basically two types of testing


White box testing Black box testing

White Box Testing:White-box testing, sometimes called glass-box testing. It is a test case design method that uses the control structure of the procedural design to derive test cases. By using white box testing method the software designer can derived test cases that. Guarantee that all independent paths within a module have exercised at least ones. Exercised all logical decisions on their true and false side. Exercised all loops at their boundaries and within their operational bound. Exercised internal data structures to ensure their validities. By using white box testing we can find out any logical error is there or typographical error or syntax error. Methods: There are two methods in white box testing. 1. Basic path testing techniques:Basis path testing is a white box testing technique. The basis path method enables the test case designer to derive a logical complexity measure of a procedural design and use the measure as a guide for defining a basis set of execution path. 1) Flow Graph Notation: It is a simple notation for the representation of control flow is called flow graph or program graph. The flow graph shows logical control flow using following notation where flowchart is used to show program control logic.

In above figure each circle is called a flow of graph node which represents one or more procedural statement. A sequence of process boxes and decision diamond can map a single node. The arrow on the flow graph is called an edge or links. It represents flow of

control and edge must terminate at a node. Area bounded by edges and nodes are called region when compound conditions are encountered in a procedural design. The generation of flow graph becomes more complicated here separate node is created for each conditions and each node that contains a condition is called "predicate node". It is characterized by two or more edges coming from it or outgoing. 2) Cyclomatic Complexity: The number of tests to test all control statements equals the Cyclomatic complexity. Cyclomatic complexity equals number of conditions in a program. Although all paths are executed, all combinations of paths are not executed It is software matrix that provides qualitative measures of logical complexity of program. It is used in the context of basic path testing method. The value computed for cyclomatic complexity defines the number of independents paths in the basis set of program and provide us width and upper bound for the number of test that must be conducted to ensure that all statements have been executed at least one time. An independent path is any path through the program that introduce at least one new set of processing statement or a new condition i.e. node. An independent path must move alone at least one edge that has not been independent before the path11 11, path2 1 2 3 4 5 10 1, path3 1 2 3 6 8 10 1, path4 1 2 3 4 5. Total numbers of paths are four so we can say that the cyclomatic complexity is four has a foundation in graph theory. There are 3 ways to find out cycloramic complexity. The number of regions of the flow graph corresponds to the cycloramic complexity. Cyclomatic complexity = Number of edges - Number of nodes +2 CC V (G) for a flow graph is defined as V (G) = E N + 2 where E = Number of flow graph uses N = number of flow graph node total is node V (G) = 4. CC V (G) for the flow graph a is associated as V (G) = P+1 where P is number of predicate node count in G so in above fig 3 V (G) = 3+1 = 4. 3) Graph Matrix: -

The procedure for deriving the flow graph and determining a set of basis path is manageable mechanism to develop software tools that help in basis path testing a data structure is called a graph matrix. A graph matrix is a structure matrix whose size means number of rows and column is equal to the number of nodes on the flow graph. A simple example of a flow graph and its corresponding graph matrix shown in above figure refereeing to the figure each node on the flow graph is identified by numbers by each edged identified by letters. A letter entry is made in the matrix to correspond to a flow graph or a connection between two nodes. E.g. node 3 is connected to node 4 by edge b. the graph matrix is nothing more-then tabular representation of a flow graph by adding a link weight to each matrix entry. The graph matrix can become a powerful tool for evaluating program control structure during testing. The link weight provides additional information about control flow in its simplest form. The link

weight is one if communication exists and the link weight is 0 if connection does not exist. It can include condition testing, dataflow testing and loop testing. Loop testing has simple loop, nested loop, concentrated loop and unstructured loop. 1) Conditional Testing: The condition testing focuses on testing each condition in the program to ensure that it does not contain error. Conditional testing is a test case design method that exercise the logical condition contained in a program module. A simple condition is a Boolean variable or a relational expression a relational expression taken the form E1 < relational operator > E2. Where E1 and E2 are arithmetic expression and relational operators are one of the following i.e. <, >, , , =, . Compound condition is composed of two or more simple conditions, Boolean operator and parenthesis. If the condition is correct then at least one component of the condition is incorrect therefore types of errors in a condition include Boolean operator errors, extra Boolean operator, Boolean parenthesis error, relational error and arithmetic expression error. 1. Branch testing: The true and false and false branches of the condition and every simple conditions are tested. 2. Domain Testing: This can detect the Boolean operator errors, variable errors, parentheses errors. 3. BRO(Branch and Relational operator: This can detect the branch and relational errors. 2) Dataflow Testing: This method tests the flow of the data. This method selects the test path of a program and uses of variable in the program. This method check the variable and it's value at each state of the program. So by this way we can check the dataflow.

If statement s is if or loop statement then we are checking all the flow of variables used in statement s in our program. 3) Loop Testing: Loop testing is a white box testing technique which is focuses on loops. There are 4 different types of loops. I. SimpleLoop:The following set of test can be applied to simple loops, where n is the maximum numbers of allowable passes through the loop. Skip the loop entirely. Only one passes through the loop. Two passes through the loop. M passes through the loop where m < n, n-1, n , n+1passes through the loop. II. NestedLoop:If we want to extend the test approach for simple loops to nested loops, the number of possible tests would grow geometrically as the level of nesting.

III. ConcentratedLoop:Concentrated loop can be test using approach defined for simple loops, if each loop is interpret of the other. IV. UnstructuredLoop:Whenever possible class of loops should be redesign to reflect use of structured programming constructs.

Black box testing is also called "behavioral testing". This testing technique focuses on the functional requirements of the software. Black box testing is not an alternative of white box testing. It is overview type testing. It focus on what is input and what is output. It is an approach i.e. likely to uncover a different class of errors then white box testing method. Black box testing attempts to find errors in the following categories. Incorrect or missing function. Interface errors. Errors in data structure or external database access. Behavior or performance error. Initialization and termination error. Black box testing is design to answer following questions. How is functional validity tested? How are system behavior and performance tested? What classes of input will make good test cases? How are the boundaries of data classes isolated? What data rates and data values can the system tolerate? 1. Graph Based Testing Method: -

o A graph represents the relationship between data objects and program objects. o Enabling us to derived test cases that search for errors associated with this relationship. o So software testing begins by creating a graph of important objects and their relationship then we are deriving a series of test that will cover the graph. o So that each objects and relationships are exercises and errors are uncovers the software engineer being testing by creating a graph. o A collection of nodes that represents objects and links represent the relationship between objects. o Node weights describe the properties of.\ o Nodes are represented as a circle connected by links that take number of forms. o A directed link represented by an arrow indicates that relationship moves in only one direction. o A bidirectional link also called a symmetric link implies that the relationship apply both directions. o Parallel links are used when a number of different relationships are established between graph nodes.

2. Equivalence Partitioning: Equivalence partitioning is a black box testing that derived the input domain of program into classes of data which test cases can be derived. Test cases derived for equivalence partitioning is based on equivalence of classes for input condition. An equivalence class represents the set of valid or invalid statements for input condition. Input condition is either specific a numeric value, a range of value, a set of related value or Boolean condition. Equivalence classes may be defines according to following guide lines. o If an input condition specified a range then one valid and two invalid equivalence classes are define.

o If an input condition requires specific values then one valid and two invalid equivalence classes are define. o If an input condition specifies a member of set then one valid and one invalid equivalence classes are define. o If an input condition is Boolean then one valid and one invalid equivalence classes are define.

o Example: Automated Banking Applications. User can access the bank using personal computer, provides six digit password, and follow with a series of typed commands that triggers various banking functions. Area-code: blank or three digit number Prefix: three digit number begin with 0 or 1 Suffix: four digit number Password: six digit alpha-numeric number Commands: check, deposit, bill pay 3. Boundary Value Analysis (BVA): Black box testing method is used to check boundary value of any loop. A greater number of errors occur at boundaries of input domain rather-then in central value. It for this reason that boundary value analysis has been develop as testing technique. Boundary value analysis leads to a selection of test cases that exercises boundary value. A boundary value analysis is a test case design technique that complements equivalence portion rather-then focuses the input condition boundary derived test case from output domain following are equivalence for boundary value analysis. If an input condition specifies a range bounded by value a and b then test cases should design with value a and b and just above and just below a and b. If an input condition specifies a number of value the test cases should be develop that exercise the minimum and maximum number. The value above and below the minimum and maximum are also tested. 4. Comparison Testing: Multiple copies of the software are constructed Each version are independently built by the different software engineering team Finally input is giving to each version at a time and output is compared of each versions output, If output is different, each of the application must feed to determine if defect in one or more version is reasonable for the different. 5. Orthogonal Array Testing: There are many applications in which the input domain is relative limited that is number of input parameters are small and values that each of the parameters are take already bounded. Orthogonal array testing can be applied to problem in which the input domain relative small half if it is too large to accommodated exclusive testing. The orthogonal array testing method is a particularly useful in finding errors associated with region form and within software components. E.g. if we consider a system that has 3 input item x, y and z each of this input item has 3 describe values associated with their case 33=27 possible test cases. Such test cases are useful only when one is certain that these test parameters don't interacts that can detected logical full make the software multifunction this fault called single mode fault. This method can detect a limited for in a particular function.

Testing Process:-

Testing accept for small programs system should be tested as a single. Large systems are built out of subsystems which are divided into module and each module composed of procedures and function. The testing process should proceed in stages where testing is carried out incrementally in conjunction with system implementation. The most widely used testing process consists of five stages which are shown in above figure. In general the sequence of testing activity are component testing and user testing as errors are discovered at any one stage they require program modification to correct them and again testing process repeated the process is therefore &n iterative process. The arrows from the top of the boxes indicate the normal sequence of testing and the arrows return is to the previous box indicate that previous test stage may have to be repeated. The stages in the testing processes are.
I. Unit Testing: -

In this testing individual components are tested to ensure that they operate correctly or not each component is test independently without other system components.
II. Module Testing: -

A module is a collection of dependent components such as object class, abstract data type or a collection of procedures and function. A module encapsulates related components so it can be tested without one system module.
III. Subsystem Testing: -

This face involves testing collection of modules which have been integrated into subsystems. Subsystem may be independent design and implemented. The subsystem test process should construct on the detection of interface error.
IV. System Testing: -

The subsystems are integrated to make up the entire system. The testing process is concern with finding errors and interaction between subsystems and system components. This is also concern with validate whenever the system made its functional and nonfunctional requirement or not.

V.

Acceptance Testing: -

This is a final stage in testing process before the system is accepted for operational use. The system is tested with data by the customer the real data exercised the system in different ways from the test data. Acceptance testing is sometimes called alpha testing. The alpha testing process continuous until the system developer and client agree that the delivered system is an acceptable implementation of the system requirements. When a system is to be marketed as a software product a testing process called beta testing is often use. Beta testing involves delivering a system to a number of customers who agree to use the system that report problems to the system developer after testing feedback the system is modified and either re case for future beta testing for general sale.

You might also like