We will discuss algorithms and techniques for test case design based on graphs, logic, syntax of programming languages and on inputs. Special techniques for testing object-oriented features and web applications will also be discussed.
The course will end with symbolic testing techniques. These broadly will cover test cases for both white-box and black-box. The course will be useful for any firm that does tests their software.
Course layout Week 1: Techniques and algorithms for test case design: Graphs based testing- structural coverage criteria.
Week 2: Graphs based testing: Data flow coverage criteria. Week 3: Graphs based testing: Data flow coverage criteria. Week 4: Graphs coverage for source code, design elements and requirements.
Week 5: Techniques and algorithms for test case design: Logic based testing- Predicates, logic based coverage criteria. Constraints are imposed 4. The columns in the decision table are converted into test cases. Software Testing The basic notation for the graph is shown in fig. Software Testing Myers explained this effectively with following example. The character in column 2 must be a digit.
In this situation, the file update is made. If the character in column 1 is incorrect, message x is issued. The causes are c1: character in column 1 is A c2: character in column 1 is B c3: character in column 2 is a digit and the effects are e1: update made e2: message x is issued e3: message y is issued Software Engineering 3rd ed. Software Testing The E constraint states that it must always be true that at most one of c1 or c2 can be 1 c1 or c2 cannot be 1 simultaneously.
The I constraint states that at least one of c1, c2 and c3 must always be 1 c1, c2 and c3 cannot be 0 simultaneously. The O constraint states that one, and only one, of c1 and c2 must be 1. The constraint R states that, for c1 to be 1, c2 must be 1 i. Draw the Cause effect graph and identify the test cases. Software Testing Solution The causes are c1: c2: c3: c4: c5: c6: side x is less than sum of sides y and z side y is less than sum of sides x and y side z is less than sum of sides x and y side x is equal to side y side x is equal to side z side y is equal to side z and effects are e1: Not a triangle e2: Scalene triangle e3: Isosceles triangle e4: Equilateral triangle e5: Impossible stage Software Engineering 3rd ed.
Software Testing The cause effect graph is shown in fig. The test cases for this problem are available in Table 5. It permits us to examine the internal structure of the program. Path Testing Path testing is the name given to a group of test techniques based on judiciously selecting a set of test paths through the program.
If the set of paths is properly chosen, then it means that we have achieved some measure of test thoroughness. This type of testing involves: 1. Software Testing Flow Graph The control flow of a program can be analysed using a graphical representation known as flow graph. The flow graph is a directed graph in which nodes are either entire statements or fragments of a statement, and edges represents flow of control.
Software Testing Software Engineering 3rd ed. Software Testing DD Path Graph Table 7: Mapping of flow graph nodes and DD path nodes Flow graph nodes DD Path graph corresponding node Remarks 1 to 9 n1 There is a sequential flow from node 1 to 9 10 n2 Decision node, if true go to 13 else go to 44 11 n3 Decision node, if true go to 12 else go to 19 12 n4 Decision node, if true go to 13 else go to 15 13,14 n5 Sequential nodes and are combined to form new node n5 15,16,17 n6 Sequential nodes 18 n7 Edges from node 14 to 17 are terminated here 19 n8 Decision node, if true go to 20 else go to 37 20 n9 Intermediate node with one input edge and one output edge 21 n10 Decision node, if true go to 22 else go to 27 22 n11 Intermediate node 23 n12 Decision node, if true go to 24 else go to 26 Software Engineering 3rd ed.
Also a decision node 28,29 n16 Sequential nodes 30 n17 Decision node, if true go to 31 else go to 33 31,32 n18 Sequential nodes 33,34,35 n19 Sequential nodes 36 n20 Three edge from node 29,32 and 35 are terminated here 37 n21 Decision node, if true go to 38 else go to 40 38,39 n22 Sequential nodes 40,41,42 n23 Sequential nodes 43 n24 Three edge from node 36,39 and 42 are terminated here Cont….
Two edge from nodes 58 and 53 are terminated. Software Testing Flow graph nodes DD Path graph corresponding node Remarks 60,61,62 n37 Sequential nodes 63,64,65,66 n38 Sequential nodes 67 n39 Two edge from node 62 and 66 are terminated here 68 n40 Decision node, if true go to 69 else go to 72 69,70,71 n41 Sequential nodes 72,73,74,75 n42 Sequential nodes 76 n43 Four edges from nodes 50, 67, 71 and 75 are terminated here.
Its input a triple of positive integers say a,b,c and value may be from interval [0,]. The program is given in fig. The output may have one of the following words: [Not a quadratic equation; real roots; Imaginary roots; Equal roots] Draw the flow graph and DD path graph. Also find independent paths from the DD Path graph. Software Testing Cont…. Software Testing Solution Fig. Its input is a triple of positive integers say a,b,c from the interval [1,].
The output may be [Scalene, Isosceles, Equilateral, Not a triangle]. Also find the independent paths from the DD Path graph. Software Testing Solution : Flow graph of triangle problem is: Fig. For example, a flow graph shown in in Fig. Path 1 : acf Path 2 : abef Path 3 : adcf Path 4 : a b e a c f or a b e a b e f Path 5 : abebef Software Engineering 3rd ed. Software Testing Several properties of cyclomatic complexity are stated below: 1. V G is the maximum number of independent paths in graph G.
Inserting a new row in G increases V G by unity. V G depends only on the decision structure of G. We define a flow graph with unique entry and exit nodes, all nodes reachable from the entry, and exit reachable from all nodes. This definition would result in all flow graphs having only one connected component. One could, however, imagine a main program M and two called subroutines A and B having a flow graph shown in Fig. In general, the complexity of a collection C of flow graphs with K connected components is equal to the summation of their complexities.
Software Testing Two alternate methods are available for the complexity calculations. Cyclomatic complexity V G of a flow graph G is equal to the number of predicate decision nodes plus one. Cyclomatic complexity is equal to the number of regions of the flow graph. Software Testing Solution Cyclomatic complexity can be calculated by any of the three methods.
Find cyclomatic complexity. Find the cyclomatic complexity: Software Engineering 3rd ed. Find the cyclomatic complexity. Hence, there are seven independent paths as given in example 8. Software Testing Graph Matrices A graph matrix is a square matrix with one row and one column for every node in the graph. The size of the matrix i. Some examples of graphs and associated matrices are shown in fig.
Software Testing The square matrix represent that there are two path ab and cd from node 1 to node 2. It has nothing to do with data flow diagrams. Statements where variables receive values. Statements where these values are used or referenced. As we know, variables are defined and referenced throughout the program. A variable is used but never defined. A variable is defined twice before it is used.
The G P has a single entry node and a single exit node. A usage node USE v, n is a predicate use denote as p if statement n is a predicate statement otherwise USE v, n is a computation use denoted as c.
The du-paths and dc-paths describe the flow of data across source statements from points at which the values are defined to points at which the values are used.
The du-paths that are not definition clear are potential trouble spots. Software Testing Hence, our objective is to find all du-paths and then identity those du-paths which are not dc-paths. The steps are given in Fig. We may like to generate specific test cases for du-paths that are not dc-paths. Its input is a triple of positive integers say a,b,c and values for each of these may be from interval [0,]. The program is given in Fig.
The output may have one of the option given below: i Not a quadratic program ii real roots iii imaginary roots iv equal roots v invalid inputs Find all du-paths and identify those du-paths that are definition clear. The variables used in the program are a,b,c,d, validinput, D. The cyclomatic complexity of this graph is 7 indicating there are seven independent paths. Variable a b Path beginning, end nodes Definition clear?
Software Testing Variable Path beginning, end nodes Definition clear? Find all du-paths and identify those du-paths that are definition clear. The variables used in the program are a,b,c, valid input. The cyclomatic complexity of this graph is 7 and thus, there are 7 independent paths. Software Testing Variable c valid input Path beginning, end nodes Definition clear?
Software Testing Mutation Testing Mutation testing is a fault based technique that is similar to fault seeding, except that mutations to program statements are made in order to determine properties about test cases. Multiple copies of a program are made, and each copy is altered; this altered copy is called a mutant.
Mutants are executed with test data to determine whether the test data are capable of detecting the change between the original program and the mutated program.
Software Testing When we mutate code there needs to be a way of measuring the degree to which the code has been modified. We may have a ranking scheme, where a first order mutant is a single change to an expression, a second order mutant is a mutation to a first order mutant, and so on. High order mutants becomes intractable and thus in practice only low order mutants are used.
One difficulty associated with whether mutants will be killed is the problem of reaching the location; if a mutant is not executed, it cannot be killed. Special test cases are to be designed to reach a mutant. For example, suppose, we have the code. Software Testing To execute this, input domain must contain a value such that a is greater than b and b equals c. The manner by which a test suite is evaluated scored via mutation testing is as follows: for a specified test suite and a specific set of mutants, there will be three types of mutants in the code i.
The sum of the number of live, killed, and equivalent mutants will be the total number of mutants created. The score associated with a test suite T and mutants M is simply. Software Testing Levels of Testing There are 3 levels of testing: i. Unit Testing ii. Integration Testing iii. System Testing Software Engineering 3rd ed. Software Testing Unit Testing There are number of reasons in support of unit testing than testing the entire product.
The size of a single module is small enough that we can locate an error fairly easily. The module is small enough that we can attempt to test it in some demonstrably exhaustive fashion. Confusing interactions of multiple errors in widely different parts of the software are eliminated.
Software Testing There are problems associated with testing a module in isolation. How do we run a module without anything to call it, to be called by it or, possibly, to output intermediate values obtained during execution? One approach is to construct an appropriate driver routine to call if and, simple stubs to be called by it, and to insert output statements in it.
Stubs serve to replace modules that are subordinate to called by the module to be tested. Showing Average rating 3. Rating details. More filters. Sort order. Start your review of Software Testing. Mar 07, Shirale Shruti rated it it was amazing. This review has been hidden because it contains spoilers.
To view it, click here. This book is best for testing. Dec 23, Keith marked it as abandoned Shelves: india , zl-sf-main , z-library , technical. I did not read enough of this to be able to assign a fair star review. I did read enough of it to know that I can't read more of it. It may have benefitted from editorial review by a native speaker of the Queen's English; however, as indicated by the many other positive ratings here, it is possible that the linguistic style employed herein may be quite natural to and readily comprehensible by those who learned English in former Crown Colonies such as India.
An illustrative sample from the introd I did not read enough of this to be able to assign a fair star review. An illustrative sample from the introduction: "Unfortunately, the navigation system of Ariane 4 was used in Ariane 5 without proper testing and analysis. The Ariane 5 was a high speed rocket with a higher value of an internal alignment function, known as horizontal bias. This value is for the calculation of horizontal velocity.
On the day of the explosion, this value was more than expectations due to different trajectory of this rocket as compared to Ariane 4. Therefore, the main technical reason was the conversion problem at the time of converting the horizontal bias variable, and this resulted into the shutdown of the computer of the inertial reference system.
It's good as per college curriculum, but not as per current QA standards followed in the IT industry. Mar 04, Jayud marked it as to-read. Juni rated it it was amazing Nov 29, Heena Bansal rated it really liked it Nov 23, Shivangi rated it it was amazing Nov 04, Jagannath Karmakar rated it it was amazing Dec 08, Tarandeep Singh rated it liked it Dec 01, Utkarsh Raj rated it did not like it Sep 03, Ivy Jain rated it liked it Aug 24, Pratibha rated it it was ok Dec 14, Garima rated it really liked it Sep 30,
0コメント