Anti-pattern

Last updated

An anti-pattern in software engineering, project management, and business processes is a common response to a recurring problem that is usually ineffective and risks being highly counterproductive. [1] [2] The term, coined in 1995 by computer programmer Andrew Koenig, was inspired by the book Design Patterns (which highlights a number of design patterns in software development that its authors considered to be highly reliable and effective) and first published in his article in the Journal of Object-Oriented Programming. [3] A further paper in 1996 presented by Michael Ackroyd at the Object World West Conference also documented anti-patterns. [3]

Contents

It was, however, the 1998 book AntiPatterns that both popularized the idea and extended its scope beyond the field of software design to include software architecture and project management. [3] Other authors have extended it further since to encompass environmental, organizational, and cultural anti-patterns. [4]

Definition

According to the authors of Design Patterns, there are two key elements to an anti-pattern that distinguish it from a bad habit, bad practice, or bad idea:

  1. The anti-pattern is a commonly-used process, structure or pattern of action that, despite initially appearing to be an appropriate and effective response to a problem, has more bad consequences than good ones.
  2. Another solution exists to the problem the anti-pattern is attempting to address. This solution is documented, repeatable, and proven to be effective where the anti-pattern is not.

A guide to what is commonly used is a "rule-of-three" similar to that for patterns: to be an anti-pattern it must have been witnessed occurring at least three times. [5]

Uses

Documenting anti-patterns can be an effective way to analyze a problem space and to capture expert knowledge. [6]

While some anti-pattern descriptions merely document the adverse consequences of the pattern, good anti-pattern documentation also provides an alternative, or a means to ameliorate the anti-pattern. [7]

Software engineering anti-patterns

In software engineering, anti-patterns include the big ball of mud (lack of) design, the God Class (where a single class handles all control in a program rather than control being distributed across multiple classes), magic numbers (unique values with an unexplained meaning or multiple occurrences which could be replaced with a named constant), and Poltergeists (ephemeral controller classes that only exist to invoke other methods on classes). [7]

Big ball of mud

This indicates a software system that lacks a perceivable architecture. Although undesirable from a software engineering point of view, such systems are common in practice due to business pressures, developer turnover and code entropy.

The term was popularized in Brian Foote and Joseph Yoder's 1997 paper of the same name, which defines the term:

A Big Ball of Mud is a haphazardly structured, sprawling, sloppy, duct-tape-and-baling-wire, spaghetti-code jungle. These systems show unmistakable signs of unregulated growth, and repeated, expedient repair. Information is shared promiscuously among distant elements of the system, often to the point where nearly all the important information becomes global or duplicated.

The overall structure of the system may never have been well defined.

If it was, it may have eroded beyond recognition. Programmers with a shred of architectural sensibility shun these quagmires. Only those who are unconcerned about architecture, and, perhaps, are comfortable with the inertia of the day-to-day chore of patching the holes in these failing dikes, are content to work on such systems.

Brian Foote and Joseph Yoder, Big Ball of Mud. Fourth Conference on Patterns Languages of Programs (PLoP '97/EuroPLoP '97) Monticello, Illinois, September 1997

Foote and Yoder have credited Brian Marick as the originator of the "big ball of mud" term for this sort of architecture. [8]

Project management anti-patterns

Project management anti-patterns included in the Antipatterns book include Blowhard Jamboree (an excess of industry pundits), analysis paralysis, Viewgraph Engineering (too much time spent making presentations and not enough on the actual software), Death by Planning (similarly, too much planning), Fear of Success (irrational fears near to project completion), The Corncob (difficulties with people), Intellectual Violence (intimidation through use of jargon or arcane technology), Irrational Management (bad management habits), Smoke and Mirrors (excessive use of demos and prototypes by salespeople), Throw It Over the Wall (forcing fad software engineering practices onto developers without buy-in), Fire Drill (long periods of monotony punctuated by short crises), The Feud (conflicts between managers), and e-mail Is Dangerous (situations resulting from ill-advised e-mail messages). [4]

See also

Related Research Articles

A design pattern is the re-usable form of a solution to a design problem. The idea was introduced by the architect Christopher Alexander and has been adapted for various other disciplines, particularly software engineering. Design patterns are commonly used to improve the flexibility of object-oriented systems.

<span class="mw-page-title-main">Software architecture</span> High level structures of a software system

Software architecture is the set of structures needed to reason about a software system and the discipline of creating such structures and systems. Each structure comprises software elements, relations among them, and properties of both elements and relations.

In software engineering, a software design pattern is a general, reusable solution to a commonly occurring problem within a given context in software design. It is not a finished design that can be transformed directly into source or machine code. Rather, it is a description or template for how to solve a problem that can be used in many different situations. Design patterns are formalized best practices that the programmer can use to solve common problems when designing an application or system.

Software design is the process of conceptualizing how a software system will work before it is implemented or modified. Software design also refers to the direct result of the design process – the concepts of how the software will work which consists of both design documentation and undocumented concepts.

Software development is the process used to create software. Programming and maintaining the source code is the central step of this process, but it also includes conceiving the project, evaluating its feasibility, analyzing the business requirements, software design, testing, to release. Software engineering, in addition to development, also includes project management, employee management, and other overhead functions. Software development may be sequential, in which each step is complete before the next begins, but iterative development methods where multiple steps can be executed at once and earlier steps can be revisited have also been devised to improve flexibility, efficiency, and scheduling.

