0% found this document useful (0 votes)
0 views

Assignment 1(Stqa)

The document discusses the origins and classes of software defects, highlighting sources such as requirement errors, coding mistakes, and environmental factors. It also outlines the structure of a defect repository for tracking defects, including elements like defect ID, severity, and status, along with a Python program for logging defects. Additionally, it covers various testing methodologies, including validation, integration, system, acceptance, GUI, verification, and regression testing, emphasizing their importance in ensuring software quality.

Uploaded by

khushalis1512
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
0 views

Assignment 1(Stqa)

The document discusses the origins and classes of software defects, highlighting sources such as requirement errors, coding mistakes, and environmental factors. It also outlines the structure of a defect repository for tracking defects, including elements like defect ID, severity, and status, along with a Python program for logging defects. Additionally, it covers various testing methodologies, including validation, integration, system, acceptance, GUI, verification, and regression testing, emphasizing their importance in ensuring software quality.

Uploaded by

khushalis1512
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 6

ASSIGNMENT-1

Q1. WRITE ORIGINS OF DEFECTS AND DISCUSS DEFECT CLASSES.


ANS: ORIGINS OF DEFECTS:
Defects in software arise due to various reasons, including human errors, miscommunication, complex system
requirements, and technical limitations. The primary sources of defects include:
1. Requirement Errors: Ambiguous, incomplete, or misunderstood requirements can lead to incorrect
implementation.
2. Design Flaws: Poor architectural decisions or misinterpretations of requirements can introduce defects.
3. Coding Mistakes: Errors made during programming, such as syntax errors, logical mistakes, or
incorrect algorithm implementation.
4. Data Issues: Incorrect data handling, missing data, or inconsistent data formats can cause defects.
5. Environmental Factors: Variations in hardware, software configurations, and network conditions can
introduce defects.
6. Poor Testing Procedures: Inadequate test coverage or missed edge cases can leave defects
undiscovered.
7. Miscommunication: Lack of proper communication between developers, testers, and stakeholders can
introduce errors.
DEFECT CLASSES:
Defects can be classified based on their nature, impact, and occurrence:
1. Functional Defects: Errors in the functionality of the software that cause it to behave unexpectedly.
2. Performance Defects: Issues affecting the efficiency, speed, or scalability of the application.
3. Usability Defects: Problems related to user experience, accessibility, and interface design.
4. Security Defects: Vulnerabilities that could be exploited by attackers.
5. Compatibility Defects: Issues arising due to variations in browsers, operating systems, or hardware.
6. Logical Defects: Incorrect logic in algorithms leading to wrong outputs.
7. Boundary Value Defects: Errors occurring at the limits of input values due to improper handling of
boundary conditions.
8. Configuration Defects: Issues arising due to incorrect settings, dependencies, or environment
mismatches.
Q2. CREATE DEFECT REPOSITORY/TEST DESIGN AND ALSO DRAFT ONE DEFECT
REPOSITORY OF ANY PROJECT.
ANS: DEFECT REPOSITORY:
A defect repository is a centralized system for tracking, managing, and analyzing defects during the software
development lifecycle. It helps teams identify patterns, prioritize fixes, and improve software quality.
ELEMENTS OF A DEFECT REPOSITORY:
1. Defect ID: A unique identifier for tracking defects.
2. Summary: A short description of the defect.
3. Description: Detailed explanation, including steps to reproduce the defect.
4. Severity: Classification of the impact (Critical, High, Medium, Low).
5. Priority: Urgency of fixing the defect (Urgent, High, Normal, Low).
6. Status: Current stage of the defect (Open, In Progress, Resolved, Closed).
7. Environment: The software/hardware configuration in which the defect was found.
8. Attachments: Screenshots, logs, or test cases related to the defect.
9. Assigned To: Developer or tester responsible for resolving the defect.
10. Date Created & Resolved: Timestamp of defect detection and closure.
To understand defect repository management, we will implement a defect tracking system using Python.

Python Program to Log Defects into a File

import csv

def log_defect(defect_id, summary, severity, priority, status, assigned_to, environment, date_created):

with open('defect_repository.csv', mode='a', newline='') as file:

writer = csv.writer(file)

writer.writerow([defect_id, summary, severity, priority, status, assigned_to, environment, date_created])

# Example Defects

