DEV Community

vishwa v
vishwa v

Posted on

Testing-1

What is Testing?
Software testing is a set of activities to discover defects and evaluate the quality of software work products. These work products,when being tested, are known as test objects.

Test Objectives
The typical test objectives are:
• Evaluating work products such as requirements, user stories, designs, and code
• Causing failures and finding defects
• Ensuring required coverage of a test object
• Reducing the risk level of inadequate software quality
• Verifying whether specified requirements have been fulfilled
• Verifying that a test object complies with contractual, legal, and regulatory requirements
• Providing information to stakeholders to allow them to make informed decisions
• Building confidence in the quality of the test object
• Validating whether the test object is complete and works as expected by the stakeholder

What is testcase
A test case is a documented set of conditions, inputs, actions, and expected results used to verify that a software feature works as intended.

Basic Structure of a Test Case

A typical test case includes:

Test Case ID: Unique identifier (e.g., TC_001)
Title/Description: What is being tested
Preconditions: Requirements before executing the test
Test Steps: Actions to perform
Test Data: Input values
Expected Result: What should happen
Actual Result: What actually happened (filled during execution)
Status: Pass/Fail

Example:
| Field | Value |
| --------------- | -------------------------------------------------------------------------------------------------- |
| Test Case ID | TC_LOGIN_001 |
| Test Scenario | Verify login with valid credentials |
| Preconditions | User account exists |
| Test Steps | 1. Open login page.
2. Enter valid username.
3. Enter valid password.
4. Click Login. |
| Test Data | Username: john123
Password: Password@123 |
| Expected Result | User is successfully logged in and redirected to the dashboard. |
| Actual Result | (Filled during testing) |
| Status | Pass/Fail |

Why Test Cases Are Important

Ensure the application meets requirements.
Help detect defects before release.
Make testing consistent and repeatable.
Provide documentation for future testing.
Improve software quality.

What is positive and negative test cases
Positive test case-A test scenario is a high-level situation or functionality that you want to test

Test Scenario = What should I test?
Test Case = How exactly will I test it?

A negative test case checks whether an application handles invalid, unexpected, or incorrect input properly.

Positive test case → Give correct input and check that it works.
Negative test case → Give incorrect input and check that the system handles it correctly.

Relationship blw Test case and test sceneria
A test scenario is a high-level requirement, and test cases are the detailed tests created under that scenario.

Easy example:

Imagine you are testing a house:

Test Scenario: Test the house's doors.
Test Cases:
Check front door opens.
Check front door locks.
Check back door opens.
Check back door locks.
Try opening door with wrong key.

Scenario = What area/functionality are we testing?
Test Case = What specific condition are we checking?

What is Unit Testing?

Unit Testing is testing an individual/smallest component of an application independently.

Usually, it is performed by developers.

Example:
In a banking application, testing the calculateInterest() function separately is unit testing.

What is Integration Testing?

Integration Testing checks whether two or more modules/components work correctly when they are combined.

Example:

Login Page → Authentication → Database

We check whether the login page correctly communicates with the authentication module and database.

Types of Integration Testing

The main approaches are:

Top-Down Integration Testing
Bottom-Up Integration Testing
Big Bang Integration Testing
Sandwich/Hybrid Integration Testing

Difference between Stub and Driver

Both are dummy programs/components used during integration testing.

Stub

Used in Top-Down integration testing

Acts as a called module
Provides temporary responses to the upper module

Driver
Used in Bottom-Up integration testing
Acts as a calling module
Sends test data to the lower module

Easy way to remember:

Stub = Called by the module
Driver = Calls the module

Difference between Error, Bug and Defect

These terms are often used interchangeably, but there is a useful distinction.

Error:
A mistake made by a person, usually during requirements, design, or coding.

Bug:
A problem in the software that causes it to behave incorrectly.

Defect:
A deviation of the actual software behavior from the expected/required behavior.

Example:

Developer writes:

Total = Price - Tax

instead of:

Total = Price + Tax

Developer's mistake → Error
Incorrect code/behavior → Bug/Defect
Tester identifies the problem → Defect is reported

