Software reuse is the use of existing software or software knowledge to build new software. Ad hoc software reuse has been practiced from the earliest days of programming. Programmers have always reused sections of code, templates, functions, and procedures. Software reuse as a recognized area of study in software engineering, however, dates only from 1968 when Doug[[Douglas McIlroy]] of [[Bell Labs|Bell Laboratories]] proposed basing the software industry on reusable components.
Reusable software or software knowledge items are called reusable assets. Assets may be designs, requirements, test cases, architectures, etc.
Perhaps the most well known reusable asset is code. '''Code reuse''' ' is the idea that a partial or complete [[computer program]] written at one time can be, should be, or is being used in another program written at a later time. The re-usereuse of programming code is a common technique which attempts to save time and energy by reducing redundant work.
A very common example of code reuse is the technique of using a [[Library (computer science)|software library]]. Many common operations, such as converting information among different well-known formats, accessing external storage, interfacing with external programs, or manipulating information (numbers, words, names, locations, dates, etc.) in common ways, are needed by many different programs. Authors of new programs can use the code in the software library to accomplish these tasks, instead of "re-inventing the wheel" (by actually writing new code directly in the program to perform the operation). Library implementations often have the benefit of being well-tested and covering unusual or arcane cases. Disadvantages include the inability to tweak details which may affect performance or the desired output, and the time and cost of acquiring, learning, and configuring the library.
The software library is a good example of [[Abstraction (computer science)|abstraction]]. Programmers may decide to create internal abstractions so that certain parts of their program can be re-used, or may create custom libraries for their own use.
In order forFor newly written code to use a piece of existing code, some kind of interface, or means of communication, must be defined. These commonly include a "call" or use of a [[subroutine]], [[Object (computer science)|object]], or [[Class (computer science)|class]], or [[Prototype-based programming|prototype]]. In organizations, such practices are formalized and standardized by [[Product Family Engineering|software product line]] engineering.
Some code reuse involves simply copying some or all of the code from an existing program into a new one. Another technique is to use a software "generator" - a program which can create new programs of a certain type, based on a set of parameters the user chooses. ▼
▲Some code reuse involves simply copying some or all of the code from an existing program into a new one. Another techniquemeans is to use a software " [[Source code generation|generator ]]" -, a program which can create new programs of a certain type, based on a set of parameters the user chooses . Fields of study about such systems are [[Generative programming]] and [[Metaprogramming]].
The general practice of using a previous version of an existing program as a starting point for the next version, could also be thought of as code reuse. ▼
▲The general practice of using a previousprior version of an existingextant program as a starting point for the next version, couldis also bea thoughtform of as code reuse.
==See also==
|