STQA Experiment 5 8 PDF
STQA Experiment 5 8 PDF
STQA Experiment 5 8 PDF
Aim: Program to add two numbers, each number should be of one or two digits. Perform
Adhoc testing.
Perfomance Instructions:
Adhoc testing is an informal testing type with an aim to break the system. This testing is
usually an unplanned activity. It does not follow any test design techniques to create test
cases. In fact is does not create test cases altogether! This testing is primarily performed if
the knowledge of testers in the system under test is very high. Testers randomly test the
application without any test cases or any business requirement document. Ad hoc Testing
does not follow any structured way of testing and it is randomly done on any part of
application. Main aim of this testing is to find defects by random checking. Adhoc testing
can be achieved with the testing technique called Error Guessing. Error guessing can be
done by the people having enough experience on the system to "guess" the most likely
source of errors.
Some Advantages –
1. Ad-hoc testing gives freedom to the tester to apply their own new ways of testing the
application which helps them to find out more number of defects compared to the formal
testing process.
2. This type of testing can be done at anytime anywhere in the Software Development
Life cycle (SDLC) without following any formal process.
3. This type of testing is not only limited to the testing team but this can be done by the
developer while developing their module which helps them to code in a better way.
Some Disadvantages –
1. Since ad-hoc testing is done without any planning and in unstructured way so
recreation of bugs sometime becomes a big trouble.
2. The test scenarios executed during the ad-hoc testing are not documented so the tester
has to keep all the scenarios in their mind which he/she might not be able to recollect in
future.
3. Ad-hoc testing is very much dependent on the skilled tester who has thorough
knowledge of the product it cannot be done by any new joiner of the team.
Sample Inputs
Input is two numbers each should be one or two digits
#include<stdio.h>
void main()
{
int a, b, c;
scanf("%2d",&a);
scanf("%2d",&b);
c=a+b;
printf("%2d\n",c);
}
Sample Outputs
The program output will be addition of two numbers
Result:
Test Case Inputs (a, b) Expected Output Actual output
Id
1 2,3 5 5
2 23, 45 68 68
3 -97, -99 -196 -2
4 -38, 99 61 5
5 20,30 50 50
6 53, 45 98 98
7 10,77 87 87
8 1,1 2 2
9 -34,90 56 1
10 11,12 23 23
11 -45,78 23 1
12 72,34 106 106
13 -99,55 -44 0
Experiment 6
Aim:To determine the nature of roots of a quadratic equations. Perform DD Path Testing
Consider the following program segment that returnroots of quadratic equation
1) int main ( )
2) {
3) int a, b, c, d, boolean = 0;
4) double D;
5) printf (“nt Enter `a' coefficient :");
6) scanf ("%d", & a) ;
7) printf ("nt Enter `b' coefficient :”);
8) scanf ("%&d", & b);
9) printf (“ Enter `c' coefficient :”);
10) scanf, ("%d”, & c) ;
11) if ((a > =0) && (a < = 00) && (b > = 0) && (b < =100) && (c > =0) && (c < =100))
{
12) boolean = 1;
13) if (a = = 0) {
14) boolean = -1;
15) }
16) }
17) if (boolean = = 1) {
18) d = b * b - 4 * a * c;
19) if (d = = 0) {
20) printf ("roots are equal and are r1= r2 = %f - b/(2 * float)&));
21) }
22) else if (d > 0) {
23) D = sqrt (d);
24) printf ("roots are real and are r1=%f and r2=%f; (-b - D)/(2 * a), (-b + D)/(2 * a));
25) }
26) else {
27) D = sqrt (-d) / (2 * a);
28) printf ("roots are imaginary");
29) }
30) }
31) else if (boolean = = -1) {
32) printf ("Not a quadratic equation");
33) }
34) else {
35) printf ("Invalid input range ...);
36) }
37) getch ( ):
38) return 0;
39) }
Perfomance Instructions:
White box testing: White box testing sometimes called open box testing or glass box testing
or clear box testing or structural testing. In white box testing test cases are derived from the
source code internals of the software, specifically including branches, individual conditions,
and statements. It is concerned with the level up to which test cases exercise or cover the
logic (source code) of the program. By examining and testing the program code white box
testing tests the external functionality of the code. In White Box testing the tester must have
the complete knowledge about the internal structure of the source code. Using white box
testing methods the tester can derive following test cases:
1. Test case that ensures that all independent path have been exercised at least once.
2. Test cases that checks all the decision on their true or false sides.
3. Test cases that execute all loops at their boundaries and within their operational
bound.
4. Test cases that exercise internal data structures to ensure their validity. Following are
the white box testing techniques:
• Basis Path testing
• Data Flow testing
• Mutation Testing
Basis Path testing
With the help of basis path testing, test case designer can derive a logical complexity measure
of a procedural design and can use this measure to find the basis set of execution paths. Test
cases that are derived to exercise the basis set ensures that every statement in the program
will execute at least one time during testing.
Steps for basis path testing
• construct the flow graph from the source code or flow chart
• Identify independent path in the flow graph
• Calculate cyclomatic complexity, V(G).
• Design the test cases.
Flow graph
Result:
A. Control flow graph for the program segment is as follows:
B. DD Path Graph
10 b Decision Nodes
11 c Decision Nodes
18 g Decision Nodes
19 h Decision Nodes
22 j Decision Node
29 n Decision Node
V(G)=24-19+2=5+2=7
Method 2: V(G) = P + 1 (Where P is No. of predicate nodes with out degree = 2)
Path 1:
abf gnpqr
Path 2:
abf gnoqr
Path 3:
abce gnpq r
Path 4:
abcde gnoq r
Path 5:
abf ghim qr
Path 6:
abf ghikm qr
Path 7:
Theory:
Test planning developed early phase of the software development and which includes
followed by -:
Introduction -:
The Library Management System application for assisting a librarian in managing library
books. The system would provide basic set of features to add/update clients, add/update
books, search for books, dues if any and manage check-in / checkout processes. This test plan
is a basic guideline for future testing in the LMS.
Scope -:
The system would provide basic set of features to add/update members, add/update books,
dues if any and manage check in specifications for the systems based on the client‟s
statement of need.
Environment Requirement -:
Hardware -: Three Dual Core or above machines needed
Software -: Microsoft Windows XP installed
Testing Strategies -:
1. Unit Testing :
Definition : Test smallest testable parts of an application, called units, are individually
and independently scrutinized for proper operation.
Participants/ Tested by : Developers
Methodology : Used for the Database test, records in each table, Basic function test, add
a student, add a book, Network test
Test Schedule -:
Each test you create or run is displayed by WinRunner in a test window. You
can open many tests at one time.