What is an edge case?

An edge case is also called a boundary case or edge case. It describes a scenario in which a parameter is in an extreme situation. These extremes can be either in the minimum or maximum range.

In most cases, this results in problems and malfunctions, so an edge case should be found, tested and fixed. Unit tests are usually used for this in software development. These test the boundary conditions of a method, a function or algorithms.

By controlling the correct operation within the extremes (the edges), it can be assumed that the states in between will also work. This means that not every case that might occur needs to be controlled. If, for example, a function is to add 2 numbers, it is sufficient to test it with numbers that are as small and as large as possible. If everything works without errors, it can be assumed that the function will also work without problems for all numbers in between. This approach keeps the process of testing as efficient as possible.

What is the difference between an Edge Case and a Corner Case?

In contrast to the Edge Case, where an extreme situation only occurs with one parameter, the Corner Case defines a situation where several conditions are in extreme ranges (minimum or maximum).

The difference therefore lies in the number of operating parameters, which are at the extremes and thus cause problems.

An example of an edge case: A printer has a low ink level and no longer prints the text cleanly. The ink level property is at the minimum and the printer cannot do its job properly.

In the corner case, on the other hand, several conditions are in the extreme: the printer has a low ink level, the brightness is set to maximum and the printer is standing on a shaky surface. It is only the interaction of these 3 parameters that causes the printer not to function properly. If each condition occurred individually, the printer would have no problem. The initial situations in both cases are therefore different, but they usually lead to the same result, namely a malfunction. Since it is often not clear whether one parameter alone or several in combination cause a problem, edge case and corner case are often used as synonyms for an error that occurs.