DevPrep
  • Interview Prep
  • Projects
  • Resources
  • Pricing
  • About Us
Submit Question
DevPrep
  • Pricing
  • About Us
Submit Question
  1. Home
  2. Articles
  3. Frontend Engineering
  4. Testing Edge Cases: What Senior Developers Check
XLinkedInReddit
MediumFrontend Engineering

Testing Edge Cases: What Senior Developers Check

D
DevPrep Team
February 10, 2026·2 min read·0
Table of Contents
  • Input Edge Cases
  • Array Edge Cases
  • Async Edge Cases
  • UI Edge Cases
  • Date/Time Edge Cases
  • The Testing Mindset

Finding bugs before users do is what separates senior from junior developers. Here's my checklist of edge cases to always test.

Input Edge Cases

// Empty/null/undefined
handleInput("");
handleInput(null);
handleInput(undefined);

// Boundary values
handleAge(0);
handleAge(-1);
handleAge(150);
handleAge(Number.MAX_SAFE_INTEGER);

// Special strings
handleName("O'Brien");        // Apostrophe
handleName("José García");    // Unicode
handleName("  ");             // Whitespace only
handleName("<script>alert(1)</script>"); // XSS attempt
handleName("a".repeat(10000)); // Very long input

Array Edge Cases

// Empty array
sortItems([]);
filterItems([]);
getFirst([]);

// Single element
sortItems([1]);

// Duplicates
sortItems([3, 1, 3, 2, 1]);

// Already sorted
sortItems([1, 2, 3, 4, 5]);

// Reverse sorted
sortItems([5, 4, 3, 2, 1]);

// Large arrays
sortItems(Array.from({ length: 100000 }, () => Math.random()));

Async Edge Cases

// Race conditions
// What if user clicks "Submit" twice?
// What if search results arrive out of order?
// What if component unmounts during fetch?

// Network failures
// What if the API is down?
// What if the request times out?
// What if we get a 500 error?
// What if we get a 429 (rate limited)?

// Stale data
// What if cached data is outdated?
// What if another tab modified the data?

UI Edge Cases

// Responsive design
// Very narrow viewport (320px)
// Very wide viewport (4K)
// Landscape mobile

// Content overflow
// Very long text without spaces
// Very long URLs
// Missing images (broken img src)

// Interaction
// Double-click on submit button
// Press Enter in form fields
// Tab navigation order
// Screen reader navigation

Date/Time Edge Cases

// Time zones
new Date("2024-01-01") // UTC midnight — different date in some time zones!

// DST transitions
// March 10, 2024 2:00 AM doesn't exist (spring forward)
// November 3, 2024 1:00 AM happens twice (fall back)

// Leap year
new Date(2024, 1, 29) // Valid (2024 is leap year)
new Date(2023, 1, 29) // Becomes March 1, 2023!

// Edge dates
new Date("0000-01-01")
new Date("9999-12-31")

The Testing Mindset

  • Always test the happy path AND the sad path
  • Think: "What if the user does something unexpected?"
  • Think: "What if the server returns something unexpected?"
  • Test with realistic data volumes, not just toy examples
  • Test on slow networks (Chrome DevTools → Network throttling)

Related Articles

MediumFrontend Engineering

System Design #12: Design a Multi-Step Form Wizard

7 min read
MediumFrontend Engineering

Mastering Senior-Level JavaScript Interview Concepts

2 min read
MediumFrontend Engineering

System Design #9: Design a Collaborative Text Editor

9 min read

Comments (0)

Sign in to leave a comment.

No comments yet. Be the first to comment.

Table of Contents

  • Input Edge Cases
  • Array Edge Cases
  • Async Edge Cases
  • UI Edge Cases
  • Date/Time Edge Cases
  • The Testing Mindset

Series

View all Frontend Engineering articles →

Practice

  • JavaScript
  • DSA
  • Machine Coding
  • System Design

Resources

  • Learning Tracks
  • Articles
  • Roadmaps
  • Compare Concepts
  • Glossary
  • Developer Tools
  • All Questions

Company

  • About
  • Pricing

Legal

  • Privacy Policy
  • Terms of Service
DevPrep

© 2026 DevPrep. All rights reserved.