Test cases for Sequential statements are simple, assign values to A & B.įor eg, test case /data : A=1, B=2, will run through statements 1,2,3 or all the lines of this program. Sequential or Linear statements:Įxample of a sequential code, where the program is executed line after line. Execution of code can also be based on a condition being true or false. Total number of decisions Coding Structures:Ī program code can be sequential where statements execute one after another. Total number of executable statements Decision Coverage = Number of decisions exercised x 100 Statement Coverage = Number of executable statements executed x 100 Statement coverage: If the test case executes every line of code in the program, it is called 100% statement coverage.ĭecision coverage: If the test cases execute both the decisions, it is called 100% decision coverage. Others include Condition coverage, Modified Decision coverage, Branch Condition Combination Coverage & LCSAJ, Path coverage etc which are beyond the cope of this article. The techniques to derive test cases:(ISTQB Foundation syllabus) There are certain tools available to measure the lines of code covered when tests are run. Coverage metrics help understand what lines are not covered and help us design test cases to increase the coverage. So that leaves a lot of lines of code untested. And the minimum number of test cases to achieve this.ĭuring Black Box testing, depending on the tester’s experience, after a full round of System testing, the lines of code covered varies between 30% and 70%. The emphasis here is what lines will be executed with the data you provide. Test cases from code are similar to black box test cases but think test data here – like what values you will provide to run through the code. In the exam, questions will be asked on how many test cases will be needed to ensure every line of code/decisions are executed or given some values, what % of lines/decisions are executed. Test cases involve assigning values to the variables and measuring what lines of code get executed. (In contrast to black box testing where test cases are designed from specification). This article is devoted to understanding how to derive test cases from a program and also derive coverage metrics for tests undertake.ĭeriving test case after analysis or understanding programs is white box testing. White-box test design techniques (also called structural or structure-based techniques) are used to derive test cases from an analysis of the program(code).
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |