written 5.8 years ago by |
1. Data Flow (Code Functional Testing)
i. Data flow coverage involves tracking a piece of data completely through the software.
ii. At the unit test level this would just be through an individual module or function.
iii. The same tracking could be done through several integrated modules or even through the entire software product—although it would be more time consuming to do so.
iv. During data flow, the check is made for the proper declaration of variables declared and the loops used are declared and used properly.
For example
- #include<stdio.h>
- void main()
- {
- int i , fact= 1, n;
- printf(―enter the number ―);
- scanf(―%d‖,&n);
- for(i =1 ;i <=n;i++)
- fact = fact * i;
- }
2. Data Coverage (Code Coverage Testing)
i. The logical approach is to divide the code just as you did in black-box testing into its data and its states (or program flow).
ii. By looking at the software from the same perspective, you can more easily map the white-box information you gain to the black-box cases you‘ve already written.
iii. Consider the data first. Data includes all the variables, constants, arrays, data structures, keyboard and mouse input, files and screen input and output, and I/O to other devices such as modems, networks, and so on.
For example
- #include<stdio.h>
- void main()
- {
- int i , fact= 1, n;
- printf(―enter the number ―);
- scanf(―%d‖,&n);
- for(i =1 ;i <=n;i++)
- fact = fact * i; ;
- }
The declaration of data is complete with the assignment statement and the variable declaration statements. All the variable declared are properly utilized.
3. Program Statements and Line Coverage (Code Complexity Testing)
i. The most straightforward form of code coverage is called statement coverage or line coverage.
ii. If you‘re monitoring statement coverage while you test your software, your goal is to make sure that you execute every statement in the program at least once.
iii. With line coverage the tester tests the code line by line giving the relevant output.
For example
- #include<stdio.h>
- void main()
- {
- int i , fact= 1, n;
- printf(―enter the number ―);
- scanf(―%d‖, &n);
- for(i =1 ;i <=n; i++)
- fact = fact * i;
- printf
- }
4. Branch Coverage (Code Complexity Testing)
i. Attempting to cover all the paths in the software is called path testing.
ii. The simplest form of path testing is called branch coverage testing.
iii. To check all the possibilities of the boundary and the sub boundary conditions and it‘s branching on those values.
iv. Test coverage criteria requires enough test cases such that each condition in a decision takes on all possible outcomes at least once, and each point of entry to a program or subroutine is invoked at least once.
v. Every branch (decision) taken each way, true and false.
vi. It helps in validating all the branches in the code making sure that no branch leads to abnormal behavior of the application.
5. Condition Coverage (Code Complexity Testing)
i. Just when you thought you had it all figured out, there‘s yet another Complication to path testing.
ii. Condition coverage testing takes the extra conditions on the branch statements into account.