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.

Modular code

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."


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).


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.


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.

Unit Testing

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.