电子学报 ›› 2020, Vol. 48 ›› Issue (4): 772-780.DOI: 10.3969/j.issn.0372-2112.2020.04.019

• 学术论文 • 上一篇    下一篇

Code Smell视角下分层Web应用失血及充血现象的量化分析

黄子杰, 陈军华, 高建华   

  1. 上海师范大学计算机科学与技术系, 上海 200234
  • 收稿日期:2019-02-18 修回日期:2019-08-06 出版日期:2020-04-25
    • 通讯作者:
    • 高建华
    • 作者简介:
    • 黄子杰 男,1994年2月出生,上海人.2016年于上海师范大学获理学学士学位,现为硕士研究生,研究方向为软件测试、软件可靠性验证和数据挖掘.E-mail:hzjdev@foxmail.com;陈军华 男,1968年3月出生,上海人.副教授、硕士生导师.现任上海师范大学信息与机电工程学院副院长.研究方向为数据库理论及应用、分布式数据库等.E-mail:chenjh@shnu.edu.cn
    • 基金资助:
    • 国家自然科学基金 (No.61672355)

Quantifying Anemia and Bloodshot of Layers in Web Applications from the Perspective of Code Smell

HUANG Zi-jie, CHEN Jun-hua, GAO Jian-hua   

  1. Department of Computer Science and Technology, Shanghai Normal University, Shanghai 200234, China
  • Received:2019-02-18 Revised:2019-08-06 Online:2020-04-25 Published:2020-04-25
    • Corresponding author:
    • GAO Jian-hua
    • Supported by:
    • National Natural Science Foundation of China (No.61672355)

摘要: 分层Web应用的领域层由领域模型构成.仅存储数据且不实现行为的领域模型被称作失血领域模型,其状态和数据由非领域层中的类维护,造成后者的充血现象.失血和充血现象损害了Web应用的可维护性,然而,由于缺乏量化分析和研究,其论据多基于主观经验得出.本文度量三种Code Smell(Feature Envy、Blob和Data Class)的强度,将它们作为衡量失血和充血现象的标准,对现象进行量化分析,进而得出它们之间的相关性.本文对一个公开数据集的91个Java Web项目及10个不同领域的开源Java Web应用的多个版本进行了实验,实验发现至少有75%的项目受领域层失血和服务层充血现象的影响,这些现象极少被解决或减弱,两者的强度在不同类间存在相关性,且两者强度的增量在同一软件项目的不同版本间亦存在相关性.

 

关键词: 软件可维护性, web应用, 分层结构, code smell, 领域建模

Abstract: Domain Models shape the Domain Layer of Web Applications.Anemic Domain Models (ADMs) are Domain Models holding only data. States of ADMs are maintained by classes in other layers, causing the latter bloodshot. However, there lacks research revealing the significance of impact that anemia and bloodshot of layers pose on maintainability. To quantify the significance, this paper assesses intensity of 3 Code Smells (Feature Envy, Blob and Data Class) as evaluation standards. Through an experiment conducted on 91 Java projects and multiple releases of 10 Java Web applications, this paper concludes that over 75% of the projects are affected. As the impact persists, correlations of the intensities exist among different classes of a project as well as same classes in different releases of a project.

 

Key words: software maintainability, web application, layered architecture, code smell, domain modeling

中图分类号: