登陆注册
3765300000035

第35章 Software Engineering(5)

Separately query the database to check that the zero balance has been posted.

Exit the program with File->Exit.

Design 2

Setup: initialize the balance with a positive value.

Procedure:

Start the program on that account.

Withdraw all the money from the account using the 'all' button.

It's an error if the transaction happens without a confirmation popup.

Immediately thereafter:

-- Expect a $0 balance to be displayed.

-- Independently query the database to check that the zero balance has been posted.

The first design style has these advantages:

The test will always be run the same way. You are more likely to be able to reproduce the bug. So will the programmer.

It details all the important expected results to check. Imprecise expected results make failures harder to notice. For example, a tester using the second style would find it easier to overlook a spelling error in the confirmation popup, or even that it was the wrong popup.e

Unlike the second style, you always know exactly what you've tested. In the second style, you couldn't be sure that you'd ever gotten to the Withdraw dialog via the toolbar. Maybe the menu was always used. Maybe the toolbar button doesn’t work at all.

By spelling out all inputs, the first style prevents testers from carelessly overusing simple values. For example, a tester might always test accounts with $100, rather than using a variety of small and large balances. (Either style should include explicit tests for boundary and special values.)x

However, there are also some disadvantages:

The first style is more expensive to create.o

The inevitable minor changes to the user interface will break it, so it's more expensive to maintain.

Because each run of the test is exactly the same, there's no chance that a variation in procedure will stumble across a bug.

It's hard for testers to follow a procedure exactly. When one makes a mistake -- pushes the wrong button, for example -- will she really start over?

Detail in the expected results is less problematic than in the test procedure, but too much detail can focus the tester's attention too much on checking against the script he's following. That might encourage another classic mistake: not noticing and exploring "irrelevant" oddities. Good testers are masters at noticing "something funny" and acting on it.

【New Words】

skimp

节约使用

elaborate

精心制作,详细阐述

omission

冗长

initialize

初始化

popup

弹出

procedure 程序,手续

confirmation 证实,确认,批准

script

手稿,原本,剧本

5.3 Software Maintenance

The term "software maintenance" is used to describe the software engineering activities that occur following delivery of a software product to the customer. The maintenance phase of the software life cycle is the time period in which a software product performs useful work. Typically, the development cycle for a software product spans 1 or 2 years, while tile maintenance phase spans 5 to 10 years.

Maintenance activities involve making enhancements to software products, adapting products to new environments, and correcting problems. Software product enhancement may involve providing new functional capabilities, improving user displays and modes of interaction, upgrading external documents and internal documentation, or upgrading the performance characteristics of a system. Adaptation of software to a new environment may involve moving the software to a different machine, or for instance, modifying the software to accommodate a new telecommunications protocol or an additional disk drives. Problem correction involves modification and revalidation of software to correct errors. Some errors require immediate attention, some can be corrected on a scheduled, periodic basis, and others are known but never corrected.

It is well established that maintenance activities consume a large portion of the total life-cycle budget. It is not uncommon for software maintenance to account for 70 percent of total software life cycle costs (with development requiring 30 percent). As a general rule of thumb, the distribution of effort for software maintenance includes 60 percent of the maintenance budget for enhancement, and 20 percent each for adaptation and correction.

If maintenance consumes 70 percent of the total life cycle effort devoted to a particular software product, and if 60 percent of maintenance goes to enhancing the product, then 42 percent of the total life cycle effort for that product is dedicated to product enhancement. Given this perspective, it is apparent that the product delivered to the customer at the end of the development cycle is only the initial version of the system. Some authors have suggested that the appropriate life-cycle model for software is development→evolution→evolution→evolution…

This perspective makes it apparent that the primary goal of software development should be production of maintainable software systems. Maintainability, like all high-level quality attributes, can be expressed in terms of attributes that are built into the product. The primary product attributes that contribute to software maintainability are clarity, modularity, and good internal documentation of the source code, as well as appropriate supporting documents.

It should also be observed that software maintenance is a microcosm of the software development cycle. Enhancement and adaptation of software reinitiate development in the analysis phase, while correction of a software problem may reinitiate the development cycle in the analysis phase, the design phase, or the implementation phase. Thus, all of the tools and techniques used to develop software are potentially useful for software maintenance.

