Promptles
Debugging & Error Handling

Edge Case

beginner

Definition

An unusual or extreme input that the code might not handle correctly. Edge cases live at the boundaries: empty strings, zero, negative numbers, very large inputs, or special characters. Many bugs hide in edge cases because developers test the 'happy path' first.

In the wild

A function that splits a full name into first and last works great for 'Alice Smith,' but what about 'Cher' (one name), 'Mary Jane Watson' (three names), or '' (empty string)? Each of those is an edge case worth testing.

More from Debugging & Error Handling