Chap 5 - Testing Methodologies
Chap 5 - Testing Methodologies
Chap 5 - Testing Methodologies
E N D
Presentation Transcript
Testing Methodologies ●Black Box Testing(BBT) ●White Box Testing(WBT) 2
Black Box Testing New title ●Black box testing is the Software testing method which is used to test the software without knowing the internal structure of the code or program i.e. Application is treated as a black box ●Tester provides input and checks the output produced by the system without knowing “How input gets processed ?” ●Known as Functional Testing 3
Black Box Testing Continued ●Implementation of the code is not tested hence Tester need not programming language in which Application is developed have knowledge of ●Tests are based on system requirements ●Applicable for all levels of testing ●Requires that Functional specifications should be clear which is a major challenge 4
Black Box Testing Continued ● Disadvantages Can identify the defect but can not identify the exact location of the defect Can not identify issues such as Unreachable code – Part of the code never getting executed or called Data reference errors – variables, array, string or record that has not been declared or initialized correctly Is memory allocated for reference pointers A variable used instead a constant will work better 5
White Box Testing ●White Box Testing is also known as Code-Based Testing or Structural Testing White box testing is done by looking at the code ●Tester needs to have knowledge of programming language in which Application is developed / implementation of the code ●It is expected that the person is aware of the internal structure of the program 6
White Box Testing Continued ● Method Create Test cases such that Each statement of code is executed at least once All Decisions are tested All independent Path for a decision are tested All loops are executed till the boundary condition Each combination of condition is tested ● Covering all possible paths, loops, conditions is a challenge ● White box testing is used at Unit Testing of the code 7
White Box Testing Continued ● Understand following algorithm 1.READ A 2.READ B 3.C=A-2*B 4.IF C<0 THEN 5. PRINT “C IS NEGATIVE” 6.END IF ● Number of statements = 6 ● Number of Decisions = 1 ● Number of Decision outcomes = 2 C<0 i.e. True outcomes C>0 i.e. False outcome 8
Statement Coverage ● Number of Statements executed x 100 Total number of Statements ● Test 1 : A=20 and B=2 value of C will be 16. Statements that will be executed are 1,2,3,4,6 Statement coverage = 5/6 * 100 = 83% ● Test 2 : A=3 and B=2 value of C will be -1. Statements that will be executed are 1,2,3,4,5,6 Statement coverage = 6/6 * 100 = 100% ● Test 2 alone is sufficient to achieve 100% Statement coverage 9
Decision Coverage ● Number of Decision outcomes executed X 100 Total number of Decision outcomes ● Let's consider test which gave 100% statement coverage Test 2 : A=3 and B=2 value of C will be -1. Statements that will be executed are 1,2,3,4,5,6 With this we have covered only one outcome of decision i.e. “C<0” or True Test 1 : A=20 and B=2 value of C will be 16. Statements that will be executed are 1,2,3,4,6 With this we have covered one outcome of decision i.e. “C>0” or False ● Test 1 and Test 2 both are required to achieve 100 % Decision coverage ● 100% Decision coverage guarantees 100% Statement coverage but 100% Statement coverage does not guarantees 100% Decision coverage. 10
White Box Testing Continued ●Disadvantages As Testing is based on code and not on User Requirements White box testing can naver find : Whether Application is working as per User expectation Requirements that are not implemented 11