Difference between Top-Down and Bottom-Up Integration Testing
Top down:
Testing starts from higher-level modules,Uses Stubs,Lower modules are integrated gradually and Testing proceeds downward

Bottom up:
Testing starts from lower-level modules,Uses Drivers,Higher modules are integrated gradually and Testing proceeds upward

Difference between BRS, SRS and FRS
| BRS | SRS | FRS |
| ----------------------------------- | --------------------------------------- | ------------------------------------ |
| Business Requirement Specification | Software Requirement Specification | Functional Requirement Specification |
| Describes business requirements | Describes overall software requirements | Describes functional behavior |
| High-level | More detailed | Detailed functional requirements |
| Usually business/client oriented | Client + technical teams | Mainly development/testing teams |

Example:

Business requirement:

"The company needs an online shopping system."

SRS:

"The system should allow users to register, login, search products, and make payments."

FRS:

"When the user clicks Login with valid credentials, the system should authenticate the user and redirect them to the dashboard."

Will Developer do Testing?

Yes.

Developers normally perform Unit Testing and may also perform some integration and other technical testing.

Testers/QA engineers primarily perform activities such as:

Functional Testing
Integration Testing
System Testing
Regression Testing
Smoke/Sanity Testing
Exploratory Testing

Interview answer:

"Yes, developers do testing, mainly unit testing. However, dedicated testers independently test the application to identify defects from an end-user perspective."

What is Test Bed?

A Test Bed is the environment, hardware, software, tools, data, and configurations required to execute testing.

For example, a web application's test bed may include:

Windows/Linux
Chrome/Firefox
Application build
Test database
Test data
Required testing tools

Simple definition:

Test Bed = Everything required to perform testing.

"Early Testing is good." Justify.

Early testing means starting testing activities as early as possible in the Software Development Life Cycle (SDLC).

It is good because:

Defects are identified early.
Fixing defects is cheaper.
Less time is required to fix problems.
Requirements can be clarified early.
Prevents defects from moving to later stages.
Improves overall software quality.

Interview answer:

"Early testing helps identify defects at an early stage, reducing the cost and effort of fixing them. It also helps prevent defects from propagating to later stages."

This is called the Early Testing Principle.

What are Cosmetic Bugs?

Cosmetic bugs are defects related to the appearance or visual presentation of an application that don't usually affect its core functionality.

Examples:

Incorrect font size
Misaligned button
Wrong color
Spelling mistake
Text overlapping
Incorrect spacing
Broken image
UI alignment problems

Example:

A button works correctly, but its text is slightly cut off.
This is a cosmetic/UI defect.

What is End-to-End Testing / System Testing?

End-to-End (E2E) Testing verifies the complete application workflow from beginning to end.

Example: Online Shopping

Login

Search Product

Add to Cart

Enter Address

Make Payment

Order Confirmation

Testing this entire flow is End-to-End Testing.

Important: E2E testing is commonly performed as part of system-level testing, but technically E2E testing and System Testing are not exactly identical.

System Testing: Tests the complete system against requirements.
E2E Testing: Tests a complete real-world business workflow across the system and, where applicable, integrated systems.
18) What is Cross-Functional Testing?

Cross-functional testing checks whether different functions/features or departments/modules of an application work together correctly to support a business process.

For example, in an e-commerce application:

Customer → Order → Payment → Inventory → Shipping

Testing the interaction across these different functions is cross-functional testing.

It focuses on business processes that cross multiple functional areas.

Test Case Preparation & Execution — WHEN?

This is an important interview question.

Test Case Preparation

Test cases are generally prepared after the requirements are understood and sufficiently finalized, and during the test planning/design phase.

Typical flow:

Requirements → Test Planning → Test Scenario → Test Case Preparation → Test Environment/Build → Test Execution

Test Case Execution

Test cases are executed when the required build/application is available in the test environment and the environment is ready.

For example:

Developer provides Build 1.0 → QA deploys it to the test environment → Smoke testing → Detailed test-case execution.

Easy interview answer:

"Test cases are prepared after analyzing the requirements and before test execution. Test cases are executed when the application build is available, the test environment is ready, and the required preconditions are satisfied."

Top comments (0)