Un vistazo a las pruebas basadas en cobertura, en este se plantean los objetos de prueba desde el lado del desarrollador y ayudan a poner mayor atención en cubrir unidades funcionales o ejecución.
2. Testing techniques
Black Box
(Specification-based techniques)
Examines the functionality of an
application without peering into its
internal structures or workings.
This method of test can be applied to
virtually every level of software testing:
unit, integration, system and acceptance.
White Box
(Structure-based techniques) Tests
internal structures or workings of an
application. An internal perspective of
the system, as well as programming
skills, are used to design test cases.
White-box testing can be applied at the
unit, integration and system levels of the
software testing process.
3. Perspective
It is often used in early sub-stages of software testing.
Bugs are more closely related to objects under test, leading to effectual
software bug removal.
Uses coverage purposes as the stop criteria.
4. Pros & Cons
Advantages
Conducted by either professional testers
or by developers themselves
Testing models are often created
without active client or user input
It helps in determining a quantitative
measure of code coverage, which
indirectly measure the quality of the
application or product.
Disadvantages
The efficiency reduces with large objects
(big projects).
If a specified function has not been
implemented or a function was omitted
from the specification, then structure-based
techniques cannot say anything
about them it only looks at a structure
which is already there.
100% coverage does not mean 100%
tested.
6. Statement Coverage
The test case is executed in such a way
that every statement of the code is
executed at least once.
7. Branch coverage
It 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.
8. Condition coverage
It ensures that every possible condition
is executed at least once.
9. Path coverage
Path Coverage ensures covering of all
the paths from start to end.
10. Practice
public int returnInput (int input, boolean
condition1, boolean condition2, boolean
condition3) {
int x = input;
int y = 0;
if (condition1)
x++;
if (condition2)
x--;
if (condition3)
y=x;
return y;
}
Please estimate the number of test cases
required for 100% code covered for:
Statement Coverage
Branch Coverage
Path Coverage
11. Memorize this…
100% Path coverage will imply 100%
Statement coverage
100% Branch coverage will imply 100%
Statement coverage
100% Path coverage will imply 100% Branch
coverage