Offensive programming

Offensive programming is a reaction to extreme interpretations of defensive programming. Whereas defensive programming centers around graceful handling of errors in general, the emphasis in offensive programming is to NOT gracefully handle errors that would imply a software bug – prioritizing the detection of bugs over the hypothetical safety benefit of tolerating them.[1][2]

Distinguishing errors

Central to the concept is distinguishing between expectable errors, coming from the program's outside environment, however improbable, versus preventable errors that shall not happen if all software components behave as expected.

Examples:

Expectable errors Preventable errors
Invalid user input Invalid function arguments
Depletion of OS resources (such as storage, memory) Value out of defined range (e.g. enum)
Hardware failure (such as network, storage) Undocumented return value or exception

Bug detection strategies

Offensive programming is concerned with failing, not necessarily producing error messages; that may be a secondary goal.

Strategies:

See also

References

  1. "Offensive Programming". Cunningham & Cunningham, Inc. Retrieved 4 September 2016.
  2. Broadwall, Johannes (25 September 2013). "Offensive programming". Thinking Inside a Bigger Box. Retrieved 4 September 2016.
This article is issued from Wikipedia - version of the 9/7/2016. The text is available under the Creative Commons Attribution/Share Alike but additional terms may apply for the media files.