问题 单项选择题

为了提高模块的独立性,模块之间最好是______。

A.控制耦合
B.公共耦合
C.内容耦合
D.数据耦合

答案

参考答案:D

解析:耦合是对一个软件结构内不同模块之间互连程度的度量。耦合强弱取决于模块间接口的复杂程度、进入或访问一个模块的点,以及通过接口的数据。耦合可以分成下列几种,它们之间的耦合度由高到低排列。
(1)内容耦合:指两个模块之间出现了下列情况之一,即一个模块访问另一个模块的内部数据;一个模块不通过正常入口转到另一个模块的内部;两个模块有一部分程序代码重叠;一个模块有多个入口。软件设计时应坚决禁止内容耦合,应设计成单入口、单出口的模块,避免病态连接。
(2)公共耦合:多个模块引用一个全局数据区的模式。例如,C语言中的external数据类型、磁盘文件等都是全局数据区。
(3)外部耦合:当模块与软件以外的环境有关时就发生外部耦合。例如,输入/输出把一个模块与特定的设备、格式、通信协议耦合在一起。
(4)控制耦合:一个模块明显地把开关量、名字等信息送入另一个模块,控制另一个模块的功能。
(5)标记耦合:两个以上的模块都需要其余某一数据结构的子结构时,不使用全局变量的方式而是用记录传递的方式。
(6)数据耦合:两个模块借助于参数表传递简单的数据。
(7)非直接耦合:两个模块没有直接关系,它们之间的联系完全是通过主程序的控制和调用来实现的。
为了提高模块的独立性,模块一般采用高内聚、低耦合原则。

完形填空

任务型阅读(共5小题;每小题1 分,满分5 分)

Martin, Henry, Margaret, Joseph和Alex五个人都想要参加各自喜欢的俱乐部。请仔细阅读第1-4题中的个人情况说明,然后从A到D的四个项目中,选出符合个人要求的最佳选项,并回答第5小题。

小题1:Martin wants to learn how to be a team leader and how to organize activities.

小题2:Henry is interested in gardening and taking care of flowers and plants.

小题3:Margaret wants to have a try in the making of TV programs.

小题4:Joseph hopes to be given a chance to act in a play. 

Club information

A.This club is a group of students who are interested in the art of TV broadcasting. Members learn how to use equipment in our television studio. They also work as part of a team to produce TV programs.

Advisor: Mr. Koehler

B.The aim of this club is to help the members to develop their own leadership skills by organizing different kinds of activities. The members meet every Tuesday from 3:00 to 4:00.

Advisor: Mr. Wells

C.This club for students in Grades 2 and 3 helps plant and take care of the School Front Garden and the Butterfly Garden.

Advisor: Mr. Michael

D.This club produces musical and nonmusical plays in which 75 to 100 players can act depending on which play is chosen. The plays like Dinosaurs Alive, Disney Days and so on have been enjoyed by many people. All students are welcome.Advisor: Mrs. Sands

小题5:Alex likes basketball very much and wants to become a member of the school team. What club will he choose?

A.Do you want to play with classmates? You can take part in kinds of activities.

B.Do you want to become a Kobe or a James in our school? Our club has invited a retired NBA player, who will help you a lot.

C.Do you want to travel all the world? We will invite a famous traveler to introduce the world.

D.Please take part in our club. The teachers will help you practice spoken English.

多项选择题