- Information
- AI Chat
ST LAB Manual - software testing
Software Engineering (CS530)
Visvesvaraya Technological University
Preview text
PES Institute of Technology Bangalore South Campus DEPARTMENT OF INFORMATION SCIENCE ENGINEERING VI SEMESTER SOFTWARE TESTING LABORATORY MANUAL SUBJECT CODE: 10ISL68 Mr. ANIMESH GIRI SOFTWARE TESTING 1: Decision table approach for solving triangle problem Design and develop a program in a language of your choice to solve the triangle problem defined as follows : Accept three integers which are supposed to be the three sides of triangle and determine if the three values represent an equilateral triangle, isosceles triangle, scalene triangle, or they do not form a triangle at all. Derive test cases for your program based on approach, execute the test cases and discuss the results int main() int char 3 integers which are sides of to check is it a triangle or not if( ) else istriangle if if else if else else a return PESIT Bangalore South Campus LAB MANUAL BE. VI Sem ISE 10ISL68 SOFTWARE TESTING Case Id 1 2 3 4 5 6 Triangle Problem Table Test cases for input data Input Data Description Expected Output Actual Output a b C Message should be Enter the value of a, b and c Such that 20 5 5 displayed form a a is not less than sum of two sides triangle Enter the value of a, b and c Such that Message should be b is not less than sum of two sides and 3 15 11 displayed form a a is less than sum of other two sides triangle Enter the value of a, b and c Such that Message should be c is not less than sum of two sides and 4 5 20 displayed form a a and b is less than sum of other two triangle sides Should display the Enter the value a, b and c satisfying 5 5 5 message Equilateral precondition and and triangle Should display the Enter the value a ,b and c satisfying 10 10 9 message Isosceles precondition and and b c triangle Enter the value a, b and c satisfying Should display the 5 6 7 precondition and a , b c and c a message Scalene triangle PESIT Bangalore South Campus LAB MANUAL BE. VI Sem ISE 10ISL68 Status Comments SOFTWARE TESTING Program 2 (Boundary value analysis program) Design and develop a program in a language of your choice to solve the triangle problem defined as follows : Accept three integers which are supposed to be the three sides of triangle and determine if the three values represent an equilateral triangle, isosceles triangle, scalene triangle, or they do not form a triangle at all. Derive test cases for your program based on boundary value analysis, execute the test cases and discuss the results int main() int char do 3 integers which are sides of c1 if (!c1) value of is not the range of permitted if (!c2) value of is not the range of permitted if (!c3) value of is not the range of permitted while(!(c1 c2 to check is it a triangle or not if( ) else istriangle if if else if else else a return PESIT Bangalore South Campus LAB MANUAL BE. VI Sem ISE 10ISL68 SOFTWARE TESTING 10 11 Enter the normal value for 2 items and 1 item is max value Enter the normal value for 2 items and 1 item is max value 5 10 5 10 5 5 Should display the message Not a triangle Should display the message Not a triangle 12 Enter the max value for 2 items and max 1 for any one item 10 10 9 Should display the message Isosceles triangle 13 Enter the max value for 2 items and max 1 for any one item 10 9 10 Should display the message Isosceles triangle 14 Enter the max value for 2 items and max 1 for any one item 9 10 10 Should display the message Isosceles triangle 15 Enter the max value for a, b and c 10 10 10 Should display the message Equilateral triangle PESIT Bangalore South Campus LAB MANUAL BE. VI Sem ISE 10ISL68 SOFTWARE TESTING Program 3 (equivalence class partitioning program) Design and develop a program in a language of your choice to solve the triangle problem defined as follows : Accept three integers which are supposed to be the three sides of triangle and determine if the three values represent an equilateral triangle, isosceles triangle, scalene triangle, or they do not form a triangle at all. Derive test cases for your program based on equivalence class partitioning , execute the test cases and discuss the results int main() int a,b,c , char do 3 integers which are sides of c1 if (!c1) value of is not the range of permitted if (!c2) value of is not the range of permitted if (!c3) value of is not the range of permitted while(!(c1 c2 to check is it a triangle or not if( ) else istriangle if if else if else else a return PESIT Bangalore South Campus LAB MANUAL BE. VI Sem ISE 10ISL68 SOFTWARE TESTING 11 12 13 Enter one invalid input and two valid value for a , b and c Enter one invalid input and two valid value for a , b and c Enter one invalid input and two valid value for a , b and c 5 5 14 Enter two invalid input and two valid value for a , b and c 14 Enter two invalid input and two valid value for a , b and c 5 14 Enter two invalid input and two valid value for a , b and c 15 Enter all invalid inputs PESIT Bangalore South Campus Strong Robust Equivalence class Testing Should display value of a is not in the 5 5 range of permitted values Should display value of a is not in the 5 range of permitted values Should display value of a is not in the 5 range of permitted values Should display value of a is not in the range of permitted values 5 Should display value of b is not in the range of permitted values Should display value of b is not in the range of permitted values Should display value of c is not in the range of permitted values Should display value of a is not in the range of permitted values 5 Should display value of c is not in the range of permitted values Should display value of a is not in the range of permitted values Should display value of b is not in the range of permitted values Should display value of c is not in the range of permitted values LAB MANUAL BE. VI Sem ISE 10ISL68 SOFTWARE TESTING 1 4: (Dataflow Testing for commission calculation) 2 3 int main() 4 5 int locks, stocks, barrels, tlocks, tstocks, 6 float 7 8 9 10 11 12 13 the number of locks and to exit the loop enter for 14 15 the number of stocks and 16 17 18 19 the number of locks and to exit the loop enter for 20 21 locks 22 stocks 23 barrels 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 lsales total if(sales 1800) else if(sales comm else commission return PESIT Bangalore South Campus LAB MANUAL BE. VI Sem ISE 10ISL68 SOFTWARE TESTING Selected Paths for Commission problem Test case id Description variables path(Beginning, End nodes) Du paths 1 Check for lock price variable DEF(lprice,7) and USE(lprice,24) (7 , 24) 2 3 4 Check for Stock price variable DEF(sprice,8) and USE(sprice,25) Check for barrel price variable DEF(bprice,9) and USE(bprice,26) (8 , 25) (9 , 26) Check for total locks variable DEF((tlocks,10) and DEF(tlocks,16)) and 3 usage node(USE(tlocks,16),USE(tlocks,21),USE(tlock s,24) PESIT Bangalore South Campus LAB MANUAL Yes Yes (10 , 21) No (16 , 16) (16 , 21) Yes No (16 , 24) No (11 , 17) Yes No (17 , 17) (17 , 22) Yes No (17 , 25) No (11, 25) BE. Yes (11 , 22) 5 Yes (10 , 16) (10 , 24) Check for total stocks variable DEF((tstocks,11) and DEF(tstocks,17)) and 3 usage node(USE(tstocks,17),USE(tstocks,22),USE(tsto cks,25) Definition Comments clear ? VI Sem ISE 10ISL68 No No SOFTWARE TESTING 6 7 check for locks variable ( DEF(locks,13) ,DEF(locks,19) and USE(locks,14),USE(locks,16) Check for stocks variable (DEF(stocks,15) and USE(stocks,17) 8 Check for sales DEF(sales, 27) and USE(Sales, 28), USE(Sales , 29), USE(Sales,33) , USE(Sales , 34) , USE(Sales,37) , USE(Sales , 39) 9 Check for Commission variable DEF(comm, 31,32,33) , DEF(comm,34,35) and DEF(comm,39) and USE(comm,42) PESIT Bangalore South Campus LAB MANUAL BE. (13 , 14) Yes ( 13 , 16) (19 , 14) Yes Yes (19 , 16) Yes (15 , 17) Yes (27 ,28) Yes (27 , 29) (27 , 33) (27 , 34) (27 , 37) (27 , 39) ( (31,32,33),42) ((34 , 35) , 42) Yes Yes Yes Yes Yes Yes Yes ((39 , 42 ) Yes VI Sem ISE 10ISL68 Begin the loop Repeat the loop SOFTWARE TESTING total stocks not in the range 1. so old else if(c3) of barrels not in the range 1. else total barrels not in the range 1. so old else the number of locks and to exit the loop enter for locks stocks barrels sales total if(sales 0) if(sales 1800) else if(sales comm else commission else is no return PESIT Bangalore South Campus LAB MANUAL BE. VI Sem ISE 10ISL68 Test Case Name : Boundary Value for Commission Problem Experiment Number : 5 Test data : price Rs for lock 45 , stock 30 and barrel 25 sales total lock lock price total stock stock price total barrel barrel price commission : up to sales Rs , 15 of the next Rs 800 and 20 on any sales in excess of 1800 : lock to exit and 70 , and Brief Description: The salesperson had to sell at least one complete rifle per month. Checking boundary value for locks, stocks and barrels and commission Case Id 1 2 3 4 5 6 7 Description Commission Problem Output Boundary Value Analysis Cases Input Data Expected Output Actual output Total Total Total CommComm Sales Sales Locks Stocks Barrels ission Enter the min value for locks, stocks and barrels Enter the min value for 2 items and min for any one item Enter the value sales approximately mid value between 100 to Enter the values to calculate the commission for sales nearly less than 8 9 10 11 12 Enter the values sales exactly equal to 13 Enter the value sales approximately mid value Enter the values to calculate the commission for sales nearly greater than Statu s Comment 1 1 1 2 1 1 2 1 1 2 1 1 100 125 130 145 10 12 13 14 output minimum output minimum output minimum output minimum 5 5 5 500 50 Midpoint 10 10 10 9 9 10 975 970 97 97 Border point Border point 9 10 10 955 95 Border point 10 10 10 11 10 10 11 10 10 11 10 10 1025 1030 1045 100 103 104 106 Border point Border point Border point Border point 14 14 14 1400 160 Midpoint SOFTWARE TESTING 4 Enter the random values such that to calculate commission for sales nearly greater than 1800 PESIT Bangalore South Campus LAB MANUAL 18 BE. 19 17 VI Sem ISE 1805 10ISL68 221 Border point SOFTWARE TESTING Test Case Name :Equivalence Class for Commission Problem Experiment Number : 6 Test data : price Rs for lock 45 , stock 30 and barrel 25 sales total lock lock price total stock stock price total barrel barrel price commission : Upto sales Rs , 15 of the next Rs 800 and 20 on any sales in excess of 1800 : lock to exit and 70 , and Brief Description: The salesperson had to sell at least one complete rifle per month. Checking boundary value for locks,stocks and barrels and commission Valid Classes L1 :1 L2 if is used to control input iteration) L3 : Invalid Classes L3 OR L4 S2 : S3 : stocks B2 : barrels B3 : barrels Commission Problem Output Equivalence Class Testing ( Weak Strong Normal Equivalence Class ) Input Data Expected Output Total Total Total Sales Commission Locks Stocks Barrels Case Id Description 1 Enter the value within the range for locks,stocks and barrels PESIT Bangalore South Campus 35 LAB MANUAL 40 45 BE. 3900 VI Sem ISE 640 10ISL68 Actual output Commiss Sales ion Stat us Comment
ST LAB Manual - software testing
Course: Software Engineering (CS530)
University: Visvesvaraya Technological University
- Discover more from: