{'fraction_non_alphanumeric': 0.018214936247723135, 'fraction_numerical': 0.0, 'mean_word_length': 5.3526011560693645, 'pattern_counts': {'":': 0, '<': 0, '<?xml version=': 0, '>': 0, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
Cohesion is structural, coherence is functional: different views, different measures

Traditionally, the cohesion of a software component is considered to be a characteristic of its internal structure, and most cohesion measures proposed so far measure cohesion through the similarity of its constituent parts. However, cohesion may also be interpreted as an externally observed functional property, without regard for the component's internal structure. One way of measuring functional cohesion would be to measure the similarity of usage patterns of a component's external clients. One such measure is defined in this paper using a generic system model and its associated mechanism for calculating object sizes as the foundation. The new measure is simple to understand, easy to automate, and flexible enough to be used at different levels of abstraction. Moreover, it satisfies the most important properties that a cohesion measure is expected to satisfy. Examples are provided to illustrate the concept and its possible uses in analyzing and re-packaging of the components of a software system.