| Prev | Code Coverage - Tales From the Trenches | Next |
$h = 0;
if ($x)
{
$h = { a => 1 };
}
if ($y)
{
print $h->{a};
}
Four paths through this code
$x $y
0 0
0 1
1 0
1 1
For 100% path coverage all four must be taken
Missing elses count as paths
| Slide 14 | YAPC::Europe::2003 | Copyright © 2003 Paul Johnson |