1. Introduction to Software Testing
Software Testing is the process of checking a
software application or program to identify errors, bugs, and defects and to
ensure that it works correctly according to user requirements.
Example: Before launching a college management system, we test
whether student registration, attendance, examination results, and fee payment
functions work properly.
2. Objectives of Software Testing
1.
To
identify errors and bugs.
2.
To
improve software quality.
3.
To
ensure software reliability.
4.
To
verify user requirements.
5.
To
improve software performance.
6.
To
ensure customer satisfaction.
Importance of Software Testing
Software Testing is important because it helps
to identify errors, improve software quality, and ensure that the software
works correctly according to user requirements.
Importance of Testing
1. Identifies Errors: Helps to find and correct errors and bugs in
software.
2. Improves Quality: Ensures that the software performs its functions
correctly.
3. Ensures Reliability: Makes software more stable and dependable.
4. Improves Security: Helps identify security weaknesses and protect
user data.
5. Saves Cost: Finding errors early reduces the cost of fixing them
later.
6. Customer Satisfaction: Ensures that the software meets customer
expectations.
7. Better Performance: Checks whether the software works efficiently.
8. Reduces Risk: Reduces the possibility of software failure.
Example
In a College Management System, testing helps to
ensure that:
- Student registration works correctly.
- Attendance is recorded properly.
- Examination results are calculated correctly.
- Fee payment details are maintained accurately.
Types / Levels of Testing
1. Unit Testing
· Testing individual components or modules of
software.
· Usually performed by developers.
Example: Testing a login function separately.
2. Integration Testing
· Testing two or more combined modules.
· Checks whether different modules work together.
Example: Checking the connection between student registration
and fee payment.
3. System Testing
- Testing the complete software system.
- Checks whether the entire application works correctly.
Example: Testing the complete college management system.
4. Acceptance Testing
- Testing whether the software meets user requirements.
- Usually performed by customers or end users.
Example: College staff checking whether the software meets
their needs.
4. Methods / Types of Software Testing
1. Black Box Testing
- Tests software functionality without knowing its internal code.
- Focuses on input and output.
2. White Box Testing
- Tests the internal structure and logic of the program.
- Requires knowledge of programming code.
3. Grey Box Testing
- Combines black box and white box testing.
- Tester has partial knowledge of internal software structure.
5. Advantages of Software Testing
1.
Improves
software quality.
2.
Reduces
software errors.
3.
Increases
security.
4.
Improves
reliability.
5.
Saves
maintenance costs.
6.
Provides
user satisfaction.
6. Difference Between Verification and
Validation
|
Verification |
Validation |
|
Checks whether we are building the product
correctly. |
Checks whether we are building the correct
product. |
|
Focuses on documents and design. |
Focuses on the actual software. |
|
Does not necessarily execute code. |
Usually involves executing software. |
7. Difference Between Error, Bug and Failure
- Error: A mistake made by a developer.
- Bug: A defect in the software.
- Failure: When software does not perform the expected task.
8. Important Examination Questions
1.
Define
Software Testing.
2.
What
are the objectives of software testing?
3.
Explain
the different types of software testing.
4.
Explain
the levels of software testing.
5.
What
is Black Box Testing?
6.
What
is White Box Testing?
7.
Differentiate
between Black Box and White Box Testing.
8.
Explain
Verification and Validation.
9.
What
are the advantages of software testing?
10.
Differentiate
between Error, Bug and Failure.
Test Case Design
1. Introduction
Test Case Design is the process of creating test
cases to verify whether a software application works correctly according to
specified requirements.
A test case contains inputs, conditions, steps,
and expected results used to test a particular function of software.
Example: In a college management system, we design test cases to check whether
students can log in using a valid username and password.
2. Objectives of Test Case Design
1.
To identify software
defects.
2.
To verify software
functionality.
3.
To ensure all
requirements are tested.
4.
To improve software
quality.
5.
To reduce testing
time and cost.
6.
To ensure reliable
results.
3. Components of a Test Case
A test case generally contains the following
components:
|
Component |
Description |
|
Test Case ID |
Unique identification number. |
|
Test Case Name |
Name of the test. |
|
Test Objective |
Purpose of testing. |
|
Input Data |
Data given to the software. |
|
Test Steps |
Steps to perform testing. |
|
Expected Result |
Result that should occur. |
|
Actual Result |
Result obtained after testing. |
|
Status |
Pass or Fail. |
Example of Test Case Design (Login Page)
Suppose we have a college website login page.
|
Test Case ID |
Test Condition |
Expected Result |
|
TC01 |
Enter valid username and
password. |
Login successful. |
|
TC02 |
Enter incorrect password. |
Display error message. |
|
TC03 |
Enter empty username. |
Display validation message. |
|
TC04 |
Enter empty password. |
Display validation message. |
|
TC05 |
Enter both fields empty. |
Display required-field message. |
5. Techniques of Test Case Design
There are several techniques used to design test
cases.
1. Equivalence Partitioning
·Divides input data into different groups.
·Selects one value from each group for testing.
Example: If the accepted age is 18–60, we divide values into
valid and invalid groups.
2. Boundary Value Analysis
· Tests values at the boundaries of input ranges.
· Helps identify errors at minimum and maximum
limits.
Example: If the accepted age is 18–60, test 17, 18, 19, 59, 60
and 61.
3. Decision Table Testing
- Uses a table to test different combinations of
conditions and actions.
Example: Checking login results based on valid and invalid
usernames and passwords.
4. State Transition Testing
- Checks how software behaves when it moves from
one state to another.
Example: A user account may become temporarily locked after
repeated unsuccessful login attempts.
5. Use Case Testing
- Designs test cases based on user activities
and requirements.
Example: Testing the complete student admission process.
6. Advantages of Test Case Design
1.
Improves
testing efficiency.
2.
Helps
identify defects.
3.
Provides
proper test documentation.
4.
Ensures
requirement coverage.
5.
Saves
time and cost.
6.
Improves
software reliability.
7. Conclusion
Test Case Design is an important activity in
software testing. It helps testers identify errors, verify software functions,
and ensure that the application meets user requirements.
Important
Examination Questions
1.
Define
Test Case Design.
2.
Explain
the components of a test case.
3.
Explain
different techniques of test case design.
4.
What
is Equivalence Partitioning?
5.
Explain
Boundary Value Analysis with an example.
6.
Differentiate
between test case and test scenario.
Debugging
1. Introduction to Debugging
Debugging is the process of identifying,
analyzing, and correcting errors (bugs) in a software program.
It helps developers find the causes of errors
and make the software work correctly.
Example: If a calculator program displays an incorrect
addition result, the developer checks the code and corrects the error.
2. Objectives of Debugging
1.
To
identify errors in a program.
2.
To
find the root cause of errors.
3.
To
correct programming mistakes.
4.
To
improve software quality.
5.
To
ensure proper program execution.
6.
To
improve software reliability.
3. Steps Involved in Debugging
1.
Identify
the Error: Find the problem in the program.
2.
Reproduce
the Error: Run the program again to understand the problem.
3.
Locate
the Error: Identify the part of the code causing the problem.
4.
Fix
the Error: Correct the programming mistake.
5.
Retest
the Program: Run the program again to verify the correction.
6.
Verify
the Result: Ensure that the program works correctly.
4. Types of Errors in Programming
1. Syntax Error
A syntax error occurs when programming language
rules are not followed.
Example (C):
printf("Hello")
Here, the semicolon is missing.
2. Logical Error
A logical error occurs when the program executes
but produces an incorrect result.
Example:
int a = 10, b = 20;
printf("%d", a - b);
Using subtraction instead of addition
If addition is required, using subtraction
produces the wrong result.
3. Runtime Error
A runtime error occurs while the program is
executing.
Example: Dividing a number by zero.
5. Debugging Techniques
1.
Brute
Force Method: Finding errors by checking program output and intermediate
values.
2.
Backtracking:
Tracing the program backward from the point where the error occurs.
3.
Cause
Elimination: Identifying possible causes and eliminating them one by one.
4.
Using
Debugging Tools: Using software tools to find and correct errors.
6. Difference Between Testing and Debugging
|
Testing |
Debugging |
|
Prepares test cases. |
Identifies and corrects errors. |
|
Identifies defects in software. |
Finds and fixes defects. |
|
Checks software functionality. |
Examines the cause of errors. |
|
Defines input and expected
output. |
Examines program code. |
|
Usually performed by testers. |
Usually performed by
developers. |
|
Finds failures. |
Corrects the underlying
problems. |
7. Advantages of Debugging
1.
Improves
program quality.
2.
Removes
errors and bugs.
3.
Improves
software performance.
4.
Increases
reliability.
5.
Helps
maintain software.
6.
Ensures
correct program execution.
8. Conclusion
Debugging is an important activity in software
development. It helps developers identify and correct errors, improve program
quality, and ensure that software works properly.
Important Examination Questions
1.
Define
Debugging.
2.
Explain
the objectives of debugging.
3.
Explain
the steps involved in Debugging.
4.
What
are the different types of programming errors?
5.
Explain
debugging techniques.
6.
Differentiate
between Test Case Design and Debugging.
7.
Define
Test Case Design.
8.
Explain
the components of a test case.
9.
Explain
the techniques of Test Case Design.