The following outline is provided as an overview of and topical guide to software engineering:

A requirement is a singular documented physical or functional need that a particular design, product, or process aims to satisfy. It is commonly used in engineering design, systems engineering, software engineering, enterprise engineering, product development, and process optimization. It is a broad concept that could speak to any necessary function, attribute, capability, characteristic, or quality of a system for it to have value and utility to a customer, organization, internal user, or other stakeholder. Requirements can come with different levels of specificity; for example, a requirement specification or requirement "spec" refers to an explicit, highly objective/clear requirement to be satisfied by a material, design, product, or service.

<span class="mw-page-title-main">Systems development life cycle</span> Systems engineering terms

In systems engineering, information systems and software engineering, the systems development life cycle (SDLC), also referred to as the application development life cycle, is a process for planning, creating, testing, and deploying an information system. The SDLC concept applies to a range of hardware and software configurations, as a system can be composed of hardware only, software only, or a combination of both. There are usually six stages in this cycle: requirement analysis, design, development and testing, implementation, documentation, and evaluation.

In computer programming, a software framework is an abstraction in which software, providing generic functionality, can be selectively changed by additional user-written code, thus providing application-specific software. It provides a standard way to build and deploy applications and is a universal, reusable software environment that provides particular functionality as part of a larger software platform to facilitate the development of software applications, products and solutions.

The concept of design paradigms derives from the rather ambiguous idea of paradigm originating in the sociology of science, which carries at least two main meanings:

In the context of software engineering, software quality refers to two related but distinct notions:

<span class="mw-page-title-main">Computer-integrated manufacturing</span> Manufacturing controlled by computers

Computer-integrated manufacturing (CIM) is the manufacturing approach of using computers to control the entire production process. This integration allows individual processes to exchange information with each part. Manufacturing can be faster and less error-prone by the integration of computers. Typically CIM relies on closed-loop control processes based on real-time input from sensors. It is also known as flexible design and manufacturing.

This is an alphabetical list of articles pertaining specifically to software engineering.

Software project management is the process of planning and leading software projects. It is a sub-discipline of project management in which software projects are planned, implemented, monitored and controlled.

Model-driven engineering (MDE) is a software development methodology that focuses on creating and exploiting domain models, which are conceptual models of all the topics related to a specific problem. Hence, it highlights and aims at abstract representations of the knowledge and activities that govern a particular application domain, rather than the computing concepts.

An architectural pattern is a general, reusable resolution to a commonly occurring problem in software architecture within a given context. The architectural patterns address various issues in software engineering, such as computer hardware performance limitations, high availability and minimization of a business risk. Some architectural patterns have been implemented within software frameworks.

<span class="mw-page-title-main">Object-oriented programming</span> Programming paradigm based on the concept of objects

Object-oriented programming (OOP) is a programming paradigm based on the concept of objects, which can contain data and code: data in the form of fields, and code in the form of procedures. In OOP, computer programs are designed by making them out of objects that interact with one another.

In computer programming, a design smell is a structure in a design that indicates a violation of fundamental design principles, and which can negatively impact the project's quality. The origin of the term can be traced to the term "code smell" which was featured in the book Refactoring: Improving the Design of Existing Code by Martin Fowler.

In software engineering and software architecture design, architectural decisions are design decisions that address architecturally significant requirements; they are perceived as hard to make and/or costly to change.

References

What supports what

  1. Budgen 2003, p. 225.
  2. Ambler 1998, p. 4.
  3. 1 2 3 Neill, Laplante & DeFranco 2011, p. 4.
  4. 1 2 Neill, Laplante & DeFranco 2011, p. 5.
  5. Neill, Laplante & DeFranco 2011, p. 6.
  6. Jimenez 2006.
  7. 1 2 Demeyer 2008, p. 102.
  8. Foote, Brian; Yoder, Joseph (26 June 1999). "Big Ball of Mud". laputan.org. Retrieved 14 April 2019.

Sources

  • Neill, Colin J.; Laplante, Philip A.; DeFranco, Joanna F. (2011). Antipatterns: Managing Software Organizations and People. Applied Software Engineering Series (second ed.). CRC Press. ISBN   9781439862162.
  • Budgen, D. (2003). Software design. Harlow, Eng.: Addison-Wesley. p. 225. ISBN   0-201-72219-4. As described in Long (2001), design anti-patterns are 'obvious, but wrong, solutions to recurring problems'.
  • Ambler, Scott W. (1998). Process patterns: building large-scale systems using object technology. Cambridge, UK: Cambridge University Press. p. 4. ISBN   0-521-64568-9. ...common approaches to solving recurring problems that prove to be ineffective. These approaches are called antipatterns.
  • Jimenez, Edward (2006-04-24). "AntiPatterns". AntiPatterns. Retrieved 24 April 2006.
  • Demeyer, Serge (2008). "ObjectOriented Reengineering". In Mens, Tom; Demeyer, Serge (eds.). Software Evolution. Springer Science + Business Media. ISBN   9783540764403.

Further reading