ArticleslgStudy

computer science

Black-box testing

Black-box testing is a computer science topic covered in the lgStudy science library. This page brings together a partial reference excerpt, illustrations, worked examples, real-world applications and a short study plan, so you can understand Black-box testing rather than just read about it. In short: Black-box testing, sometimes referred to as specification-based testing, is a method of software testing that examines the functionality of an application without peering into its internal structures or workings. This method of testing can be applied virtually to every level of software testing: unit, integration, system and acceptance.

Black-box testing — main illustration
Black-box testing — illustration

Key takeaways

  • Black-box testing belongs to computer science; place it in that map before memorising details.
  • Learn the definition first, then one example that makes the definition concrete.
  • Connect Black-box testing to a quantity you can measure, compute or draw — that is where exam questions come from.
  • Reproduce the core statement of Black-box testing from memory before moving on to harder problems.

Reference excerpt

Black-box testing, sometimes referred to as specification-based testing, is a method of software testing that examines the functionality of an application without peering into its internal structures or workings. This method of testing can be applied virtually to every level of software testing: unit, integration, system and acceptance. Black-box testing is also used as a method in penetration testing, where an ethical hacker simulates an external hacking or cyber warfare attack with no knowledge of the system being attacked.

Test procedures Specification-based testing aims to test the functionality of software according to the applicable requirements. This level of testing usually requires thorough test cases to be provided to the tester, who then can simply verify that for a given input, the output value (or behavior), either "is" or "is not" the same as the expected value specified in the test case. Specific knowledge of the application's code, internal structure and programming knowledge in general is not required. The tester is aware of what the software is supposed to do but is not aware of how it does it. For instance, the tester is aware that a particular input returns a certain, invariable output but is not aware of how the software produces the output in the first place.

Test cases Test cases are built around specifications and requirements, i.e., what the application is supposed to do. Test cases are generally derived from external descriptions of the software, including specifications, requirements and design parameters. Although the tests used are primarily functional in nature, non-functional tests may also be used. The test designer selects both valid and invalid inputs and determines the correct output, often with the help of a test oracle or a previous result that is known to be good, without any knowledge of the test object's internal structure.

Test design techniques Typical black-box test design techniques include decision table testing, all-pairs testing, equivalence partitioning, boundary value analysis, cause–effect graph, error guessing, state transition testing, use case testing, user story testing, domain analysis, and syntax testing.

Test coverage

Test coverage refers to the percentage of software requirements that are tested by black-box testing for a system or application. This is in contrast with code coverage, which examines the inner workings of a program and measures the degree to which the source code of a program is executed when a test suite is run. Measuring test coverage makes it possible to quickly detect and eliminate defects, to create a more comprehensive test suite, and to remove tests that are not relevant for the given requirements.

Effectiveness Black-box testing may be necessary to assure correct functionality, but it is insufficient to guard against complex or high-risk situations. An advantage of the black box technique is that no programming knowledge is required. Whatever biases the programmers may have had, the tester likely has a different set and may emphasize different areas of functionality. On the other hand, black-box testing has been said to be "like a walk in a dark labyrinth without a flashlight." Because they do not examine the source code, there are situations when a tester writes many test cases to check something that could have been tested by only one test case or leaves some parts of the program untested.

See also

References

External links BCS SIGIST (British Computer Society Specialist Interest Group in Software Testing): Standard for Software Component Testing Archived 2021-02-26 at the Wayback Machine, Working Draft 3.4, 27. April 2001.

Illustrations

Black-box testing: Example of a black box model where a certain input produces a certain output
Example of a black box model where a certain input produces a certain output

Worked examples

Example 1 — a first encounter with Black-box testing

Start with the simplest possible case. Write down what Black-box testing claims or describes in one sentence, then invent the smallest concrete situation in which that sentence is true. In computer science, the smallest case is usually a single object, a single equation or a single measurement. Check that every symbol or term in your sentence has a meaning in that case.

Example 2 — changing one variable

Take the situation from Example 1 and change exactly one quantity: double it, halve it, or set it to zero. Predict what should happen to Black-box testing before you calculate. Comparing your prediction with the result is the fastest way to find out whether you understand the idea or only the words.

Example 3 — an exam-style question

Typical questions about Black-box testing ask you to (a) state it precisely, (b) apply it to given data, and (c) explain a limitation. Practise writing all three answers in under five minutes; the third part is what separates a full-mark answer from an average one.

Applications of Black-box testing

In research
Black-box testing appears in computer science research whenever the underlying quantities have to be modelled precisely. Papers usually cite it as a starting assumption and then explore where it breaks down.
In technology and industry
Engineering practice reuses Black-box testing in design rules, simulations and safety margins. Knowing the idea lets you read a specification sheet and understand why the numbers look the way they do.
In the classroom
Black-box testing is common in secondary-school and first-year university syllabi. It links to neighbouring topics Hardware testing, Software testing, so understanding it makes those chapters shorter.
In everyday life
Look for Black-box testing outside the textbook — in sport, cooking, traffic, electronics or the sky above you. An example you found yourself is remembered far longer than one you were given.
Ask Teacher Smith questions about this articleOpens your AI tutor with a question about “Black-box testing” →

How to study Black-box testing in 20 minutes

  1. Read the reference excerpt below once, without taking notes.
  2. Close the page and write down what Black-box testing means in your own words.
  3. Compare your version with the excerpt and mark what you missed.
  4. Work through the three examples above with pen and paper.
  5. Explain Black-box testing out loud to somebody else — or to Teacher Smith in the lgStudy chat.

Frequently asked questions

What is Black-box testing in simple terms?

Black-box testing, sometimes referred to as specification-based testing, is a method of software testing that examines the functionality of an application without peering into its internal structures or workings. This method of testing can be applied virtually to every level of software testing: un…

Why does Black-box testing matter?

Because it connects several computer science ideas at once: it gives you a definition you can apply, a quantity you can calculate, and a way to check whether a result is plausible.

How should I study Black-box testing?

Read the excerpt, restate it from memory, then work through the examples and applications listed on this page. The five-step study plan above takes about twenty minutes.

What does this page cover?

It gives you a compact reference excerpt plus original lgStudy explanations, examples, applications and study material on Black-box testing.

Tags

  • Hardware testing
  • Software testing

Keep exploring