Software maintenance is an important and challenging phase of the software development life cycle because changes during this phase without proper awareness of dependencies among program modules can introduce faults in the software system. There is also a common intuition that cloned code introduces additional software maintenance challenges and difficulties. To support successful accomplishment of maintenance activities we consider two issues: (i) identifying coding characteristics that cause high source code modifications, and (ii) guidance for minimizing source code modifications.
Focusing on these two issues we investigated the effects of method sharing (among different functionality) on method co-changeability and source code modifications. We proposed and empirically evaluated two metrics, (i) COMS (Co-changeability of Methods), and (ii) CCMS (Connectivity of Co-changed Method Groups). COMS measures the extent to which a method co-changes with other methods. CCMS quantifies the extent to which a particular functionality in a software system is connected with other functionality in that system. In other words CCMS measures the intensity of method sharing among different functionality or tasks (defined later). We investigated the impact of CCMS on COMS and source code modifications. Our comprehensive study on hundreds of revisions of six open source subject systems covering three programming languages (Java, C and C#) suggests that - (i) higher CCMS causes higher COMS as well as increased source code modifications, (ii) COMS in the cloned regions of a software system is negligible as compared to the COMS in the non-cloned regions, and (iii) in-spite of some issues (described later) cloning can be a possible way to reduce CCMS.