Beruflich Dokumente
Kultur Dokumente
Code coverage:
Statement coverage:
The statement coverage is strategy aims to design test cases so that
statement in a program is executed at least once. The principle idea
governing the statement coverage strategy is that unless we
execute a statement, we have no. of ways of determining an error
exists in that statement. Unless a statement is executed ,we cannot
observe whether it causes failure due to some illegal memory
access, wrong result computation ,etc. However ,no guarantee that
it will behave correctly for all input values .
1
and false values. For example, in conditional expression ((c1 AND
c2) OR c3 ), the component c1, c2 and c3 are each made to assume
both true and false values. Branch testing is probably is the
simplest condition testing strategy where only the compound
conditions appearing in the different branch statements are made to
assume the true and false values. Thus, condition testing is a
stronger strategy than branch testing and branch testing is a
stronger testing strategy than statement coverage 2n test cases are
required. Thus, for condition coverage, the no. of test cases
increases exponentially with no. of component conditions.
Therefore, a condition coverage based testing technique is practical
only if n ( no. of condition ) is small.
Path Testing:
Path testing is where all possible paths through the code are
defined and covered. It’s a time consuming task.
Loop Testing:
These strategies relate to testing single loops, concatenated loops,
and nested loops. Independent and dependent code loops and
values are tested by this approach.
2
Why we do White Box Testing?
To ensure:
• Logical error tend to creep into our work when we design and
implement functions, conditions or controls that are out of
the program
• The design errors due to difference between logical flow of
the program and the actual implementation
• Typographical errors and syntax checking
Skills Required:
We need to write test cases that ensure the complete coverage of
the program logic.
For this we need to know the program well i.e. We should know
the specification and the code to be tested. Knowledge of
programming languages and logic.
Limitations of WBT:
Not possible for testing each and every path of the loops in
program. This means exhaustive testing is impossible for large
systems.
This does not mean that WBT is not effective. By selecting
important logical paths and data structure for testing is practically
possible and effective.
Reference- http://www.softrel.org/stgb.html
3
Advantages of white box Testing
4-Beneficent side-effects
5-Optimizations (e.g. chartable that changes reps when size > 100)
8-It helps in removing the extra lines of code, which can bring in
hidden defects.
1-Expensive
4
5-Not looking at the code in a runtime environment. That's
important for a number of reasons. Exploitation of vulnerability is
dependent upon all aspects of the platform being targeted and
source code is just of those components. The underlying operating
system, the backend database being used, third party security tools,
dependent libraries, etc. must all be taken into account when
determining exploitability. A source code review is not able to take
these factors into account.
Finish