同类推荐
  • 美国名家短篇小说赏析(高级)

    美国名家短篇小说赏析(高级)

    本书精选了八位美国文学巨匠的8篇美国短篇小说的精华之作,每篇文章前有简短的引言,文中还附有编者的评注和分析及作者简介。
  • I Want to Go to School 为了那渴望的目光

    I Want to Go to School 为了那渴望的目光

    《为了渴望的目光》在取得大量第一手资料和真实感人实例的基础上,对中国希望工程的20年历程进行了全景式扫描和总结,深刻地展现了希望工程20年来的丰硕成果。
  • 那些光影飞华的魅惑(每天读一点英文)

    那些光影飞华的魅惑(每天读一点英文)

    《那些光影飞华的魅惑》由我的美丽日记、我的健康我做主、时尚达人、勇闯天涯、摩登时代等篇目组成,让你在体味时尚、逐赶潮流中,不知不觉提升英语能力。
  • 时间机器

    时间机器

    《时间机器》是英国科幻小说大师H.G.威尔斯最早获得成功的一部科幻小说,也是他久负盛名的科幻作品之一。本书讲述了一个时间旅行家发明了一种能穿越时空的时间机器,并乘坐此机器穿越到公元802701年。在未来世界里,他发现人类正逐渐走向没落,并互相残杀。这难道是人类的终极命运?本书将“十九世纪阶级斗争和人类进化相结合”,警示未来,发人深省。
热门推荐
  • Beowulf

    Beowulf

    本书为公版书,为不受著作权法限制的作家、艺术家及其它人士发布的作品,供广大读者阅读交流。汇聚授权电子版权。
  • 真皮书包

    真皮书包

    尹守国,2006年开始小说创作,发表中短篇小说70多万字,作品多次被《新华文摘》、《小说选刊》、《北京文学中篇小说月报》等选载,中国作家协会会员,辽宁省作协签约作家。
  • 径中径又径

    径中径又径

    本书为公版书,为不受著作权法限制的作家、艺术家及其它人士发布的作品,供广大读者阅读交流。汇聚授权电子版权。
  • 叶毅之圣灵阁

    叶毅之圣灵阁

    叶毅一手创建的圣灵阁能否统一大陆在重重危难中能否成功一剑霜寒十四洲叶毅能不能打的整个灵武大陆的势力臣服于他
  • 七转天轮剑

    七转天轮剑

    曾经的天才,现在的废物;唯一一位引起悟剑崖剑潮,却只能佩一把无属性的破剑
  • 伊索寓言(语文新课标课外必读第一辑)

    伊索寓言(语文新课标课外必读第一辑)

    国家教育部颁布了最新《语文课程标准》,统称新课标,对中、小学语文教学指定了阅读书目,对阅读的数量、内容、质量以及速度都提出了明确的要求,这对于提高学生的阅读能力,培养语文素养,陶冶情操,促进学生终身学习和终身可持续发展,对于提高广大人民的文学素养具有极大的意义。
  • 性理字训

    性理字训

    本书为公版书,为不受著作权法限制的作家、艺术家及其它人士发布的作品,供广大读者阅读交流。汇聚授权电子版权。
  • 想着初恋的一百二十天

    想着初恋的一百二十天

    我叫夜七,是个孤儿,关于我的故事,要从十三岁那年暑假讲起......故事很长,有你很暖。
  • 雪球专刊第043期:赚钱必须要懂的事儿

    雪球专刊第043期:赚钱必须要懂的事儿

    外科博士郭一刀:拟入市前期金额10w,2年内可增至50w(上述金额可长期不动)。家庭成员工作固定,收入稳中有升,无购房压力,有医疗保障,2年内无大笔支出规划,可应对小规模突发事件(地震塌楼之类的伤不起)。平时不具备盯盘琢磨财报等的时间和精力,心态较平和,对财务不敏感。拟中长线投入,2—3年不操作,5年8年的长期持有(哪怕被套)都可以,既往有过其他领域多次投入需5年以上才能回本回报的投资经历。预期目标:比定存强就行,跑赢余额宝之类的足矣。不求发家致富,但求稳定保值。
  • 治安管理与执法监督

    治安管理与执法监督

    治安管理违法行为在我们日常生活中很常见,这些行为严重扰乱了社会秩序与公共安全。而事实上,治安管理违法行为的产生很大程度上是因为老百姓不懂法。为了让老百姓知晓哪些行为是治安违法行为,本书以浅显生动的语言,精选大量老百姓生活中常见的典型案例,系统讲解日常生活中常见的各种治安违法行为。目的在于提高老百姓的守法意识,避免违法行为,并能利用《治安管理处罚法》保护自己的权益。