{'fraction_non_alphanumeric': 0.012287334593572778, 'fraction_numerical': 0.0, 'mean_word_length': 5.7025316455696204, '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}}
The Logical Modularity of Programs

The principles and best practices of object oriented design require that modules in a program should match logical decomposition of the knowledge that the program implements. The violation of these modularization rules leads to several undesired consequences: (i) non-cohesive modules that mix different kinds of knowledge and (ii) logically coupled modules due to a dispersion of conceptually cohesive knowledge. In this paper, we use domain knowledge driven program analysis to detect and characterize discrepancies between the structural modularization of programs and the conceptual decomposition of the implemented knowledge. We characterize the mismatches at the levels of granularity of packages and classes and present their impact on different maintenance activities. The presented approach includes a technique for automating the recovery of mappings between the different categories of knowledge used in the program and the modules that implement them. We briefly present our experience with analyzing JHotDraw.