User Tools

Site Tools


integration

Integration

Integrations are functions not containing any logic; they are, so to speak, the opposites of operations. Their only purpose is to call functions under the control of the developer. Example:

public void Run(string path) {
    var fileLines = _filesystem.Get_lines_in_files(path);
    (int numberOfFiles, int totalLoc) = Domain.Count_lines(fileLines);
    _presenter.Display_results(numberOfFiles, totalLoc);
}

Testing

Testing of integrations is difficult due to their nature as coordinators who call other functions. Fortunately, though, integration is simple, almost trivial. It's hard to get wrong. Hence, testing to answer the question “Is the integration technically correct?” is hardly needed. In most cases a review will tell, whether an integration implements a solution approach as designed.

However, integrations as the roots of a functional hierarchy or more generally as the public members of modules should be put under automatic test. Such tests then primarily serve as regression tests. That way permanent tests for non-public operations can be avoided.

Freedom from functional dependencies

Functional hierarchies following the IOSP look different from the usual ones found in code bases. IOSP hierarchies consist of a larger number and smaller functions. And those functions are focused on either integration or operation.

The purpose of operations is computation. The purpose of integrations is coordination of computations and/or lower level integrations. Compare this to functional hierarchies full of functional dependencies.

Functions in an IOSP hierarchy tend to be small, even very small. Operations don't grow large because whenever a part of their logic is extracted into another function, all logic needs to be extracted. Then an operation becomes a small integration. And integrations don't grow large because adding more and more function calls makes them harder to understand and they can easily be extracted keeping the integration intact.

integration.txt · Last modified: 2018/06/04 13:43 by fdadmin