简答题

课程名称:软件评测师

题目:阅读下列说明,回答下列问题。    [说明]    某嵌入式系统中,存在16路数据采集通道。为了提高数据采集的可靠性,对16路采集通道均采用双余度设计;为了监控采集通道是否发生故障,对各路双余度通道采集值进行比较。只有当该通道两个余度设备采集值均不小于45时,才表示该路通道正常。设计人员设计函数num_of_passer用于统计无故障通道数目,在该函数的设计中考虑了如下因素:11采用如下数据结构存储通道号及采集值:struct Value{ unsigned int  No;        //通道号,1到16unsigned short  value1;    //余度1采集值unsigned short  value2;    //余度2采集值}12当输入参数异常时,函数返回-1;13若正确统计了无故障通道数目,则返回该数目;14该函数需要两个输入参数,第一个参数是用于存储通道号及余度采集值的数组,第二个参数为通道总数目;15调用函数sort16对存储通道号及余度采集值的数组进行排序处理。开发人员根据上述要求使用ANSI C对代码实现如下(代码中每行的第一个数字代表行号):11、嵌入式软件中通常使用函数扇出数和注释率来衡量程序的可维护性,请计算函数num_of_passer的扇出数和注释率,并判断此函数扇出数和注释率是否符合嵌入式软件的一般要求。(6分)12、请使用代码审查的方法找出该程序中所包含的至少4处错误,指出错误所在的行号和问题描述。(8分)13、覆盖率是度量测试完整性的一个手段,也是度量测试有效性的一个手段。在嵌入式软件白盒测试过程中,通常以语句覆盖率、分支覆盖率和MC/DC覆盖率作为度量指标,请分别指出对函数num_of_passer达到100%语句覆盖、100%分支覆盖和100%MC/DC覆盖所需的最少测试用例数目。(6分)

单选题

课程名称:软件评测师

题目:In a world where it seems we already have too much to do, and too many things to think about, it seems the last thing we need is something new that we have to learn.    But use cases do solve a problem with requirements: with __1__ declarative requirements it's hard to describe steps and sequences of events.    Use cases, stated simply, allow description of sequences of events that, taken together, lead to a system doing something useful. As simple as this sounds, this is important. When confronted only with a pile of requirements, it's often __2__ to make sense of what the authors of the requirements really wanted the system to do. In the preceding example, use cases reduce the ambiguity of the requirements by specifying exactly when and under what conditions certain behavior occurs; as such, the sequence of the behaviors can be regarded as a requirement. Use cases are particularly well suited to capturing these kind of requirements. Although this may sound simple, the fact is that __3__ requirement capture approaches, with their emphasis on declarative requirements and "shall" statements, completely fail to capture the __4__ of the system's behavior. Use cases are a simple yet powerful way to express the behavior of the system in way that all stakeholders can easily understand.    But, like anything, use cases come with their own problems, and as useful as they are, they can be __5__. The result is something that is as bad, if not worse, than the original problem. Therein it's important to utilize use cases effectively without creating a greater problem than the one you started with.5、_____