Two Cautionary Tales โ ูุตุชูู ุจูุจุชุฏูุง ุจููู ุงูู ููุฌ
ููู ุฏูุชูุฑ ุงูุฑู ูู ุจูุจุฏุฃ ุจูุตุชูู ููุงุฑุซุ ุนูุดุงู ูุซุจุช ุฅู ุงูู Software ู ุด ู ุฌุฑุฏ ููุฏ โ Software bugs ุจุชูุชู ูุจุชูููุฑ.
Ariane 5 ุตุงุฑูุฎ ูุถุงุก ุฃูุฑูุจู ุชุงุจุน ูู ESA (European Space Agency). ุจุนุฏ ุงูุฅููุงุน ุจู 37 ุซุงููุฉ ููุทุ ุงูุตุงุฑูุฎ ุฎุฑุฌ ุนู ู
ุณุงุฑู ูุงููุฌุฑ ููู ุบููุงูุง ุงููุฑูุณูุฉุ ูุถุงุน ุญูุงูู $370 ู
ูููู.
ุงูุณุจุจุ ุณุทุฑ ููุฏ ูุงุญุฏ. ุชุญููู ู
ู 64-bit float ูู 16-bit signed integer ุจุฏูู ูุญุต ููู overflow. ุงูุณุฑุนุฉ ุงูุญููููุฉ ููุตุงุฑูุฎ ูุงูุช ุฃูุจุฑ ู
ู ุงููู ููุฏุฑ ูุชุญุท ูู 16-bit int.
-- Horizontal velocity bias as measured by sensor
-- is converted to a 16 bit int WITHOUT checking
P_M_DERIVE(T_ALG.E_BH) :=
UC_16S_EN_16NS (TDB.T_ENTIER_16S
((1.0/C_M_LSB_BH) *
G_M_INFO_DERIVE(T_ALG.E_BH)));
public class Overflow {
public static void main(String[] args) {
int x;
double d = 5000000000.0;
x = (int) d;
System.out.println("d=" + d
+ " / x=" + x
+ " / x+1=" + (x+1));
}
}
// Output:
// d=5.0E9 / x=2147483647 / x+1=-2147483648
โถ๏ธ ุงุถุบุท ุงูุฒุฑุงุฑ ูุดูู ุงูู overflow ุจูุญุตู ุงุฒุงู:
ุฃุฒูุงุฌ ูุจุงุฑ ูู ุงูุณู ุชุงุจุนูุง ุชุนููู ุงุช GPS ุนูู ุทุฑูู ุถูู ูุฎุทุฑุ ูุงูุชูู ุงูู ุทุงู ุจุณูุงุฑุชูู ูู ูุงุฏู/ู ูุทูุฉ ูุนุฑุฉ ุจุฏูู ุฃู ูุณููุฉ ูููุฌุงุฉ. ูุงุณ ู ุงุชุช ุจุณุจุจ ุงูู GPS ุจููุฏููู ูู ุทุฑู ุบูุท.
- Software failures = real-world cost โ ู ุด ู ุฌุฑุฏ bug ูู ุงูู terminalุ ุฏู ู ู ูู ูููู ูููุณ ูุฃุฑูุงุญ.
- Testing is critical โ ูู ูุงู ููู ุงุฎุชุจุงุฑ ูููุณุ ุงูู overflow ูุงู ุงุชูุงูู ูุจู ุงูุฅุทูุงู.
- Software Engineering ู ูุฌูุฏ ุนูุดุงู ูุฏู โ ู ููุฌ ู ูุธู ุนูุดุงู ูููู ุงูููุงุฑุซ ุฏู.
Software Chronic Crisis โ ุฃุฒู ุฉ ุงูู Software
ุงูู ุดุงูู ุงูู ุฒู ูุฉ ูู ุตูุงุนุฉ ุงูุจุฑู ุฌูุงุช: ู ุดุงุฑูุน ุจุชูุดูุ ู ูุงุนูุฏ ุจุชุชุฃุฎุฑุ ุชูุงููู ุจุชุฒูุฏุ ููุธุงุฆู ูุงูุตุฉ.
ุงูู Software Crisis ุจูุชุถู ู (ูุฏู ุงููู ุจูุชุณุฃู ุนููู ูู ุงูุงู ุชุญุงู):
- โ Software fails to serve its purpose, or may cause harm.
- โ Project delivers reduced functional deliverables (ุงูู ุดุฑูุน ุจูุชุณูู ูุธุงูู ูุงูุตุฉ).
- โ Project cost overruns and schedule delays (ุชูููุฉ ุฃูุจุฑ ูู ูุงุนูุฏ ู ุชุฃุฎุฑุฉ).
break statement in C switch โ ุงูููุฏ ูุงู ุจููุน ูู ุงูู case ุงูุชุงููุฉ ุจุฏูู ู
ุง ูุฎุฑุฌ. ููุดูู ุงูููุฏ ุงูุฃุตูู ุชุญุช.ุงูู
ูู
ุชุดูู ุงูููุฏ ุฏู ูุชุนุฑู ุงูุณุทุฑ ุงููู ููู ุงูุจู โ ุงูุณุคุงู ุฏู ุงุชุณุฃู ูู ุงู
ุชุญุงู Winter 2021 Q1.04.
ุงูู
ุดููุฉ: "The program should NOT have dropped out of the switch statement if 'ring write buffer is not empty'". ูุนูู ุงูู break ูู ุงูู
ูุงู ุงูุบูุท.
1 while (ring receive buffer not empty and side buffer not empty) DO
2 Initialize pointer to first message in side buffer
3 get copy of buffer
4 switch (message)
5 case (incoming_message):
6 if (sending switch is out of service) DO
7 if (ring write buffer is empty) DO
8 send "in service" to status map
9 else
10 break // โ ๏ธ THE BUG โ drops out of switch instead of just out of if!
11 END IF
12 process incoming message
13 break
14 END SWITCH
15 do optional parameter work
break ูู C/C++ ุจุชุฎุฑุฌ ู
ู ุฃูุฑุจ switch ุฃู loop. ููุง ุงูู
ุจุฑู
ุฌ ูุงู ูุตุฏู ูุฎุฑุฌ ู
ู ุงูู if ุจุณ ุงููุนููุงู ุฎุฑุฌ ู
ู ุงูู switch ูููุ ูู
ุง ุนู
ูุด process incoming message ูุจุฏุฃ ุงูู system ูุชุนุทูู.No Silver Bullet โ ู ููุด ุญู ุณุญุฑู
Brooks (1986): ู ููุด technology ูุงุญุฏุฉ ูุชุญู ูู ู ุดุงูู ุงูู software. ูุงุฒู ูุชุนุงู ู ู ุน ุทุจูุนุฉ ุงูู software ุงููู ุจุชู ูุฒู.
ูู ูุชุงุจ Brooks ุงูุดููุฑุ ุงูู "werewolves" ูู ุงูู ุดุงุฑูุน ุงููู ุจุชุจุงู ุนุงุฏูุฉ ูู ุงูุฃููุ ููู ุจุนุฏูู ุจุชุชุญูู ูู ุดุงูู ู ุนูุฏุฉ ูู ุฑุนุจุฉ โ ุฒู ุงูุฅูุณุงู ุงููู ุจูุชุญูู ูุฐุฆุจ ูุฌุฃุฉ.
ุงูู Software ุจุทุจุนู ุจูุชุบูุฑ ูุชูุฑ โ ูุฏู ููู ู ู ูุฒุงุช ูุนููุจ:
- โ It has advantages and disadvantages.
- โ NOT: "software is intangible and lacks a physical presence" (ุฏู concept ุชุงูู).
- โ NOT: "software must adapt to existing hardware interfaces" (ุฏู compatibility ู ุด changeability).
- โ It often leads to frequent modifications and deviations from the initial design.
ู
ู ุงู
ุชุญุงู Winter 2023 Q1.02 โ ุงูู ุงูุฃุณุจุงุจ ุงูุญููููุฉ ููุดู ุงูู softwareุ
| ุงูุณุจุจ | ุตุญ / ุบูุท | ุงูุณุจุจ |
|---|---|---|
| Poor management decisions or lack of decisions | โ ุตุญ | ุงูู ุฏูุฑ ุงููู ู ุด ุจูุงุฎุฏ ูุฑุงุฑุงุช ุฃู ุจูุงุฎุฏูุง ุบูุท = ูุงุฑุซุฉ. |
| Poor software development practices | โ ุตุญ | ููุฏ ูุญุดุ ู ููุด testingุ ู ููุด version control = ูุดู ู ุถู ูู. |
| Limited budget for the software project | โ ุบูุท | ู ูุฒุงููุฉ ู ุญุฏูุฏุฉ ู ุด ูู ุงูุณุจุจ ุงูุฑุฆูุณู โ ู ู ูู ุชุนู ู ููุฏ ู ู ุชุงุฒ ุจู ูุฒุงููุฉ ููููุฉ. |
| Overconfidence in the software performance | โ ุตุญ | "ูู ุญุงุฌุฉ ุดุบุงูุฉ ุนูู ุฌูุงุฒู" โ ูู ุงูุฅูุชุงุฌ ุจุชูุฌุฑ. |
What is Software Engineering?
ุชุนุฑููุงุช ุฑุณู ูุฉ ู ูู ุฉ ุฌุฏุงู ููุงู ุชุญุงูุงุช ุงููุธุฑูุฉ + ูู ุญุฉ ุชุงุฑูุฎูุฉ.
ุงูู Software ู ุด ุจุณ computer programs โ ูู:
- Programs (ุงูููุฏ ููุณู)
- Documentation (ุงูุชูุซูู)
- Configuration data (ุงูุฅุนุฏุงุฏุงุช ุงููู ุจุชุดุบููู ุตุญ)
ุชุทุจูู ุงูู ุนุฑูุฉ ุงูุนูู ูุฉ ูุงูุชูููุฉ ู ุน ุงูู ูุงุฑุฏ ุงูููุฒูุงุฆูุฉ ูุชุตู ูู ูุฅูุชุงุฌ materials, structures, machines, systems ุชุญูู ูุฏู ู ุญุฏุฏ ุชุญุช ูููุฏ ู ุนููุฉ.
3 ุชุนุฑููุงุช ูุงุฒู ุชุญูุธูู :
- IEEE 610.12: "Application of a systematic, disciplined, quantifiable approach to the development, operation, and maintenance of software."
- Sommerville: "Designing, building and maintaining large software systems."
- Parnas: "Multi-person construction of multi-version software."
- ุงูู ุตุทูุญ ุงุชูุงู ุดููุฉ ู ุฑุงุช ูู ุงูู 1950s ู 1960s.
- ุงุชุดูุฑ ูู NATO Software Engineering Conference, 1968.
- ุงูู NATO ูู ุงููู ุฎูู ุงูู field ูุจูู ู ุนุชุฑู ุจูู ุฏูููุงู.
ูู ูุงุญุฏ ุนูุฏู ุชุนุฑูู ู ุฎุชูู ูู "ุงูู Software ุงูู ู ุชุงุฒ":
๐ค Customer
ุจูุญู ุงูู ุดููุฉ ุจุชูููุฉ ู ุนูููุฉ (ููุช + ู ูุงุฑุฏ).
๐ User
ุณูู ุงูุชุนูู ุ ุงุณุชุฎุฏุงู ู efficientุ ูุจูุฎููุต ุงูุดุบู.
๐จโ๐ป Developer
ุณูู ุงูุชุตู ูู ูุงูุตูุงูุฉุ ูุชู ูุดุฑู ุจูุฌุงุญ.
๐ Manager
ุจูุจูุน ุฃูุชุฑ ููุฑุถู ุงูุนู ูุงุกุ ูุชูููุชู ูู ุงูุชุทููุฑ ููููุฉ.
Coder vs Hacker vs Programmer vs Software Engineer
4 ุฃููุงุจ ุงููุงุณ ุจุชุฎูุท ุจูููุง โ ููุง ุงููุฑู ุงูุญูููู.
๐ ๏ธ Coder
ุจููุฏุฑ ูุฎูููู ูุดุชุบู... ุจุณ ู ุด ููุจูู ุดููู ุฌู ูู. ุงูู code ุจูููู ุจุฏูู structure ุฃู design.
๐ฅท Hacker
low-level expertุ ุนูุฏู ููู ุนู ูู ูู ูุทูุฉ ู ุนููุฉ ุจุณ. ุดุงุทุฑ ููู ู ุชุฎุตุต ุฌุฏุงู.
๐ป Programmer
ุจููุชุจ ููุฏ ูุจูููู algorithms. ุบุงูุจุงู ุจูุดุชุบู ููุญุฏู ูุจูุดุชุบู ูููุณ.
๐ฏ Software Engineer
ุฃูุถู generalist โ ุจูุณุชุฎุฏู systems ููุบุงุช ู ุฎุชููุฉ ููุฎููููู ูุชููู ูุง ู ุน ุจุนุถ. True professionals: ุจูุดุชุบู ู ุน ุงููุงุณ ูุจูุชูุงุตู ูููุณ.
Key Stages of Producing Software
5 ู ุฑุงุญู ุฃุณุงุณูุฉ + 4 ุฃูุดุทุฉ ุฏุงุนู ุฉ. ุญูุธูุง ุจุชุฑุชูุจ ู ู ุชุญุช ูููู.
ูู ู ุฑุญูุฉ output ุจุชุณุชุฎุฏู ู ุงูู ุฑุญูุฉ ุงููู ุจุนุฏูุง. ุงูุชุฑุชูุจ ู ู ุชุญุช (analysis) ูููู (test):
SWEBOK โ Software Engineering Body of Knowledge
ุงูู ุฑุฌุน ุงูุฑุณู ู ุงููู ุจูุญุฏุฏ ุงูู ุฌุงูุงุช ุงููู ูุงุฒู ุฃู software engineer ูููู ูุงูู ูุง.
| Version | Year | KAs added | Total |
|---|---|---|---|
| SWEBOK v3 (initial) | 2004 | 10 original KAs | 10 |
| SWEBOK 2013 | 2013 | +5 foundations KAs | 15 |
| SWEBOK 2024/25 | 2024/25 | +3 (Architecture, Security, Operations) | 18 |
๐ต ุงูู 10 KAs ุงูุฃุตููุฉ (2004)
๐ก +5 ุฃุถููุช ูู SWEBOK 2013
๐ข +3 ุฃุถููุช ูู SWEBOK 2024/25
Exam Question Bank โ Lecture 1
8 ุฃุณุฆูุฉ ุญููููุฉ ู ู ุงู ุชุญุงูุงุช 2021 โ 2025 ยท ุงุฎุชุงุฑ ุฅุฌุงุจุชู ูุงุถุบุท Check Answers
break statement in C switch statementbreak ูู ู
ูุงู ุบูุท ุฏุงุฎู elseุ ูุงูู control ุจุชุฏุฎู ูู case ุชุงูู ุจุฏูู ู
ุง ููู
ูู ู
ุนุงูุฌุฉ ุงูู message ุงูุญุงูู.
break ูู ุงูุณุทุฑ 10 ุจูุฎุฑุฌ ู
ู ุงูู switch ุจุงููุงู
ู ู
ุด ุจุณ ู
ู ุงูู if. ุงููู ูุงู ุงูู
ูุฑูุถ ูุญุตู: ุงุณุชู
ุฑุงุฑ ูู ู
ุนุงูุฌุฉ ุงูู incoming message ุจุนุฏ ุงูู else. ุจุฏูุงู ู
ู ูุฏูุ ุงุชุนู
ู break ูุฎุฑุฌ ู
ู ูู ุญุงุฌุฉ.
I. Poor management decisions or lack of decisions
II. Poor software development practices
III. Limited budget for the software project
IV. Overconfidence in the software performance
I. It has advantages and disadvantages
II. It means that software is intangible and lacks a physical presence
III. It means that software must adapt to existing hardware interfaces
IV. It often leads to frequent modifications and deviations from the initial design
Cheat Sheet โ ูุฑูุฉ ู ุฐุงูุฑุฉ ุณุฑูุนุฉ
ูู ุงููู ู ุญุชุงุฌ ุชูุชูุฑู ูู ูููุฉ ุงูุงู ุชุญุงู โ ุฃุฑูุงู ุ ุชูุงุฑูุฎุ ุชุนุฑููุงุช.
๐ Software Failures Timeline
break in C switch โ line 10. 70M calls lost, $1B.๐ SWEBOK Quick Facts
๐ง Key Definitions
๐ Software Crisis โ ...
Rapid Revision โ ู ุฑุงุฌุนุฉ ุณุฑูุนุฉ
Flashcards ยท Common Mistakes ยท What the doctor loves to ask
๐ด ุงุถุบุท ุนูู ุฃู flashcard ุนูุดุงู ุชุดูู ุงูุฅุฌุงุจุฉ
break in C switch (line 10)๐จ Common Mistakes โ ุฃุฎุทุงุก ุจุชุชุนู ู ูุชูุฑ ูู ุงูุงู ุชุญุงู
โญ What Dr. El-Ramly Loves to Ask
- Famous software failure + ุณุจุจูุง (AT&T / Ariane / Patriot / Therac) โ ู ุถู ููุฉ ูู ูู ุงู ุชุญุงู.
- ุชุนุฑูู Software Crisis ุฃู "ุงูู ู ุด ุฌุฒุก ู ูู" โ ู ุชูุฑุฑ ุฌุฏุงู.
- ุฃุณุจุงุจ ูุดู ุงูู software โ ุงุฎุชูุงุฑ ุงูู I/II/III/IV ุงูุตุญ.
- NATO 1968 ุฃู "ู ุชู ุธูุฑ ู ุตุทูุญ SE" โ ูุฏ ููุฌู.
- ุชุนุฑููุงุช SE (IEEE / Sommerville / Parnas) โ ุงุญูุธูู ุจู keywords.