Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is the explicit difference between an edge case and a corner case?

I've seen the two terms use interchangeably. Definitions found online seem to vary as well.

From my understanding, a corner case is the extreme values of inputs. And edge cases are the extreme cases to handle when designing an algorithm. Is this correct?

Is there a standard definition?

like image 650
James Wierzba Avatar asked Nov 29 '17 19:11

James Wierzba


People also ask

What is a corner case?

Noun. corner case (plural corner cases) (chiefly engineering) A problem or situation that occurs only when two or more operating parameters are at extreme values, or when two or more unusual operating circumstances happen to coincide.

What is the opposite of an edge case?

Where an edge case involves pushing one variable to a minimum or maximum, putting users at the "edge" of the configuration space, a corner case involves doing so with multiple variables, which would put users at a "corner" of a multidimensional configuration space.

Is Base case the same as edge case?

Base case is the non-recursing scenario in recursion (length of an empty sequence, factorial of zero...). Edge case is something where bugs are likely to arise because many people will not remember to check for them, typicaly found at edges of domain (e.g. empty strings, division by zero, negative lengths...)

What is a edge test case?

Edge test case scenarios are those that are possible, but unknown or accidental features of the requirements. Boundary testing, in which testers validate between the extreme ends of a range of inputs, is a great way to find edge cases when testers are dealing with specific and calculated value fields.


2 Answers

These are often used interchangeably. If you're being careful about language, these have specific (engineering) meanings (courtesy of Wikipedia):

In engineering, a corner case (or pathological case) involves a problem or situation that occurs only outside of normal operating parameters—specifically one that manifests itself when multiple environmental variables or conditions are simultaneously at extreme levels, even though each parameter is within the specified range for that parameter.

An edge case is a problem or situation that occurs only at an extreme (maximum or minimum) operating parameter. For example, a stereo speaker might noticeably distort audio when played at its maximum rated volume, even in the absence of other extreme settings or conditions.

In programming, an edge case typically involves input values that require special handling in an algorithm behind a computer program. As a measure for validating the behavior of computer programs in such cases, unit tests are usually created; they are testing boundary conditions of an algorithm, function or method. A series of edge cases around each "boundary" can be used to give reasonable coverage and confidence using the assumption that if it behaves correctly at the edges, it should behave everywhere else.

For example, a function that divides two numbers might be tested using both very large and very small numbers. This assumes that if it works for both ends of the magnitude spectrum, it should work correctly in between.

like image 138
Dave Avatar answered Sep 20 '22 02:09

Dave


According to Wikipedia:

Where an edge case involves pushing one variable to a minimum or maximum, putting users at the "edge" of the configuration space, a corner case involves doing so with multiple variables, which would put users at a "corner" of a multidimensional configuration space.

like image 26
inigo333 Avatar answered Sep 21 '22 02:09

inigo333