---
title: "Nature of bugs and preventive steps"
subject: "Instrumentation II"
chapter: 9
key: "semester_5/instrumentation_ii:bugs-prevent"
source: https://www.bctengineer.com/q/semester_5/instrumentation_ii/bugs-prevent
site: BCT Engineering
---

# Nature of bugs and preventive steps

Instrumentation II · Chapter 9: Software For Instrumentation And Control Applications

- Asked in: 2068 Chaitra, 6 marks; 2079 Baisakh, 4 marks (asked 2 times)
- Answer checked by Claude Sonnet 5.5 on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/instrumentation_ii/bugs-prevent
- Whole chapter: https://www.bctengineer.com/md/semester_5/instrumentation_ii/chapter-9

## Question

In the software development process, proper planning is essential in delivering the finished product to the client. Equally it is important that bugs have to be removed from the product. Discuss in details about the nature of bugs in software development process. What are the preventive steps you would take to minimize introduction of the bugs?

## Short answer

Bugs stem from requirements, design, coding, integration, and maintenance, with escalating costs. Prevention involves clear requirements, reviews, coding standards, defensive programming, comprehensive testing, version control, and adequate training.

## Answer

#### Nature of bugs
A bug is a mistake that causes the software to behave differently from its specification. Bugs can be introduced at any phase:
- **Requirement bugs:** missing, wrong or ambiguous requirements.
- **Design bugs:** wrong algorithms, poor architecture, interface mismatch, ignoring timing or resource limits.
- **Coding bugs:** syntax and logic errors, uninitialised variables, wrong conditions, off-by-one, overflow, memory leaks, pointers, race conditions.
- **Integration and environment bugs:** module interface and compatibility problems.
- **Maintenance bugs:** changes that break existing features.
Bugs can be permanent (always repeat) or transient/intermittent (depend on timing, input or environment, such as race conditions), and their cost increases if found late. Software bugs come from human error and complexity, not from wear.

#### Preventive steps
1. **Clear requirements:** document, review and get approval from the customer; maintain change control.
2. **Good design:** modular design, design reviews, use of proven patterns and models; simplicity.
3. **Coding standards:** naming, structured programming, avoid risky constructs, static code analysis tools.
4. **Reviews and inspections:** peer code review and walkthroughs at each phase.
5. **Testing at every level:** unit, integration, system and acceptance tests, regression tests after each change.
6. **Defensive programming:** input validation, error handling, assertions and watchdogs.
7. **Configuration management:** version control, build control and bug tracking.
8. **Training, planning, adequate schedule and documentation,** to avoid hasty coding.

## Check yourself

The answer's key points as multiple-choice questions, with the correct option and why.

1. What is a software bug?
   A. Wear of the code with age
   B. A hardware component failing
   C. A mistake that makes the software differ from its specification
   D. A slow user interface only
   Answer: C. Bugs come from human error and complexity, not from wear. (Key point: Nature of bugs)

2. Which is a transient (intermittent) bug?
   A. A bug that always repeats
   B. A syntax error
   C. A missing requirement
   D. A race condition depending on timing
   Answer: D. Transient bugs depend on timing, input or environment. (Key point: Transient bugs)

3. What happens to the cost of a bug found late?
   A. It increases
   B. It decreases
   C. It stays the same
   D. It becomes zero
   Answer: A. Late discovery makes fixing costlier. (Key point: Cost of late bugs)

4. Which step best prevents requirement bugs?
   A. Writing code faster
   B. Documenting, reviewing and getting customer approval with change control
   C. Skipping design reviews
   D. Testing only at the end
   Answer: B. Clear approved requirements prevent requirement bugs. (Key point: Prevention)

## Related in Instrumentation II

- [Phases of introduction of bugs in software](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Abugs-introduction) — Instrumentation II, chapter 9, asked 2×
- [Software maintenance and fixing common bugs](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Asw-maintenance-bugs) — Instrumentation II, chapter 9
- [Software bugs and testing techniques](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Abug-types-testing) — Instrumentation II, chapter 9, asked 2×
- [Software process models and effort estimation](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Asw-process-models) — Instrumentation II, chapter 9, asked 2×
- [Spiral model of software development](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Aspiral-model) — Instrumentation II, chapter 9, asked 3×
- [Shortcomings of software development models](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Asw-model-shortcomings) — Instrumentation II, chapter 9

## Related in other subjects

- [Embedded software development process](https://www.bctengineer.com/question.md?key=semester_6%2Fembedded_system%3Asoftware-development-flow) — Embedded System, chapter 3, asked 3×
- [Client planning in implementation stage](https://www.bctengineer.com/question.md?key=semester_8%2Fconstruction_management%3Aclient-implementation-planning) — Construction Management, chapter 2
- [Why schedule is important in planning](https://www.bctengineer.com/question.md?key=semester_7%2Fproject_engineering%3Aschedule-importance-planning) — Project Engineering, chapter 3
- [Why risk analysis is important in planning](https://www.bctengineer.com/question.md?key=semester_7%2Fproject_engineering%3Arisk-importance-analysis-planning) — Project Engineering, chapter 5
