Edge-case tests check values near special boundaries such as zero.

Edge Cases

edge_cases.pl
use strict;
use warnings;

sub safe_divide {
    my ($total, $count) = @_;
    return $count == 0 ? "none" : $total / $count;
}

my $count = ;
my $result = safe_divide(10, $count);
my $status = $result eq "none" ? "guarded" : "computed";

print "count=$count\n";
print "result=$result\n";
print "status=$status\n";
use strict;
use warnings;

sub safe_divide {
    my ($total, $count) = @_;
    return $count == 0 ? "none" : $total / $count;
}

my $count = ;
my $result = safe_divide(10, $count);
my $status = $result eq "none" ? "guarded" : "computed";

print "count=$count\n";
print "result=$result\n";
print "status=$status\n";
use strict;
use warnings;

sub safe_divide {
    my ($total, $count) = @_;
    return $count == 0 ? "none" : $total / $count;
}

my $count = ;
my $result = safe_divide(10, $count);
my $status = $result eq "none" ? "guarded" : "computed";

print "count=$count\n";
print "result=$result\n";
print "status=$status\n";
edge case An edge case is an input that sits near a boundary where behavior may change.