a bug’s life · 2009-11-19 · computer bug? defined as: unwanted property of program code or...

24
A Bug’s Life A bug? Why? What’s it doing? Examples How to ... implement new systems and test for bugs 10-13-09 Susen Rabold

Upload: others

Post on 27-Jul-2020

0 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

A Bug’s Life

• A bug?

• Why? What’s it doing?

• Examples

• How to ... implement new systems and test for bugs

10-13-09

Susen Rabold

Page 2: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

[email protected]

Send assignment 1 to:

Subject: IL - Assignment 1

Page 3: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Student Reps!

Page 4: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Labs now Monday and Wednesday 17.10 - 18.00

Page 5: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Anyone who uses Snow Leopard might be interested in this Slashdot report:

http://apple.slashdot.org/story/09/10/12/2259228/Major-Snow-Leopard-Bug-Said-To-Delete-User-Data

From my quick scan of the story you should be relatively safe if you either don't use a Guest account or you don't keep data in an account with admin privileges.(I always keep admin privilege in a separate account from the one I use for my day to day work; I feel safer that way.)

Page 6: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Computer Bug?

Defined as: Unwanted property of program code or hardwareEspecially when it causes a malfunction

Bugs are common

In 2000 a leaked memo from Microsoft revealed that Windows 2000 was released with 20,000 bugs

Page 7: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Instruction of code: “Do nothing” (e.g. wait for a short time) contained a bug➜ It forgot to prepare the memory for the next instruction ➜ Subsequent instructions go wrong

Early Bug: IEFBR14

The utility program IEFBR14 performs no action other than return a completion code of 0; however, "running" this utility invokes other system components that perform useful tasks

Page 8: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Computer Programs

Computers are excellent at following instructions ➜ Follow your command literally ➜ Can solve problems quickly

Major difficulties are➜ Expressing problems that can be solved by efficient algorithms ➜ Giving the computer the correct instructions ➜Making the program user friendly

Page 9: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Bugs in Programs can lead to

Memory leakForget to release memory after it had been used (e.g.IEFBR14)

Variable not set to the right initial value

Loops that never end

When you have Spelling Mistakes:Usually prevented by the code not compiling (with exceptions)

Page 10: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Patriot missile:Error calculating time since the computer bootedBinary representation of 0.1 seconds limited to 24 bitsOnce activated, navigation system drifts

Examples for What can go

Wrong

Used in Gulf War in 1991

☹ Caused a patriot missile to fail to intercept a Scud missile

☠ 28 people were killed and 100 injured

1.

Page 11: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Ariane 5 Flight 501

http://www.youtube.com/watch?v=2PcoWxTAS40

The bug “Type conversion error” A 64-bit number was converted in a 16-bit number

The value of horizontal position was lost

Ariane self-destructs correctly!!

2.

Page 12: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

On February 11, 2007 twelve raptors flying from Hawaii to Japan were forced to turn back because of a software glitch

Software Bug halts F-22 Flight

Their computers crashed when they crossed the international date line!

They had to turn around an follow their tankers by visual contact back to Hawaii

3.

Page 13: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Mariner 1 should have been a spacecraft on a Venus flyby mission

Mariner 1

Instead a security officer called its destructive abort 293 seconds after its launch

It’s claimed that the bug was a single sign in the code that was wrong:

DO 17 I = 1.100 should have been DO 17 I = 1,100

4.

Page 14: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Ariane: Program was doing the right thing in the wrong rocket - Error in requirement

Recap

Change from summer to winter-time: Program was correctly doing the wrong thing - Error in specification

F-22, Mariner: Programme(r) made a mistake - Error in implementation

Page 15: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Implementation: doing it

Software Design Process

Requirements: statement of the problem

Specification: statement of what to do

➜ Validation

➜ Verification

➜ Design, Testing

Page 16: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

The Chain of Wrong

Fault - an error lurking in the program

Error - fault is triggered

Failure - program takes inappropriate action as a result

Page 17: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Checkpointing: reset system to a stored set of values

Fault Tolerant Systems

Creating fault free systems: Difficult and time-consuming

Software: ·Keep multiple copies of the data (back-up) ·Identify and monitor critical variables

Page 18: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Analyse the problem

Software Design 1: Waterfall Model

➜ Design solution architecture

➜Design solution details

➜Write program code

➜Maintain code

➜Test code

Page 19: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

At each stage Design➝Prototype➝Evaluate➝Redesign

Software Design 2: Iterative Model

All stages developed concurrently, with feedback between all stages

Advantages:✓ User-defined from start✓ Performance can be measured much earlier Problems:✗ Time consuming ✗ Requires good management

Page 20: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Iterative Model

Page 21: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Dedicated website: www.betanews.com

Beta Testing

Refers to 2nd phase of software testing

Sample of intended audience test the product

It works for the programmer, does it work for the user?

Provides a “preview” of software

Page 22: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

High staff turnover

IT Systems Development

Difficult initial problem analysisIT systems supplement existing practice

Easy to be over-ambitious

Goals can changePractical difficulty of establishing user’s goals

Changing technology

Technology is quickly obsolete Limited experience with new technology

ComplexityLarge programs use lots of code

Page 23: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

·Monitoring calls with business ·Schedule of events checking ·Formal checkpoints ·Business checkout·Incident management. Formal control of any problems·Go / No Go decision ·Ensure all in place for staff to use

During Implementation

Page 24: A Bug’s Life · 2009-11-19 · Computer Bug? Defined as: Unwanted property of program code or hardware Especially when it causes a malfunction Bugs are common In 2000 a leaked

Monitoring of ongoing system performance: •Are the transactions being processed correctly? •How is the business getting on with the system? •Has it been well received? •Is everyone able to use it easily? •Any further action needed?

Post Implementation

Analysis of any problem: •What was their problem? •What was done to resolve them? •Are any further fixes needed?