Edge case คืออินพุตและเงื่อนไขที่ผิดปกติหรืออยู่ขอบเขตซึ่งบั๊กมักซ่อนตัวอยู่ — อินพุตว่างเปล่า ขอบเขต ค่า null ค่าขนาดใหญ่ ข้อผิดพลาด การทดสอบที่มีประสิทธิภาพไปไกลกว่า "happy path" เพื่อครอบคลุมสิ่งเหล่านี้ เนื่องจาก edge case เป็นแหล่งที่มาทั่วไปของข้อบกพร่องจริง
ทำไม edge case จึงสำคัญ
The HAPPY PATH (normal, expected inputs) usually works. BUGS hide in EDGE CASES:
→ unusual inputs, boundaries, error conditions, unexpected states
→ testing only the happy path misses where defects actually occur
→ Thorough testing covers edge cases — that's where it adds the most value.
หมวดหมู่ทั่วไปของ edge case
EMPTY / NULL → empty string/list/collection, null/undefined, missing values
BOUNDARIES → min/max values, 0, -1, off-by-one (first/last element, limits)
LARGE / extreme → very large inputs, long strings, huge numbers, overflow
INVALID → wrong types, malformed data, out-of-range, special characters
ERROR conditions → network failures, exceptions, timeouts, unavailable dependencies
STATE → empty/initial state, concurrent access, unexpected sequences of actions
SPECIAL values → negative numbers, zero, duplicates, unicode/emoji, very small/large
