| Software evolution is a dynamic behavior of software maintenance and software updates in the life cycle of the software system, throughout the software life cycle. Software needs continuous evolution to meet the users’ demand expansion, repair system error, adapt to the new environment and configuration. However, software code complexity is likely to be increased by a large margin during the software evolution. Software code complexity is a measure of code complex degree. It is the indication of the workload of the understanding and maintenance of the code. In the process of software evolution, the rise of software complexity will damage the stability, security, and maintainability of the software. During software evolution, the code quality of many software projects were declining because of without effective control of code complexity, their maintenance difficulty is rising, eventually lead to the end of the software life. Therefore, under the existing software development environment, researching the evolution of software code complexity is beneficial for the iterative development and reconstruction of software, and can prolong the life cycle of the software. The main work of the thesis is to research on how to control code complexity in software evolution.Based on the code complexity evaluation, the thesis proposes an analysis method for software evolution, applying the McCabe cyclomatic complexity and Halstead complexity metrics in measurement of Java software, finding out the software modules with high complexity, showing the trends of the software complexity changing during their evolution, and analyzing the reasons for such changes. Then, based on this method, we designed and implemented a related tool, software developers can not only evaluate code complexity, but also can analyze the position of the possible defects in the code. Finally, based on the measurement and analysis of 157 open source software projects, the thresholds of McCabe cyclomatic complexity and Halstead complexity are analyzed from class level and method level. We also analyzed the evolution of open source software through experiments, so that we can verify the validity and correctness of the method and the tool. |