需求工程的一道题目,熟悉点人的帮我解答下

gameboy911 2008-06-11 09:38:35
You want to replace a function f with a more efficient function g. Provided f and g have identical signatures (prototypes), how do their specifications (in terms of pre-and post-conditions) have to relate for your program to remain correct?
a) Pre of g must be weaker than pre of f, but post of g must be stronger than post of f.
b) Pre of g must be stronger than pre of f, but post of g must be weaker than post of f.
c) Pre and post of g must be stronger than pre and post of f.
d) Pre and post of g must be weaker than pre and post of f.

我理解是功能g要代替f,前置条件肯定要弱于f,但是我不理解这里的post-conditions是指g对后面的条件,还是后面接口所需具备的条件
如果是前者,就应该是强于f,答案选A,如果后者就是弱于F,答案选D

有谁这方面比较熟,帮我解答下?
...全文
46 4 打赏 收藏 转发到动态 举报
写回复
用AI写文章
4 条回复
切换为时间正序
请发表友善的回复…
发表回复
antony0203 2008-06-13
  • 打赏
  • 举报
回复
哈哈,又碰到一个熟人,msn碰不到你,下次可以在这里在线聊
zhengdaolin 2008-06-12
  • 打赏
  • 举报
回复
你等级很高啊
[Quote=引用 2 楼 antony0203 的回复:]
确定吗?这可是考试题阿,错了就没了
最好能讲出点道道来,赫赫
[/Quote]
antony0203 2008-06-11
  • 打赏
  • 举报
回复
确定吗?这可是考试题阿,错了就没了
最好能讲出点道道来,赫赫
M_song 2008-06-11
  • 打赏
  • 举报
回复
应该是A!

62,614

社区成员

发帖
与我相关
我的任务
社区描述
Java 2 Standard Edition
社区管理员
  • Java SE
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告
暂无公告

试试用AI创作助手写篇文章吧