以下内容大部分来自 ron-patton-software-testing
- 软件测试背景
Bug 的起源
In 1947, computers were big, room-sized machines operating on mechanical relays and glowing vacuum tubes. The state of the art at the time was the Mark II, a behemoth being built at Harvard University. Technicians were running the new computer through its paces when it suddenly stopped working. They scrambled to figure out why and discovered, stuck between a set of relay contacts deep in the bowels of the computer, a moth(飞蛾). It had apparently flown into the system, attracted by the light and heat, and was zapped by the high voltage when it landed on the relay.
The computer bug was born. Well, okay, it died, but you get the point.
Infamous Software Error Case Studies
软件bug如何影响我们的生活?
Software is everywhere. However, it’s written by people—so it’s not perfect
Disney’s Lion King, 1994 –1995
It turns out that Disney failed to properly test the software on the many different PC models available on the market. The software worked on a few systems—likely the ones that the Disney programmers used to create the game—but not on the most common systems that the general public had.
事实证明,迪士尼未能在市场上许多不同的PC型号上正确测试该软件。 该软件可以在少数系统上运行(可能是迪士尼程序员用来创建游戏的系统),但不能在公众拥有的最常见系统上运行。
Intel Pentium Floating-Point Division Bug, 1994
NASA Mars Polar Lander, 1999
The lander was tested by multiple teams. One team tested the leg fold-down procedure and another the landing process from that point on. The first team never looked to see if the touch-down bit was set—it wasn’t their area; the second team always reset the computer, clearing the bit, before it started its testing.
Both pieces worked perfectly individually, but not when put together.
着陆器由多个小组测试。 一个小组测试了腿部折叠程序,另一个小组测试了从那时起的着陆过程。 第一队从来没有看过触地点是否是s 这不是他们的区域;第二个团队总是在开始测试之前重置计算机,清除位。 这两件作品各自都很完美,但拼在一起时却不行。
Patriot Missile Defense System, 1991爱国者导弹防御系统
A small timing error in the system’s clock accumulated to the point that after 14 hours, the tracking system was no longer accurate.
系统时钟中的一个小计时误差累积到14小时后,跟踪系统不再精确。
The Y2K (Year 2000) Bug, circa 1974 千年虫
What Is a Bug?
Software Bug: A Formal Definition
软件规格说明书
A product specification, sometimes referred to as simply a spec or product spec, is an agreement among the software development team.It defines the product they are creating, detailing what it will be, how it will act, what it will do, and what it won’t do.
This agreement can range in form from a simple verbal understanding to a formalized written document.
a software bug occurs when one or more of the following five rules is true:
1. The software doesn’t do something that the product specification says it should do.
2. The software does something that the product specification says it shouldn’t do.
3. The software does something that the product specification doesn’t mention.
4. The software doesn’t do something that the product specification doesn’t mention but should.
5. The software is difficult to understand, hard to use, slow, or—in the software tester’s eyes—will be viewed by the end user as just plain not right.
Why Do Bugs Occur?
Bugs are caused for numerous reasons, but the main cause can be traced to the specification.
spec 导致bug的原因
In many instances a spec simply isn’t written.
the spec isn’t thorough enough, it’s constantly changing, or it’s not communicated well to the entire development team.
Planning software is vitally important. If it’s not done correctly, bugs will be created.
design 导致bug的原因
This is where the programmers lay out their plan for the software. Compare it to an architect creating the blueprints for a building.
Bugs occur here for the same reason they occur in the specification.
It’s rushed, changed, or not well communicated.
Code 导致bug
software’s complexity
poor documentation (especially in code that’s being updated or revised 修改), schedule pressure
just plain dumb mistakes 愚蠢的错误
many bugs that appear on the surface to be programming errors can really be traced to specification and design errors.
The Cost of Bugs
The cost to fix bugs increases dramatically over time.
What Exactly Does a Software Tester Do?
The goal of a software tester is to find bugs, find them as early as possible, and make sure they get fixed
What Makes a Good Software Tester?
Here’s a list of traits that most software testers should have:
• They are explorers. Software testers aren’t afraid to venture into unknown situations. They love to get a new piece of software, install it on their PC, and see what happens.
• They are troubleshooters. Software testers are good at figuring out why something doesn’t work. They love puzzles.
• They are relentless. Software testers keep trying. They may see a bug that quickly vanishes or is difficult to re-create. Rather than dismiss it as a fluke, they will try every way possible to find it.
• They are creative. Testing the obvious isn’t sufficient for software testers. Their job is to think up creative and even off-the-wall approaches to find bugs.
• They are (mellowed) perfectionists. They strive for perfection, but they know when it becomes unattainable and they’re OK with getting as close as they can.
• They exercise good judgment. Software testers need to make decisions about what they will test, how long it will take, and if the problem they’re looking at is really a bug.
• They are tactful and diplomatic.(机智和外交) Software testers are always the bearers of bad news. They have to tell the programmers that their baby is ugly. Good software testers know how to do so tactfully and professionally and know how to work with programmers who aren’t always tactful and diplomatic.
• They are persuasive 有说服力. Bugs that testers find won’t always be viewed as severe enough to be fixed. Testers need to be good at making their points clear, demonstrating why the bug does indeed need to be fixed, and following through on making it happen.