Software Testing




Software Testing

Software Testing is the process of executing a program with the intent of finding errors and ensuring that the software works as per requirements.

In simple words: Testing = Checking whether software works correctly

Testing Objectives

Main Objectives of Software Testing

  • Find defects and errors
  • Verify software meets requirements
  • Ensure software quality
  • Reduce risk of failure
  • Improve customer satisfaction

Secondary Objectives

  • Validate performance and reliability
  • Check security and usability
  • Ensure compatibility

Unit Testing

Unit Testing tests individual units or modules of software separately.

Usually done by developers

Features

  • Focuses on smallest part of software
  • Uses test cases
  • Detects errors early

Advantages

  • Easy debugging
  • Low cost
  • Improves code quality

Example: Testing a function that calculates salary.

Integration Testing

Integration Testing checks whether combined modules work together correctly.

Types of Integration Testing

TypeDescription
Top-DownMain module tested first
Bottom-UpLow-level modules tested first
SandwichCombination of both
Big BangAll modules tested together

Advantages

  • Finds interface errors
  • Ensures smooth data flow

Acceptance Testing

Acceptance Testing is done to confirm that software meets user expectations.

Performed by users or clients

Types

  • Alpha Testing (in-house)
  • Beta Testing (real users)

Purpose

  • Final validation
  • User approval

Regression Testing

Regression Testing ensures that new changes do not break existing functionality.

When Performed?

  • After bug fixing
  • After feature addition
  • After system update

Importance

  • Maintains software stability
  • Prevents reintroduction of old bugs

Testing for Functionality

Functional Testing checks what the software does against requirements.

Focus Areas

  • Input validation
  • Output correctness
  • Business rules
  • Error handling

Types of Functional Testing

  • Unit Testing
  • Integration Testing
  • System Testing
  • Acceptance Testing

Testing for Performance

Performance Testing checks how well the software performs under load.

Key Performance Parameters

  • Response time
  • Throughput
  • Scalability
  • Resource usage

Types of Performance Testing

TypeDescription
Load TestingNormal expected load
Stress TestingExtreme conditions
Volume TestingLarge data volume
Endurance TestingLong time usage

Functional vs Performance Testing (Very Important)

BasisFunctional TestingPerformance Testing
FocusWhat system doesHow system performs
Requirement TypeFunctionalNon-functional
ExampleLogin works or notLogin speed

Quick Revision Table

Testing TypePurpose
Unit TestingTest individual modules
Integration TestingTest combined modules
Acceptance TestingUser approval
Regression TestingCheck impact of changes
Functional TestingValidate features
Performance TestingMeasure speed and load

Important Exam Questions

  • Define software testing and its objectives
  • Explain unit and integration testing
  • What is regression testing?
  • Differentiate functional and performance testing
  • Explain acceptance testing

Conclusion

Software testing ensures reliable, high-quality software. Different testing types focus on correctness, performance, and user satisfaction, helping reduce failures and improve system stability

Top-Down Testing Strategy

Top-Down Testing starts testing from the top-level module and gradually moves to lower-level modules.

Focus: Testing the main functionality first, then sub-modules.

How it works

  • Start testing the main module.
  • Use Test Stubs for modules that are not yet developed.
  • Gradually integrate and test lower modules.

Test Stubs

  • Definition: A dummy module that simulates the behavior of a lower-level module.
  • Used because lower modules may not be ready yet.

Real-life example: Imagine building a car. You want to test driving before engine is ready. You attach a dummy engine (stub) that simulates movement, so you can test steering and brakes.

Advantages

  • High-level design tested early
  • Early detection of design flaws
  • Suitable for major functionality verification

Disadvantages

  • Requires many stubs
  • Low-level modules tested late

Bottom-Up Testing Strategy

Bottom-Up Testing starts with testing lower-level modules first and then integrates to form higher modules.

Focus: Test basic units first, then the whole system.

How it works

  • Test basic modules individually.
  • Use Test Drivers to simulate higher-level modules.
  • Integrate modules step by step and test.

Test Drivers

  • A program that calls and tests a lower-level module before higher modules are ready.

Real-life example: In a car, you first test the engine separately using a test rig (driver) before installing it in the car to see if it works.

Advantages

  • Errors in low-level modules detected early
  • Early testing of critical modules

Disadvantages

  • Integration issues detected late
  • Higher-level design tested late

Structural Testing (White Box Testing)

White Box Testing tests internal logic, code structure, and paths of the program.

Also called Glass Box Testing / Code-Based Testing

Key Techniques

  • Statement Coverage
  • Branch Coverage
  • Path Coverage
  • Loop Testing

Real-life example

Checking a banking software code to ensure if–else decisions for withdrawal, deposit, and loan approval are all correct.

Functional Testing (Black Box Testing)

Black Box Testing checks software behavior without knowing the internal code.

Focus: Does the system do what it’s supposed to do?

Types of Functional Testing

  • Unit testing
  • Integration testing
  • System testing
  • Acceptance testing

Real-life example

Testing a microwave oven: You just press buttons and see if it heats food. You don’t care about circuits inside.

Test Data Preparation

Test Data is input data used to test software. Proper preparation is critical to cover all scenarios.