log_defect('D001', 'Login button not working', 'Critical', 'High', 'Open', 'Dev Team', 'Windows 10, Chrome', '01-
03-2024')

log_defect('D002', 'Slow page load in reports', 'Medium', 'Normal', 'In Progress', 'Dev Team', 'MacOS, Safari',
'02-03-2024')

log_defect('D003', 'Incorrect error message', 'Low', 'Low', 'Resolved', 'Tester', 'Windows 11, Edge', '03-03-
2024')

DEFECT REPOSITORY:
VALIDATION TESTING:

Validation testing ensures that the final product meets user requirements and functions as intended. It involves
evaluating the software against the business requirements and user expectations rather than just checking
technical specifications. The goal is to verify that the software system achieves its intended purpose.

KEY STAGES OF VALIDATION TESTING:

1. Unit Testing: Ensures that individual components function correctly in isolation.


2. Integration Testing: Verifies that combined modules interact properly.
3. System Testing: Examines the complete system’s behavior under real-world conditions.
4. User Acceptance Testing (UAT): Confirms that the software meets end-user expectations before
deployment.

BENEFITS OF VALIDATION TESTING:

• Helps identify missing functionalities or incorrect implementations.


• Reduces software failures by ensuring conformance to requirements.
• Improves customer satisfaction by delivering a fully functional product. Validation testing ensures that
the final product meets user requirements and functions as intended. It checks whether the software
satisfies business needs and expected behaviors through different testing methodologies such as unit
testing, integration testing, and system testing. It answers the question: "Are we building the right
product?"

INTEGRATION TESTING:

Integration testing examines how different modules of the software interact with each other. It ensures that data
flow and communication between modules work correctly. This testing phase helps uncover defects in
interactions between integrated units.

TYPES OF INTEGRATION TESTING:

• Top-Down Integration: Testing starts with high-level modules and gradually integrates lower-level
ones.
• Bottom-Up Integration: Lower-level modules are tested first before integrating with higher-level
modules.
• Big Bang Integration: All modules are integrated and tested simultaneously.
• Incremental Integration: Modules are integrated and tested in phases to detect issues early.

ADVANTAGES OF INTEGRATION TESTING:

• Identifies interface-related defects early.


• Ensures that different components of the system work together.
• Reduces risk before system-wide testing. Integration testing examines how different modules of the
software interact with each other. It ensures that data flow and communication between modules work
correctly. It can be performed in the following ways:
• Top-Down Integration: Testing from higher-level modules to lower-level modules.
• Bottom-Up Integration: Testing from lower-level modules to higher-level modules.
• Big Bang Integration: Testing all modules at once.
• Incremental Integration: Testing modules step-by-step as they are developed.
SYSTEM AND ACCEPTANCE TESTING:

• System Testing: Evaluates the complete, integrated system against functional and non-functional
requirements.
• Acceptance Testing: Conducted to determine if the system is ready for deployment. It includes:
o Alpha Testing: Performed by internal users before release.
o Beta Testing: Conducted by external users in a real-world environment before final release.

GUI TESTING:

GUI (Graphical User Interface) testing ensures that the visual elements of an application function correctly. It
involves testing the responsiveness, consistency, and user-friendliness of the interface, including:

• Button clicks, menus, and dropdowns.


• Navigation between screens.
• Alignment and display consistency across devices and resolutions.

VERIFICATION TESTING:

Verification testing checks if the software meets technical specifications and is built according to design
requirements. It answers the question: "Are we building the product correctly?"

REGRESSION TESTING:

Regression testing ensures that new updates or fixes do not break existing functionality. It involves re-running
previously executed test cases to verify that recent code changes have not introduced new defects.

WHEN TO PERFORM REGRESSION TESTING?

1. After fixing bugs or defects.


2. When adding new features to the software.
3. During performance improvements or code optimizations.
4. After system updates or migration to a new platform.

APPROACHES TO REGRESSION TESTING:

• Retest All: Rerun all test cases, ensuring maximum coverage.


• Selective Retesting: Execute only affected test cases based on code modifications.
• Automated Regression Testing: Use tools like Selenium, JUnit, or TestNG to automate repetitive test
execution.

BENEFITS OF REGRESSION TESTING:

• Ensures software stability after modifications.


• Helps maintain software quality in iterative development models.
• Reduces risks associated with frequent code changes. Regression testing ensures that new updates or
fixes do not break existing functionality by re-executing previous test cases.
Performing Regression Testing

1. calculator.py

# Simple Calculator Program

def add(a, b):

return a + b

def subtract(a, b):

return a - b

def multiply(a, b):

return a * b

def divide(a, b):

if b == 0:

return "Error: Division by zero"

return a / b

2. test_calculator.py

import unittest

import calculator # Import the calculator module

class TestCalculator(unittest.TestCase):

def test_add(self):

self.assertEqual(calculator.add(5, 3), 8)

self.assertEqual(calculator.add(-1, 1), 0)
def test_subtract(self):

self.assertEqual(calculator.subtract(10, 5), 5)

self.assertEqual(calculator.subtract(0, 5), -5)

def test_multiply(self):

self.assertEqual(calculator.multiply(3, 3), 9)

self.assertEqual(calculator.multiply(-2, 4), -8)

def test_divide(self):

self.assertEqual(calculator.divide(10, 2), 5)

self.assertEqual(calculator.divide(5, 0), "Error: Division by zero")

if __name__ == '__main__':

unittest.main()

OUTCOME:

You might also like