SYSNGS BUGS - definition, lifecycle and what can I do with them as a developer

hanochaloni 7 views 26 slides Sep 29, 2024
Slide 1
Slide 1 of 26
Slide 1
1
Slide 2
2
Slide 3
3
Slide 4
4
Slide 5
5
Slide 6
6
Slide 7
7
Slide 8
8
Slide 9
9
Slide 10
10
Slide 11
11
Slide 12
12
Slide 13
13
Slide 14
14
Slide 15
15
Slide 16
16
Slide 17
17
Slide 18
18
Slide 19
19
Slide 20
20
Slide 21
21
Slide 22
22
Slide 23
23
Slide 24
24
Slide 25
25
Slide 26
26

About This Presentation

SYSNGS BUGS - definition, lifecycle and what can I do with them as a developer?


Slide Content

BUGS

Personal story My 3,000,000 debt

The Pacman Bug: A Case Study Pac-Man was released in 1980 and became a cultural phenomenon. The game's code had a bug that caused the right side of the screen to become garbled after level 256. This bug was caused by an integer overflow, a common programming error. The bug was never fixed in the original arcade version, becoming a unique feature of the game. The "kill screen" is now a well-known part of Pac-Man's legacy.

When Software Bugs Get Real In September 1997, the USS Yorktown experienced a critical software error. The ship's propulsion and steering systems shut down, leaving it dead in the water. The root cause was determined to be a divide by zero error in the ship's control software. This incident highlighted the potential risks of software bugs in complex systems. It also underscored the importance of thorough testing and validation in software development.

Infamous Software Bugs Year 2000 Problem (Y2K): Many programs used two-digit year representations, causing potential issues when the year 2000 arrived. Ariane 5 Flight 501 (1996): A software bug caused the rocket to self-destruct shortly after launch, resulting in a $370 million loss. Therac-25 Radiation Therapy Machine (1985-1987): A software bug caused the machine to overdose patients with radiation, leading to several deaths. Mariner 1 Space Probe (1962): A missing hyphen in the guidance software caused the probe to veer off course and self-destruct. Knight Capital Group Trading Loss (2012): A software bug caused the firm to lose $440 million in 30 minutes due to unintended trades.

Software Bugs: Explained Software bugs are errors or flaws in a computer program's code. They can cause unexpected behavior, crashes, or security vulnerabilities. Bugs can be introduced at any stage of software development. Common causes include human error, communication gaps, and complex code. Testing and debugging are essential for identifying and fixing bugs.

Types of Software Bugs Functional bugs: Errors in program functions or features. Performance bugs: Issues with speed, stability, or resource usage. Usability bugs: Problems with the user interface or experience. Security bugs: Vulnerabilities that can be exploited by attackers. Compatibility bugs: Conflicts with other software or hardware.

Bug Detection Time vs. Cost The cost to fix a bug increases exponentially the later it's detected. A bug found during the implementation phase is 6X more expensive than one found in design. If a bug makes it to production, it can be 15X more expensive than if found in design. Shift-left testing emphasizes early bug detection to reduce costs.

Lifecycle

How to do it right?

Writing an Effective Bug Report Use a clear and concise summary in the title. Provide steps to reproduce the bug. Include the expected and actual behavior. Specify the environment and any relevant attachments. Assign the appropriate priority and severity level.

Perfect Bug Report: A Case Study Clear and concise title: "Button not working on homepage" Steps to reproduce: 1. Go to homepage 2. Click button 3. Observe no response Expected behavior: Button should open a new page Actual behavior: Nothing happens when button is clicked Environment: Chrome browser on Windows 10 Attachments: Screenshot of error message Priority: High

As a developer - I simply don’t care

As a developer - I simply do care Or else I will get fired for doing a poor job / Fail my customers / fail any target or goal I have in life

Planning > Coding Weeks of coding can prevent hours of planning

Think about this point for a second

Planning > Coding Be sure you are building the right thing Be sure you are building it in the right way Be sure about when you are “done” Have it reviewed prior to being implemented

Bug Prevention Strategies Static Analysis: Use tools to analyze code for potential errors before running it. Dynamic Analysis: Test code during execution to identify unexpected behavior or crashes. Code Reviews: Have other developers review code to catch errors early on. Unit Testing: Write tests for individual code units to ensure they work as expected. Test-Driven Development (TDD): Write tests before writing code to guide development and prevent bugs.

Bug Prevention - Coding Tactics Input validation and sanitization: Check user input for validity and potential security risks. Error handling and exception management: Anticipate and gracefully handle errors to prevent crashes. Defensive programming: Write code that is robust and can handle unexpected inputs or conditions. Modularity and encapsulation: Break down code into smaller, well-defined modules to isolate potential issues. Code comments and documentation: Explain the code's purpose and logic to improve understanding and maintainability. Version control: Track changes to code and revert to previous versions if necessary.

Thank you

Planning > Coding Be sure you are building the right thing Be sure you are building it in the right way Be sure about when you are “done” Have it reviewed prior to being implemented