Sie sind auf Seite 1von 3

Software Testing Practical

Q1. Generate a code in any language which accepts input as follows:


a) Number of variables
b) Range of all variables (separately)
c) Type of Testing among Boundary Value Testing, Robust Testing, Worst Case
Testing and Robust Worst Case Testing.
and generate test cases as an output as per the type of testing method chosen.

Q2. Consider an automated banking application. The user can dial the bank from a
personal computer, provide a six-digit password, and follow with a series of keyword
commands that activate the banking function. The software for the application accepts
data in the following form:

Area Code Blank or three-digit number


Prefix Three-digit number, not beginning with 0 or 1
Suffix Four-digit number
Password Six-character alphanumeric
Commands Check status, Deposit, Withdrawal

Design the test cases to test the system using following Black Box testing
technique: BVA, Worst BVA, Robust BVA, Robust Worst BVA and Equivalence
Class Testing all variants (Input/Output domain)

Q3. Consider an application that is required to validate a number according to the following
simple rules:

A number can start with an optional sign.


The optional sign can be followed by any number of digits.
The digits can be optionally followed by a decimal point, represented by a period.
If there is a decimal point, then there should be two digits after the decimal.
Any number-whether or not it has a decimal point, should be terminated a blank.

Generate test cases to test valid and invalid numbers using Decision Table Testing
and Cause-Effect Graphing Technique to generate test cases.

Q4. Consider the following program segment:


1. int max (int i, int j, int k)
2. {
3. int max;
4. if (i>j) then
5. if (i>k) then max=i;
6. else max=k;
7. else if (j > k) max=j
8. else max=k
9. return (max);
10. }
Draw the control flow graph for this program segment. Determine the cyclomatic
complexity for this program and find independent paths and generate test cases for
each independent path.

Q5. Source code of simple insertion sort implementation using array in ascending order in c
programming language

1. int main()
2. {
3. int i,j,s,temp,a[20];
4. printf (Enter total elements: );
5. Scanf (%d,&s);
6. printf(Enter %d elements: ,s);
7. for(i=0;i<s;i++) scanf(%d,&a[i]);
8. for(i=1;i<s;i++)
9. {
10. temp=a[i]; j=i-1;
11. while((temp<a[j])&&(j>=0)){ a[j+1]=a[j];
12. j=j-1;
13. }
14. a[j+1]=temp;
15. }
16. printf(After sorting: );
17. for(i=0;i<s;i++)
18. printf( %d,a[i]);
19. return 0; }

Draw the program graph for given program segment. Determine the DD path graph.
Determine the independent paths and generate test cases for each independent path.

Q6. Consider a program to input two numbers and print them in ascending order given
below. Find all du paths and identify those du-paths that are not feasible or definition
clear. Also find all dc paths and generate the test cases for all paths (dc paths and non dc
paths).
1. void main ()
2. {
3 int a, b, t;
4. clrscr ();
5. printf (Enter first number);
6. scanf (%d,&a);
7. printf(Enter second number);
8. scanf(%d,&b);
9. if (a<b){
10. t=a;
11a=b;
12 b=t;
13}
14. printf (%d %d, a, b);
15 getch (); }

Q7. Consider the above program in question number 6 and generate possible program slices
for all variables. Design at least one test case from every slice.

Q8. Check the adequacy of the test cases generated in question no. 4 and 6 through mutation
testing and also computes the mutation score for each.

Q9. Consider graph generated in question number 5 and perform Graph Matrix Testing. Also
generate 2 connected paths by squaring the graphs.

Q10. Consider a simple tax calculator, in which user will enter the annual salary, gender of
the tax payer. System will calculate the tax and show the tax need to pay by selecting
tax slab programmatically (Assume tax slab, based on annual income and gender of tax
payer).
System also provides Help, Clear, Quit option(s) for the user. On selection of help
system must display assume tax slab(s).
Design screen layout for the system and demonstrate each step of OO System test
case(s) generation.

Das könnte Ihnen auch gefallen