- Home
- /
- Computational Thinking
- /
- Computational Thinking
- /
- Testing
Testing
Also known as: software testing, test cases
Grade 6-8
View on concept mapSystematically running a program with known inputs to verify that its outputs are correct. Quality software requires thorough, systematic testing because bugs found early cost far less to fix.
Definition
Systematically running a program with known inputs to verify that its outputs are correct. Testing involves designing test cases that cover normal inputs, boundary values, and error conditions, then comparing actual results against expected results.
💡 Intuition
Try to break it before users do. Test normal cases, edge cases, and error cases.
🎯 Core Idea
Testing can prove that bugs exist, but cannot prove that no bugs remain—exhaustive testing is impossible.
Example
Formula
🌟 Why It Matters
Quality software requires thorough, systematic testing because bugs found early cost far less to fix. Professional software teams typically write more test code than production code, and automated testing catches regressions before they reach users.
💭 Hint When Stuck
When writing test cases, cover three categories: typical inputs (normal use), boundary values (edges like 0, empty strings, maximum values), and error cases (invalid input that should be rejected gracefully). For each test, define the input, the expected output, and compare it to the actual output.
Formal View
Related Concepts
🚧 Common Stuck Point
Test edge cases: empty input, zero, maximum values, unexpected types.
⚠️ Common Mistakes
- Only testing the happy path (normal inputs) and neglecting edge cases and error conditions
- Writing tests that depend on each other's execution order instead of being independent
- Assuming that passing all tests means the program is bug-free—testing can only show the presence of bugs, not their absence
Go Deeper
Frequently Asked Questions
What is Testing in CS Thinking?
Systematically running a program with known inputs to verify that its outputs are correct. Testing involves designing test cases that cover normal inputs, boundary values, and error conditions, then comparing actual results against expected results.
What is the Testing formula?
When do you use Testing?
When writing test cases, cover three categories: typical inputs (normal use), boundary values (edges like 0, empty strings, maximum values), and error cases (invalid input that should be rejected gracefully). For each test, define the input, the expected output, and compare it to the actual output.
Next Steps
How Testing Connects to Other Ideas
To understand testing, you should first be comfortable with algorithm and debugging. Once you have a solid grasp of testing, you can move on to unit testing and edge cases.
💻 Animated Visualization Animated
Test cases verify the code works correctly