软件工程II(管理)_第三次作业(更正版)
2008-11-09 23:19
483 查看
软件工程II(管理)_第三次作业(更正版)
Homework: Measuring Cohesion
Calculate the functional cohesion measures for the following code fragment
Answer:
Graph, under showed, showing the dependencies between the variables in the code in last example. Use solid lines for data dependencies and dashed lines for control dependencies.
Total tokens = 5;
Glue tokens = 2;
Superglue tokens = 1;
Weak functional cohesion (WFC) = glue tokens / total tokens = 2/5 = 0.4;
Strong functional cohesion (SFC) = superglue tokens / total tokens = 1/5 = 0.2;
Adhesiveness = (0.4+0.2)/2 = 0.3;
Homework
1. Given the following design, indicate for the following ideas of coupling, cohesion, and abstraction whether it is desirable to have a high or low value and how this design exemplifies the term
Answer:
根据上述代码可知:
由于把Course类对象直接定义为College类的成员属性,所以这两个类之间的耦合度很高。
虽然Course类中有不少成员方法,但没有一个成员方法使用到该类的成员属性,所以Course类模块的聚合度很低。
并且,这两个类中存在大量可共用的成员变量以及很多功能重复的成员方法。
建议将程序修改为:
2. Draw scenarios for the interaction between a customer trying to buy a particular music CD with cash and a clerk in the music store. Be sure to cover all possibilities. Use the state machine model with the events being the arcs.
Answer:
Homework: Measuring Cohesion
Calculate the functional cohesion measures for the following code fragment
Answer:
Graph, under showed, showing the dependencies between the variables in the code in last example. Use solid lines for data dependencies and dashed lines for control dependencies.
Total tokens = 5;
Glue tokens = 2;
Superglue tokens = 1;
Weak functional cohesion (WFC) = glue tokens / total tokens = 2/5 = 0.4;
Strong functional cohesion (SFC) = superglue tokens / total tokens = 1/5 = 0.2;
Adhesiveness = (0.4+0.2)/2 = 0.3;
Homework
1. Given the following design, indicate for the following ideas of coupling, cohesion, and abstraction whether it is desirable to have a high or low value and how this design exemplifies the term
Answer:
根据上述代码可知:
由于把Course类对象直接定义为College类的成员属性,所以这两个类之间的耦合度很高。
虽然Course类中有不少成员方法,但没有一个成员方法使用到该类的成员属性,所以Course类模块的聚合度很低。
并且,这两个类中存在大量可共用的成员变量以及很多功能重复的成员方法。
建议将程序修改为:
Base.java |
package com; public abstract class Base { public String courseNum ; } |
Student.java |
package com; public class Student extends Base { private String stuID; private String name; public String getStuID() {} public void setStuID(String stuID) {} public String getName() {} } |
Course.java |
public class Course extends Base { public List stuList ; public void displayStudentsInCourse(){} public void addStudent(Student stu){} } |
College.java |
package com; import java.util.List; public class College { public List courseList ; public void addCourse(Course course){} ; public void displayStudent(String stuName){} ; } |
Answer:
相关文章推荐
- 软件工程II(管理)_第三次作业(更正版)
- 软件工程管理——第三次作业
- 软件过程与项目管理(第三次作业)
- 第三次课作业(项目管理一般知识、立项管理)
- 第三次作业 项目沟通管理、风险管理、采购管理的重点知识梳理
- 【评分】集美大学软件工程1413班工程项目管理第0次作业——读后感
- 软件工程第三次作业-结对作业NO.1
- Java 第三次作业
- linux学习入门2-3——bash命令基本操作(linuxcast.net)(bash部分快捷键、uname、history、通配符、切换用户、作业管理(前台、后台运行,暂停等操作))
- LicManager NEW PBS作业调度管理系统
- 第三次作业:Scanner的学习
- 第三次作业:Excel数据读取 及 HTML文件初步
- java第三次作业
- 3.进程管理与作业控制
- 第三次作业
- 作业管理系统系统流程图
- [作业2]C++第三次实验(基础班)——选择结构设计
- 软件工程第三次作业
- 第三次作业+105032014043
- 信管师培训之第六节课作业(项目质量管理+项目人力资源管理)