軟件測試背景

以下內容大部分來自 ron-patton-software-testing

  1. 軟件測試背景

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.

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章