Types of Test Data

  • Valid Data – Correct input
  • Invalid Data – Incorrect input to check error handling
  • Boundary Data – Edge cases (max/min values)
  • Random Data – Random values to test robustness

Real-life example

Testing ATM withdrawal:

  • Valid: ₹500 (less than balance)
  • Invalid: ₹5000 (more than balance)
  • Boundary: ₹0, ₹Max limit

Alpha and Beta Testing of Products

Alpha Testing

  • Done in-house by developers before release
  • Simulates real users
  • Helps catch bugs early

Real-life example: Software company releases a new mobile app internally to employees before public launch.

Beta Testing

  • Done by actual users in real environment
  • Feedback collected for final improvements
  • Precedes final release

Real-life example: Company releases a beta version of WhatsApp to selected users to test new features.

Quick Revision Table

ConceptDefinitionExample
Top-Down TestingTest high-level modules firstTesting car steering before engine ready
Bottom-Up TestingTest low-level modules firstTesting engine separately before car assembly
Test StubDummy lower moduleDummy engine in top-down
Test DriverDummy higher moduleEngine test rig in bottom-up
White Box TestingTest internal codeBank software if-else logic
Black Box TestingTest functionalityMicrowave oven buttons
Test DataInput used for testingATM withdrawal amounts
Alpha TestingIn-house user testingInternal beta of mobile app
Beta TestingReal user testingSelected users test new WhatsApp features

Important Exam Questions

  • Explain top-down and bottom-up testing strategies
  • Define test drivers and test stubs with examples
  • Difference between white box and black box testing
  • Explain test data preparation types
  • Explain alpha and beta testing with examples

Conclusion

Testing strategies ensure software works correctly, meets user expectations, and is stable. Top-Down & Bottom-Up approaches, combined with proper test data, and alpha/beta testing, provide comprehensive quality assurance.

Static Testing Strategies

Static Testing is the process of examining software artifacts without executing the code.

In simple words: Static Testing = Finding defects by reviewing documents, design, and code, instead of running the program.

Objectives of Static Testing

  • Detect errors early in development
  • Ensure compliance with standards
  • Reduce cost of fixing defects
  • Improve overall software quality
  • Check for consistency and completeness

Types of Static Testing

StrategyDescriptionReal-Life Example
Formal Technical Reviews (Peer Reviews)A structured review of software artifacts by team membersTeam checks each other’s design document before coding
WalkthroughInformal step-by-step presentation of code/design for discussionDeveloper explains code logic to colleagues to spot mistakes
Code InspectionDetailed line-by-line examination of codeSenior developer reviews every line of banking software code for logic errors
Compliance with Design & Coding StandardsCheck if code/design follows organizational standardsEnsuring variable names, indentation, comments, and naming conventions are followed

Formal Technical Reviews (Peer Reviews)

A Formal Technical Review (FTR) is a structured peer review of software artifacts such as:

  • Requirements document
  • Design document
  • Code

Steps

  • Planning the review
  • Kick-off meeting
  • Individual preparation (reviewer studies the artifact)
  • Review meeting (discuss defects)
  • Defect logging
  • Follow-up (verify fixes)

Advantages

  • Early defect detection
  • Improves quality
  • Knowledge sharing among team

Real-Life Example

A team reviews a Student Management System design document and finds missing modules like attendance tracking.

Walkthrough

Walkthrough is an informal review where the author explains the artifact step-by-step to the team.

Purpose

  • Understand logic
  • Find errors or missing requirements
  • Educate team members

Example

A developer explains login module code to colleagues to check for logic flaws.

Code Inspection

Code Inspection is a line-by-line examination of source code by one or more reviewers.

Key Points

  • Focuses on logical, syntactical, and semantic errors
  • Follows a checklist

Advantages

  • Finds subtle errors
  • Improves maintainability
  • Ensures coding standards

Real-Life Example

Inspecting banking application code to detect errors in interest calculation formula.

Compliance with Design and Coding Standards

Ensuring that code and design conform to organizational rules and best practices.

Key Aspects

  • Naming conventions (variables, functions)
  • Commenting and documentation
  • Proper indentation
  • Code modularity and reuse

Real-Life Example

In a hospital management system, all modules must follow standard naming patterns and error handling conventions.

Advantages of Static Testing

  • Detect defects early → cheaper to fix
  • Reduces risk of failures in later stages
  • Improves team understanding of software
  • Ensures standardization

Static Testing vs Dynamic Testing (Quick Exam Table)

BasisStatic TestingDynamic Testing
ExecutionNo code executionCode is executed
CostEarly, cheaperLate, more expensive
FocusDocuments, code, designSoftware behavior
ExamplePeer review, walkthroughUnit testing, system testing

Important Exam Questions

  • Define static testing and its objectives
  • Explain formal technical review (peer review) with steps
  • What is walkthrough? Give example
  • Explain code inspection and its advantages
  • How is compliance with design and coding standards verified?


Conclusion

Static Testing is a cost-effective method to improve software quality by detecting errors early, reviewing artifacts, and ensuring standards are followed. Methods like peer reviews, walkthroughs, code inspections, and compliance checks are widely used in software projects.