Edge Case
   HOME

TheInfoList



OR:

An edge case is a problem or situation that occurs only at an extreme (maximum or minimum) operating
parameter A parameter (), generally, is any characteristic that can help in defining or classifying a particular system (meaning an event, project, object, situation, etc.). That is, a parameter is an element of a system that is useful, or critical, when ...
. For example, a stereo speaker might noticeably distort audio when played at maximum volume, even in the absence of any other extreme setting or condition. An edge case can be expected or unexpected. In
engineering Engineering is the practice of using natural science, mathematics, and the engineering design process to Problem solving#Engineering, solve problems within technology, increase efficiency and productivity, and improve Systems engineering, s ...
, the process of planning for and gracefully addressing edge cases can be a significant task, and yet this task may be overlooked or underestimated. Some common causes of edge cases are: * Unpredictable user behavior * Evolution of use cases (e.g. user behavior may change over time) * Limited test coverage * Product complexity (for instance, in
distributed systems Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different computer network, networked computers. The components of a distribu ...
or microservice architectures) * Resource limitations (e.g. limited processing power,
computer memory Computer memory stores information, such as data and programs, for immediate use in the computer. The term ''memory'' is often synonymous with the terms ''RAM,'' ''main memory,'' or ''primary storage.'' Archaic synonyms for main memory include ...
, or
computer storage Computer data storage or digital data storage is a technology consisting of computer components and Data storage, recording media that are used to retain digital data. It is a core function and fundamental component of computers. The cent ...
) * Other external causes Some basic examples of edge cases include: * A long username in an app overflows and displays incorrectly * A booking system does not handle reservations correctly on a
leap day A leap year (also known as an intercalary year or bissextile year) is a calendar year that contains an additional day (or, in the case of a lunisolar calendar, a month) compared to a common year. The 366th day (or 13th month) is added to kee ...
(February 29th) Non-trivial edge cases can result in the failure of an object that is being engineered. They may not have been foreseen during the
design A design is the concept or proposal for an object, process, or system. The word ''design'' refers to something that is or has been intentionally created by a thinking agent, and is sometimes used to refer to the inherent nature of something ...
phase, and they may not have been thought possible during normal use of the object. For this reason, attempts to formalize good engineering standards often include information about edge cases.


Software engineering

In programming, an edge case typically involves input values that require special handling in an
algorithm In mathematics and computer science, an algorithm () is a finite sequence of Rigour#Mathematics, mathematically rigorous instructions, typically used to solve a class of specific Computational problem, problems or to perform a computation. Algo ...
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 Method (, methodos, from μετά/meta "in pursuit or quest of" + ὁδός/hodos "a method, system; a way or manner" of doing, saying, etc.), literally means a pursuit of knowledge, investigation, mode of prosecuting such inquiry, or system. In re ...
. 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. Programmers may also create integration tests to address edge cases not covered by unit tests. These tests cover cases which only appear when a system is tested as a whole. For example, while a unit test may ensure that a function correctly calculates a result, an integration test ensures that this function works properly when integrated with a database or an external
API An application programming interface (API) is a connection between computers or between computer programs. It is a type of software interface, offering a service to other pieces of software. A document or standard that describes how to build ...
. These tests are particularly relevant with increasing system complexity in
distributed systems Distributed computing is a field of computer science that studies distributed systems, defined as computer systems whose inter-communicating components are located on different computer network, networked computers. The components of a distribu ...
,
microservices In software engineering, a microservice architecture is an architectural pattern that organizes an application into a collection of loosely coupled, fine-grained services that communicate through lightweight protocols. This pattern is characterize ...
, and Internet of things (IoT) devices. With microservices in particular, testing becomes a challenge as integration tests may not cover all microservice endpoints, resulting in uncovered edge cases. Other types of testing which relate to edge cases may include load testing and negative/failure testing. Both methods aim at expanding the test coverage of a system, reducing the likelihood of unexpected edge cases. In
test-driven development Test-driven development (TDD) is a way of writing source code, code that involves writing an test automation, automated unit testing, unit-level test case that fails, then writing just enough code to make the test pass, then refactoring both the ...
, edge cases may be determined by system requirements and accounted for by tests, before writing code. Such documentation may go inside a
product requirements document A product requirements document (PRD) is a document containing all the requirements for a certain product. It is written to allow people to understand ''what'' a product should do. A PRD should, however, generally avoid anticipating or defining ...
after discussions with stakeholders and other teams.


See also

*
Corner case In engineering, a corner case (or pathological case) involves a problem or situation that occurs only outside normal operating parameters—specifically one that manifests itself when multiple environmental variables or conditions are simultaneou ...
, an issue that occurs only when multiple environmental conditions are simultaneously at extreme (maximum or minimum) levels *
Forensic engineering Forensic engineering has been defined as "the investigation of failures—ranging from serviceability to catastrophic—which may lead to legal activity, including both civil and criminal". The forensic engineering field is very broad in terms o ...
*
Fuzzing In programming and software development, fuzzing or fuzz testing is an automated software testing technique that involves providing invalid, unexpected, or random data as inputs to a computer program. The program is then monitored for exceptio ...
* Random testing *
Happy path In the context of software or information modeling, a happy path (sometimes called happy flow) is a default scenario featuring no exceptional or error conditions. For example, the happy path for a function validating credit card numbers would be ...


References

{{DEFAULTSORT:Edge Case Engineering concepts Usability Technical communication Software testing