排序方式: 共有8条查询结果,搜索用时 15 毫秒
1
1.
为了实现代码缺陷与代码味道的自动探测与优化, 提升优化与重构的效率, 设计并开发了一套名为SCORT的源代码优化与重构工具。SCORT将源代码解析为抽象语法树, 再探测其中存在的代码缺陷和代码味道, 最后对缺陷和味道进行自动优化和重构。在SCORT中已经实现了对15种常见代码缺陷和六种常见代码味道的检测以及自动优化与重构, 提供了多种代码味道的自动重构算法, 且具有良好的可扩展性。通过对三个待测项目的探测和优化实验结果表明, 对于常见代码缺陷的探测和优化, SCORT的精确率、召回率和准确率均可达100%; 对于部分常见的代码味道, SCORT尚需进一步完善。SCORT有助于开发人员提高代码质量, 减少源代码中存在的缺陷和味道。 相似文献
2.
Complex conditional statement is one of the bad code smells, which affects the quality of the code and design of software. In the proposed approach, two commonly-used design patterns for handling complex conditional statements are selected, and they are the factory method pattern and the strategy pattem. Two pattern-directed refactoring approaches based on the two design patterns are proposed. Each approach contains a refactoring opportunities identification algorithm and an automated refactoring algorithm. After parsing the abstract syntax tree generated from source code, the refactoring opportunities are identified effectively and automatically. Then, for candidate code, refactoring algorithms are executed automatically, which are used to simplify or remove complex conditional statements. By empirical analysis and quality assessment, the code after refactoring has better maintainability and extensibility, and the proposed approach for automated pattern-directed refactoring succeeds to reduce code size and complexity of classes. 相似文献
3.
在城市化进程不断的加快下,城市规划和管理的问题对我国城市化建设可持续发展所产生的阻碍作用不可小觑,怎样才能科学的解决这些问题,确保城市建设科学化的发展就成为城市化建设的热点。下面就结合作者实际工作经验,简要的分析城市建筑群落规划的不足之处,并且提出了加强解决的措施,希望对相关从业人员有所帮助。 相似文献
4.
5.
6.
交通网路、城市文化背景、价值观、建筑工业的变化,给城市带来的不仅仅是进步,同时城市的建筑文化特色也在遥渐消亡,此时如何保护并提升这些历史建筑及其城市空间的品质成为重要的课题。 相似文献
7.
针对源代码中复杂条件语句将增加程序的复杂性, 影响代码的易理解性、可测试性、可维护性和可扩展性等问题, 提出了一种基于抽象语法树和多态机制的复杂条件语句自动重构方法, 用于识别源代码中复杂条件语句的重构时机并实施自动代码重构. 首先将源代码转换为抽象语法树, 再探测代码中的条件语句, 寻找满足预定条件的条件语句, 最后利用多态机制对条件语句进行自动重构, 将其封装到一系列子类中. 对4个开源项目进行重构时机识别和自动重构实验. 实验结果表明, 重构时机识别算法的精确率可达100%, 并能准确地实现代码的自动重构; 经回归测试, 重构后的代码未引入任何错误; 此外, 该算法具有较好的性能, 执行时间与系统规模呈线性关系, 能够应用于各类不同规模的系统. 相似文献
8.
1