Software Testing Notes-1
Software Testing Notes-1
SOFTWARE TESTING
Software Testing
Complete Revision Notes
BCA 232 | Academic Session 2024-25
Units I · II · III · IV | 11 Hours Each
II Black Box (BVA, ECT, Decision Table), White BVA Line, CFG, Black/White 11
Box (Path Testing, Cyclomatic Complexity, Box
DD-Paths, Data Flow)
Software Testing is the process of executing a program or system with the intent of finding errors. It is
a systematic activity to check whether the actual result matches the expected result and to ensure the
software is defect-free, reliable, and meets user requirements.
Dynamic behaviour Software may work fine in testing but fail in production due to different
environments.
Incomplete requirements Testers can only verify against documented requirements; undocumented
needs remain untested.
Time and budget Testing is cut short under project pressure, leaving potential bugs
constraints undetected.
Tester knowledge limits Testers may not know all edge cases or system interactions.
■ 2. Goals of Testing
Find Defects Discover bugs before the software reaches end users — the primary goal.
Gain Confidence Provide evidence that the software satisfies requirements under specified
conditions.
Prevent Defects Improve the development process so fewer bugs are introduced in future.
Risk Reduction Reduce the probability of software failure in production and its business
impact.
2. Exhaustive testing impossible All input combos can't be tested. Use risk analysis and
priorities to focus effort.
3. Early testing saves cost Finding a bug in requirements costs 1x; in design 3x; in
production 100x. Start testing early!
4. Defect clustering (80/20) 80% of defects are found in 20% of modules. Focus more on
these high-risk areas.
5. Pesticide paradox If same tests are run again and again, they stop finding new
bugs. Regularly review and update tests.
6. Context dependent A medical device needs different testing than a mobile game.
Testing strategy varies with context.
7. Absence-of-errors fallacy A system with zero bugs that doesn't meet user needs is still
a failure. Meet requirements first!
These four terms are often confused. Here is the precise hierarchy:
Fault A flaw in the code or document introduced by the Incorrect code statement,
(Defect/Bug) error. wrong logic, typo.
Runtime deviation from expected behaviour — what The fault gets executed and
Failure
the user sees. produces wrong output.
■ 5. Test Cases
A Test Case is a documented set of preconditions, inputs, execution steps, expected results and
postconditions developed for a particular test objective or condition. Every test must be traceable back to at
least one requirement.
Test Steps Step-by-step actions [Link] app [Link] creds [Link] Login
STLC is a sequence of specific activities conducted during the testing process to ensure software quality
goals are met. It is part of the SDLC but focuses exclusively on testing activities.
1 2 3 4 5 6
Requirement Test Test Case Environment Test Test
Analysis Planning Design Setup Execution Closure
1. Requirement Analysis Study RTM, identify testable requirements, clarify doubts with
BA/developers.
2. Test Planning Define scope, approach, estimate effort, identify risks, assign
responsibilities.
3. Test Case Design Write detailed test cases, create test data, prepare test scripts.
5. Test Execution Execute test cases, log results, report and track defects in defect tracking
tool.
6. Test Closure Evaluate exit criteria, produce test summary report, record lessons
learned.
The V-Model extends the waterfall model by placing corresponding testing phases opposite to each
development phase. The left side represents Verification (are we building the right product?) and the right
side represents Validation (are we building it right?).
Module ↔ Unit
Design Testing
Architecture ↔ Integration
Design Testing
System ↔ System
Design Testing
Requirements ↔ Acceptance
Analysis Testing
CODING
★ Key Rule: Each testing phase starts PLANNING during the corresponding dev phase. Actual execution happe
■ 8. Limitations of Testing
■ Testing can only show the presence of defects, not their absence.
■ Complete testing is practically impossible for real software.
■ Testing requires skilled, experienced professionals — not just anyone.
■ Testing cannot fix defects — it can only find them.
■ Testing effectiveness depends on quality of requirements.
Walkthrough Author presents and explains the document to peers. Less formal. Aims to
educate and get feedback.
Technical Review Peer review to check technical correctness. More structured than
walkthrough, less than inspection.
Desk Checking Developer reviews their own code/document informally before formal
review.
In Black Box Testing, the tester treats the software as a black box — knowing only the inputs and
expected outputs, with no knowledge of internal code. Tests are derived from specifications and
requirements.
0 1 2 50 99 100 101
Rule For a valid range [min, max], test: min-1, min, min+1, any_middle, max-1,
max, max+1
Why effective Input validation code most often fails at boundaries — off-by-one errors
are very common.
Complement Often combined with Equivalence Class Testing for complete coverage.
Valid Class Inputs the software should accept and process correctly. E.g., for age
1-100: class = {1,2,...,100}
Invalid Class Inputs the software should reject with an appropriate error message. E.g.,
{<1} and {>100}
Principle If a test case in a class finds a bug, all values in that class likely reveal the
same bug.
★ Advantage: Decision tables guarantee all condition combinations are tested. Good for systems with complex
In White Box Testing, the tester has full knowledge of the internal code structure. Tests are designed to
exercise specific code paths, branches, loops and conditions.
Statement Coverage Every executable statement executed at least once. Weakest criterion.
Branch Coverage Every decision outcome (True/False) executed. Stronger than statement.
Path Coverage Every unique path from start to end executed. Strongest but often
impractical.
Condition Coverage Each individual condition in a decision takes both True and False values.
B. Cyclomatic Complexity
Cyclomatic Complexity (V(G)) is a quantitative measure of the number of linearly independent paths
through source code. Higher complexity = higher risk = more tests needed.
Complexity scale 1–4: Low | 5–10: Moderate | 11–20: High | >20: Very High (refactor
recommended)
D. Graph Metrics
Node (Statement) Coverage Every node in CFG is traversed. Basic requirement.
Path Coverage Every path from entry to exit traversed. Infeasible for loops.
Def-clear path A path where the variable is not redefined between its definition and use.
Goal Cover all def-use pairs: every definition reaches every use through some
path.
■ 1. Unit Testing
Unit Testing is the lowest level of testing where individual components/functions/methods are tested in
isolation from the rest of the system. The goal is to validate that each unit of code performs as designed.
When? During or immediately after coding (in TDD, written before code).
Key limitation Cannot catch integration bugs — modules work alone but fail together.
Test-Driven Development Write unit test FIRST → run (fails) → write code → run (passes) →
(TDD) refactor.
Code Coverage Targets Typically aim for 70-80% line coverage as minimum threshold.
■ 2. Integration Testing
Integration Testing verifies that multiple units/modules work correctly when combined together. Even if
each unit works perfectly in isolation, interface defects can cause failures at the integration level.
Module A Module A
Integration Strategies:
Big Bang All modules integrated at once and tested together. Simple but very hard
to isolate bugs.
Top-Down Start with the top-level module; lower modules replaced by STUBS. Tests
high-level flow first.
Stub A dummy module used in place of a LOWER module not yet developed.
Used in Top-Down approach.
Sandwich Both ways Medium Both stubs & drivers Large complex systems
■■ 3. System Testing
System Testing is the process of testing the complete, integrated system against the specified system
requirements. Performed by the QA/testing team — NOT the development team.
Performance Testing Evaluates system speed, responsiveness and stability under various
workloads.
Load Testing Tests system under expected peak load conditions. How many users can it
handle?
Stress Testing Tests system beyond its limits to see how it fails and recovers.
Usability Testing Evaluates how easy and intuitive the system is for end users.
Compatibility Testing Tests across different OS, browsers, screen sizes, and devices.
Recovery Testing Verifies system can recover from crashes, power failures, or hardware
errors.
Sanity Testing Quick check to ensure a specific bug fix or feature works before full
regression.
Smoke Testing High-level check to verify the build is stable enough for detailed testing.
■ 4. Acceptance Testing
Acceptance Testing is the final phase where the client or end users verify the system meets their business
requirements before signing off and going live. Also known as User Acceptance Testing (UAT).
Alpha Testing Done by internal employees (not the dev team) at the developer's
site before external release.
Contract Acceptance Testing Software tested against criteria defined in a contract between client
and developer.
Regulation Acceptance Testing Tests compliance with laws, regulations, industry standards (e.g.,
HIPAA for healthcare).
■ 1. Test Planning
A Test Plan is a formal document that describes the scope, approach, resources and schedule of
intended testing activities. It is the master blueprint for the entire testing effort.
1 2 3 4 5 6
3. Entry Criteria Conditions that MUST be met before testing can BEGIN. E.g., code
complete, environment ready.
4. Exit Criteria Conditions that MUST be met to STOP testing. E.g., 95% pass rate,
zero P1/P2 open bugs.
5. Identifying Responsibilities Who is responsible for test plan, test cases, execution, sign-off, defect
tracking.
6. Staffing & Training Number of testers needed, skill sets required, training to be arranged.
8. Test Deliverables Documents produced: test plan, test cases, test scripts, defect reports,
summary report.
9. Testing Tasks & Schedule List of all tasks with start/end dates, dependencies, milestones.
■■ 2. Test Management
Test Management encompasses all activities needed to organise, monitor and control the testing
process. It ensures that testing is executed effectively and efficiently within constraints.
Test Environments DEV (developer testing), SIT (system integration), UAT (acceptance),
STAGING (pre-prod).
Test Data Management Creating, managing and securing test data. Ensure data masks sensitive
production data.
Configuration Management Track versions of software, environments and test assets — ensure
everyone uses correct version.
Test Lead Coordinates test execution. Reviews test cases. Technical + organisational
Tracks defects. skills
Senior Test Designs test cases, reviews junior work, writes Domain + testing expertise
Engineer test scripts.
Test Engineer Executes test cases, reports defects, retests Attention to detail, tools
fixes.
1 Step 1: Baseline the Test Plan Finalise, review and formally approve the test plan. Place it
under configuration management so changes are tracked.
2 Step 2: Integrate with Product Coordinate test activities with development release schedule.
Release Ensure testers know what code is in each build.
3 Step 3: Test Case Specification Write detailed test cases for each requirement. Review for
completeness. Peer review by another tester.
4 Step 4: Update Requirements Map every test case to the requirement it covers. Ensure 100%
Traceability Matrix (RTM) requirement coverage. RTM format: REQ-ID → Test Case ID →
Status.
5 Step 5: Execute Tests & Track Run tests per schedule. Log actual results. Raise defects in
Defects defect tracking tool (Jira, Bugzilla, etc.). Classify severity
(Critical/High/Medium/Low) and priority.
6 Step 6: Test Reporting Prepare daily/weekly test progress reports. Report: planned vs
executed tests, pass/fail counts, defect open/closed/pending,
test coverage percentage.
7 Step 7: Recommend Product Based on exit criteria and test results, the Test Manager gives
Release GO/NO-GO recommendation. Document rationale. Final
decision with stakeholders.
A defect goes through a defined life cycle from when it is first discovered to when it is finally closed.
Understanding this process is essential for test management.
New
Closed Assigned
Rejected
Retest Open
Fixed
Fixed Developer fixes the bug and marks it as Fixed. Code changes documented.
Retest Tester verifies the fix by running the original failing test case again.
Deferred Valid but not fixed in this release — moved to next release backlog.
High Severity, Low Priority Rare feature crashes but rarely used. E.g., admin-only report crash.
Low Severity, High Priority Spelling mistake in company logo on homepage — low impact, must fix
ASAP.
RTM is a document that maps and traces user requirements to test cases. It ensures every requirement
has at least one test case and every test case maps to a requirement. A key deliverable for quality audits.
Covera
Req ID Requirement Test Case IDs Status
ge
BVA Values For range [a,b]: test a−1, a, a+1, mid, b−1, b, b+1 (7 values)
Error Chain Human Error → Code Fault/Bug → System Failure → User Incident
Alpha vs Beta Alpha = Internal employees at developer site | Beta = External selected
users at their site
Stub vs Driver Stub = dummy LOWER module (Top-Down) | Driver = dummy UPPER
module (Bottom-Up)
Entry/Exit Criteria Entry = when to START testing | Exit = when to STOP testing
Severity vs Priority Severity = impact on system (by Tester) | Priority = fix order (by Business)
RTM Purpose Maps Requirements ↔ Test Cases. Ensures 100% requirement coverage.
Static Testing No code execution. Inspection > Technical Review > Walkthrough > Desk
Check (formality order)
Data Flow Test def = variable defined | c-use = computation use | p-use = predicate use.
Cover all def-use pairs.
★ All the very best for your exam! Focus on examples, diagrams and comparison tables. — BCA 232 Software T