FamousLongAgo has asked for the wisdom of the Perl Monks concerning the following question:
Fellow monks,
Please forgive a generic terminology question, but I suspect other monks may benefit from the answer as much as I will. I can't find anything relevant on Google.
I have seen the terms "corner case" and "edge case" used on several occasions in discussions about testing. I understand the general concept  points at which fencepost and overrun errors are especially likely, but is there a rigorous definition? And is there a difference between the two?
Perhaps someone has a Perl example illustrating that difference?
Re: What is the difference between a corner case and edge case? (boundary count)
by tye (Sage) on Jan 13, 2003 at 16:28 UTC

An edge case is where the program logic meets a boundary condition. A corner case is where you meet more than one boundary condition at once.
Edge cases are things you should test for in your unit tests because they are a very common place for bugs to be. Corner cases are usually talked about in terms of "I found a bug, but it is a bit of a corner case so it might not be worth fixing", that is, it will be encountered very rarely.
 tye
 [reply] 

Based on this first paragraph:
An edge case is where the program logic meets a boundary condition.
A corner case is where you meet more than one
boundary condition at once.
I'm tempted to supplement the second paragraph with:
Corner cases may also be ones that seem impossible when
they actually are encountered, which in
turn consumes a lot more time in the fixing (due to a larger
number of falsestarts and irrelevant quadruple checks when
debugging), and ultimately causes the hardest foreheadslapping
once they are finally solved, as in "who would have thought that these two simple, unrelated
conditions could have produced such a bizarre result???"
 [reply] 

 [reply] 
Re: What is the difference between a corner case and edge case?
by jmcnamara (Monsignor) on Jan 13, 2003 at 12:56 UTC

A corner case contains two or more edge cases. :)
Seriously, it is loose terminology. Probably like the way people often use stress and strain to mean the same thing.

John.
 [reply] 

That's a good example. Within an engineering community, stress and strain have an exact meaning (stress => compression, strain => tension), and people who misuse the terms brand themselves as weenies. Or, at least, nonengineers. I'm worried there's an equally sharp (and useful) distinction I'm missing here.
 [reply] 

I offer this nitpick about noncomputer issues to the monestary in the interests of academic completeness.
Within an engineering community, stress and strain have an exact meaning (stress => compression, strain => tension), and people who misuse the terms brand themselves as weenies. Or, at least, nonengineers.
Nonengineer, definitely. :) Strain can be thought of as a measure of movement, and stress as a measure of force. Your example sounds to me like you're saying "I weigh 17 inches."  nonsense. So here's a minitutorial on stress, strain, and the like, because I know you're dying to learn about solid mechanics today.
Stress is essentially a measure of how much force exists in a unit area of something  a basic expresion is s=p/a (though stress should be written sigma  σ). Stress can be thought of as pressure. Take a pencil, put the point down on your desk, and press on the eraser head  it doesn't hurt. Would it hurt if you had the eraser head on the desk and your palm was pressing against the pencil lead? There is less pencil area for the force of your hand to act on, so the stress is higher. (BTW, if you really want me to, I can explain bending stresses (s=M*c/I) as well.)
Strain is a measure of the change of length of something  expressed as e=change/length (and e should be written epsilon  ε). If I have a spring which is an inch long, and I compress it, it may change length .5 inches. If I take a spring which is 10 inches long, but otherwise identical, and I compress it, I'll get much more length change than .5 inches. Strain is a ratio measure of length change.
A reason that laypeople often use the terms interchangably is that the two are related. Hook's law is an empirical relationship which states that stress and strain are directly related : s=e*E (or σ=ε*E for those browsers which support HTML entities). The constant 'E' is Young's Modulus, also called the Modulus of Elasticity; you can think of it as a measure of how much force it takes to compress a spring, the two concepts are very close.
I don't know what jmcnamara meant when he offered up his example  I'll assume that he knew what stress and strain are. So now you know a little about solid mechanics.
 [reply] [d/l] [select] 



Re: What is the difference between a corner case and edge case?
by scain (Curate) on Jan 13, 2003 at 13:36 UTC

I believe it comes from numerical methods, specifically for solving multidimentional differential equations. In order to solve a 2D differential equation, you need initial conditions at the boundaries; along the sides, you have one condition that must be met. At the corners, you have two conditions that must met, and frequently, that is where the problems happen.
Minor update: I should more properly have referred to those conditions as boundary conditions, that have to true all the time. In order to solve a 2d differential equation, you also need initial conditions describing the state of the surface initially (at t=0).
Scott
Project coordinator of the Generic Model Organism Database Project
 [reply] 
Re: What is the difference between a corner case and edge case?
by mydoghasworms (Initiate) on Oct 15, 2019 at 10:13 UTC

After recently taking up the Rubik's cube, I have come to the conclusion that the terms "corner case" and "edge case" originate from there. Perhaps I'm wrong. But it's nice to think so. Because there are lots of corner and edge cases (literally) when solving a cube.  [reply] 

