---
title: "Black-box testing"
subject: "Software Engineering"
chapter: 8
key: "semester_5/software_engineering:black-box-testing"
source: https://www.bctengineer.com/q/semester_5/software_engineering/black-box-testing
site: BCT Engineering
---

# Black-box testing

Software Engineering · Chapter 8: Software Testing and cost Estimation

- Asked in: year not given, 5 marks
- Video: [SE 43 : Black Box Testing | Techniques with Examples  #softwaretesting @csittutorialsbyvrushali](https://www.youtube.com/watch?v=wrj-Mr_hSQ8) — CS & IT Tutorials by Vrushali 👩‍🎓
- Answer checked by Claude Opus 5.5 (high effort) on 2026-10-14
- Page: https://www.bctengineer.com/q/semester_5/software_engineering/black-box-testing
- Whole chapter: https://www.bctengineer.com/md/semester_5/software_engineering/chapter-8

## Question

Explain black box testing.

## Short answer

Black-box testing derives test cases from the specification without internal code knowledge. Techniques include equivalence partitioning, boundary value analysis, cause-effect graphing, and state transition testing. It finds missing functions, interface errors, data structure errors, performance errors, and initialization or termination errors.

## Answer

**Black-box testing** (functional or behavioural testing) is a testing method in which test cases are derived from the **specification** of the software, without any knowledge of its internal code. The tester gives inputs and checks whether the outputs match the expected results.

```text
 Input test data --> [  System under test  ] --> Output
                      (internal code hidden)        |
                                  Compare with expected
```

#### Errors it finds (Pressman)
- Incorrect or missing functions
- Interface errors
- Errors in data structures or external database access
- Behaviour or performance errors
- Initialisation and termination errors

#### Main techniques
1. **Equivalence partitioning**: divide the input domain into classes whose members are expected to behave the same; test one value from each valid and invalid class.
2. **Boundary value analysis**: test values at and next to the edges of each class, where errors are most common.
3. **Cause-effect graphing / decision tables**: test combinations of input conditions and their actions.
4. **State transition testing**: test valid and invalid transitions between system states.
5. **Use-case (scenario) testing** and **error guessing** based on experience.

#### Example
A login field accepts a password of 8 to 16 characters.
- Equivalence classes: fewer than 8 (invalid), 8–16 (valid), more than 16 (invalid).
- Boundary values: 7, 8, 16 and 17 characters.
So test cases with 5, 7, 8, 12, 16, 17 and 20 characters check this rule without reading the code.

#### Advantages
- Tests from the user's point of view; no programming knowledge needed.
- Tester is independent of the developer, so there is less bias.
- Test cases can be designed as soon as the specification is ready.

#### Disadvantages
- Cannot show which parts of the code were executed; some paths may stay untested.
- Exhaustive testing of all inputs is impossible, so only a sample is tested.
- Test design is hard if the specification is unclear.

## Check yourself

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

1. From what are black-box test cases derived?
   A. The source code structure
   B. The specification, without knowledge of the code
   C. The compiler output
   D. The number of branches
   Answer: B. Black-box (functional) testing gives inputs and compares outputs with those expected by the specification. (Key point: Basis of black-box tests)

2. A password must be 8 to 16 characters. Which lengths are the boundary values?
   A. 5, 12, 20
   B. 7, 8, 16, 17
   C. 8, 12, 16
   D. 0, 8, 16
   Answer: B. Boundary value analysis tests at and just outside each edge: 7 and 8, 16 and 17. (Key point: Equivalence and boundaries)

3. What is a disadvantage of black-box testing?
   A. It requires programming knowledge
   B. It cannot show which code was executed, so some paths may stay untested
   C. The tester is biased by the developer
   D. It can only start after coding
   Answer: B. Without looking at the code, coverage of paths is unknown, and exhaustive input testing is impossible. (Key point: Disadvantage)

## Related in Software Engineering

- [Black-box versus white-box testing](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Ablack-box-vs-white-box) — Software Engineering, chapter 8
- [Testing principles and testability](https://www.bctengineer.com/question.md?key=semester_5%2Fsoftware_engineering%3Atesting-principles) — Software Engineering, chapter 8

## Related in other subjects

- [White box and black box testing](https://www.bctengineer.com/question.md?key=semester_5%2Finstrumentation_ii%3Awhite-black-box) — Instrumentation II, chapter 9
