Software Engineering terms
Each and every one of these terms are critical is understanding the ability to create modular code. Although the term "modular code" can be applied to distinct software development techniques (Object-oriented, Component oriented and so on) each and every one of these ideas can be used in non-OOP and non-Component code. As such they are general guidelines on how to maximise the return on investment when time is spent developing code which will be frequently used.
A software module should ideally be identifiable as a single object with a clearly defined strcuture and functionality. It's external interfaces should be clearly defined and predictable and limited to the neccessary, only exposing as much of the internal structure as neccessary. In general, the following terms can be used to describe the optimum situation. Some of these terms are seemingly interchangeable, but each and every one addresses a specific aspect of code modularisation."In computer science, a module separately, which makes them reusable and allows multiple programmers to work on different modules simultaneously. Modules also promote is a software entity that groups a set of (typically cohesive) subprograms and data structures. Modules are units that can be compiledmodularity and encapsulation (i.e. information hiding), both of which can make complex programs easier to understand."
- Module (programming). (2007, February 2). In Wikipedia, The Free Encyclopedia. Retrieved 15:15, March 25, 2007, from http://en.wikipedia.org/w/index.php?title=Module_%28programming%29&oldid=105143019
Otherwise known as "Information hiding", encapsulation is the act of removing the inner workings of a piece of software from view. Instead, an interface is defined which allows the functionality of the software module to be used to the full. This allows the programmer to change the implementation of the module without affecting the programs which make use of the already defined interface.
The ability to encapsulate code relies on the existance of a pre-defined and stable interface. Performed at an early stage in the development of a program, the definition of such interfaces can be of great benefit to software development teams, with each team or team member able to work on different code bases without fear of collision or conflict provided the interface remains unchanged.
Encapsulated code allows a programmer to use the code as a "drop-in" function, not having to worry about external dependencies. Conversely, encapsulated code can also be removed from a project without causing any unexpected disruptions (Standard interface calls will of course be affected).
- Information hiding. (2007, February 20). In Wikipedia, The Free Encyclopedia. Retrieved 17:31, March 11, 2007, from http://en.wikipedia.org/w/index.php?title=Information_hiding&oldid=109523103
Cohesion is a measure of how strongly related and focussed individual parts of a given module is. Modules have high (functional) cohesion if the functionality and scope of all of the contained functions and data are related to or focussed on a single function.
- Cohesion (computer
science). (2007, March 9). In Wikipedia, The Free Encyclopedia.
Retrieved 17:34, March 11, 2007, from http://en.wikipedia.org/w/index.php?title=Cohesion_%28computer_science%29&oldid=113905212
Coupling is a measure of how much distinct modules are dependent on each other. Modules are said to be loosely coupled when any interaction between modules is carried out over a public, defined messaging interface. Even the exchanging of data between modules can lead to an unwanted increase in coupling as a change in the data structure can create unwanted problems with related modules. In such cases where data exchange is unavoidable, the structure of the data being exchanged should be as elementary and as focussed as possible.
- Coupling (computer science). (2007, March 4). In Wikipedia, The Free Encyclopedia. Retrieved 17:33, March 11, 2007, from http://en.wikipedia.org/w/index.php?title=Coupling_%28computer_science%29&oldid=112518419
Unit testing is a method of testing software code in its smallest possible blocks. The above-mentioned terms are essential in order to be able to efficiently perform unit testing. By devising and implementing tests for individual units of code (Class methods, single procedures and so on) which ideally covers the possible scope of use, it is possible at any given time to test, diagnose and debug code one small chunk at a time. The benefits of this are fewer bugs and a framework through which future changes or updates to a given code portion can be re-checked for functionality.
- Unit testing. (2008, January 28). In Wikipedia, The Free Encyclopedia. Retrieved 11:59, February 7, 2008, from http://en.wikipedia.org/w/index.php?title=Unit_testing&oldid=187551687