You are on page 1of 11

Name: Faisal Haroon

Seat No: B19103014


Course: Software Testing
Instructor: Sir Zaeem Tariq
Lab Task: Comprehensive Software Testing for a Web Form

1. Web Form:
<!DOCTYPE html>

<html lang="en">

<head>

<meta charset="UTF-8">

<meta name="viewport" content="width=device-width, initial-scale=1.0">

<title>Web Form Application</title>

</head>

<body>

<div class="container">

<h2>Contact Form</h2>

<form id="contactForm">

<label for="firstName">First Name</label>

<input type="text" id="firstName" name="firstName" required>

<label for="lastName">Last Name</label>

<input type="text" id="lastName" name="lastName" required>

<label for="email">Email:</label>

<input type="email" id="email" name="email" required>

<label for="password">Password</label>

<input type="password" id="password" name="password" required>

<label for="confirmPassword">Confirm Password</label>

<input type="password" id="confirmPassword" name="confirmPassword" required>

<label>Gender</label>

<input type="radio" id="male" name="gender" value="male">

<label for="male">Male</label>

<input type="radio" id="female" name="gender" value="female">

<label for="female">Female</label>
<label for="country">Country</label>

<select id="country" name="country">

<option value="us">United States</option>

<option value="ca">Canada</option>

<option value="uk">United Kingdom</option>

</select>

<button type="submit">Submit</button>

</form>

</div>

</body>

</html>

2. Testing Cycle & Planning:

i) Test cases:

Test Case 1: Submit with Valid Data


1. Enter valid data into all fields.
2. Click the "Submit" button.
3. Expected Result: Form is submitted successfully, and a confirmation message is displayed.

Test Case 2: Submit with Empty Fields


1. Leave all fields empty.
2. Click the "Submit" button.
3. Expected Result: Validation errors are shown for all required fields, and the form is not submitted.

Test Case 3: Password and Confirm Password Mismatch


1. Enter valid data into all fields.
2. Enter a password and a different value in the "Confirm Password" field.
3. Click the "Submit" button.
4. Expected Result: A validation error is displayed indicating that the passwords do not match.

Test Case 4: Select Gender


1. Enter valid data into other fields.
2. Select a gender (e.g., Male).
3. Click the "Submit" button.
4. Expected Result: Form is submitted successfully with the selected gender and interests.

Test Case 5: Select No Gender


1. Enter valid data into other fields.
2. Do not select any gender.
3. Click the "Submit" button.
4. Expected Result: A validation error is shown indicating that a gender must be selected.

Test Case 6: Select Multiple Interests


1. Enter valid data into other fields.
2. Select multiple interests (e.g., Programming and Design).
3. Click the "Submit" button.
4. Expected Result: Form is submitted successfully with the selected interests.

Test Case 7: Submit with Invalid Email Format


1. Enter valid data into other fields.
2. Enter an invalid email address (e.g., "invalid-email").
3. Click the "Submit" button.
4. Expected Result: A validation error is displayed for the email field.

Test Case 8: Submit with Long First and Last Names


1. Enter valid data into other fields.
2. Enter very long first and last names (e.g., more than 100 characters).
3. Click the "Submit" button.
4. Expected Result: Validation errors are shown for the first and last name fields.

Test Case 9: Select Country


1. Enter valid data into other fields.
2. Select a country from the dropdown list (e.g., United States).
3. Click the "Submit" button.
4. Expected Result: Form is submitted successfully with the selected country.

ii) Testing Scope:

1. Field Inputs:
- First Name: Valid, Empty, Special Characters, Long Name
- Last Name: Valid, Empty, Special Characters, Long Name
- Password: Valid, Empty, Short Password, Password Mismatch, Special Characters
- Confirm Password: Valid, Empty, Password Mismatch, Special Characters
2. Other Fields Validation:
- Gender: Male, Female, None
- Country: Selection, No Selection

3. Buttons Check:
- Submit: Valid Submission, Empty Fields, Various Input Combinations
- Reset: Clear All Fields

4. Messages for Validation:


- Check Validation Messages for Empty and Incorrect Inputs

5. Functionality Test:
- Ensure Form Submission with Different Inputs

6. Non-Functional Test:
- Test Form Response under Different Load Conditions

iii) Testing Strategy:

a) Testing Approach:
Manual testing

b) Resources:
Testers: Experienced Testers use for testing the web Form.

Tools: Different tools will be needed to accomplish the testing task. Test tools to help with test case
management, bug tracking, and others.

c) Timeline:
Preparation of test cases: week 1

Functional testing: week 2

Usability testing: week 3

Performance testing: week 4

Security testing: week 5

Finalize testing and Report Preparation: week 6

3. Testing Techniques:

i) Equivalence Partitioning:

Test 1: Empty First Name


Input: Leave the first name field empty.
Expected Result: Validation error message displayed for the empty field.

Test 2: Valid Last Name

Input: Enter a valid last name.


Expected Result: Successful submission of the form.

Test 3: Short Password

Input: Enter a short password (less than required length).


Expected Result: Validation error message for a short password.

Test 4: Password Mismatch

Input: Enter a confirm password that doesn't match the password.


Expected Result: Validation error message for password mismatch.

Test 5: Gender Selection

Input: Select the "Male" gender option.


Expected Result: Form submission successful with the selected gender.

Test 6: Country Selection

Input: Select a country from the list (e.g., United States).


Expected Result: Form submission successful with the selected country.

Test 7: Successful Submission

Input: Enter valid data in all fields and click submit.


Expected Result: Form submission successful with no validation errors.

Test 9: Reset Button

Input: Click the reset button after entering data.


Expected Result: All fields are cleared.

ii) Boundary Value Analysis:

Test 1: Short First Name

Input: Enter a short first name


Expected Result: Validation error message for short name

Test 2: Long First Name

Input: Enter a long first name


Expected Result: Successful submission
Test 3: Short Last Name

Input: Enter a short last name


Expected Result: Validation error message for short name

Test 4: Long Last Name

Input: Enter a long last name


Expected Result: Successful submission

Test 5: Short Password

Input: Enter a short password


Expected Result: Validation error message for short password

iii) Decision Table:

Conditions Actions Expected Results


First Name is empty Validation Error Error message displayed

Last Name is invalid Validation Error Error message displayed

Password is empty Validation Error Error message displayed

No country selected Validation Error Error message displayed

too short password Validation Error Error message displayed

Correct Fields Form Submitted Success message displayed

Incorrect email Validation Error Error message displayed

Password Mismatch Validation Error Error message displayed

iv) Pairwise Testing:

a. Test Name: Input Fields


Factors: first name, lastname, Email, Password, Confirm Password, Gender
Test Cases: Select combinations using pairwise testing to cover all pairs of factors.

b. Test Name: all fields


Factors: Username, Email, Password
Test Cases: Select combinations using pairwise testing to cover all factors.
c. Test Name: Security
Factors: first name, lastname, Email, Password
Test Cases: Select combinations using pairwise testing to cover these factors.

4. Test Execution:

Test Confirm Expected


Case firstname lastname Email Password Password Gender Coun Result
try
ali@work.com testing123 testing123 Error Messag
1 Empty ali Male us Displayed
ali@work.com testing123 testing123 Error Messag
2 umer Empty Female us Displayed
ali@work.com Error Messag
3 umer ali test test Other Displayed
ali@work.com testing123 testing123 Error Messag
4 umer ali Male us Displayed
ali@work.com testing123 testing123 No Error, For
5 umer ali Female us Submits
longusern ali@work.com testing123 testing123 Not No Error, For
6 am e ali Specified us Submits
ali@work.com testing123 testing123 No Error, For
7 umer ali Male us Submits
ali@work.com testing123 testing123 No Error, For
8 umer ali Female us Submits
ali@work.com testing123 testing123 No Error, For
9 umer ali Other us Submits
ali@work.com LongPassw LongPassw ord No Error, For
10 umer ali ord Female us Submits
ali@work.com Error Messag
11 umer ali test test Male us Displayed
ali@work.com testing123 testing123 No Error, For
12 umer ali Female us Submits
ali@work.com testing123 testing123 Not No Error, For
13 umer ali Specified us Submits
5. Software Metrics:

i) Test Coverage

To calculate the test case coverage percentage, we need to determine the total number of form
elements that our test cases cover and then divide that by the total number of form elements.

Total number of form elements = 7 (firstname, lastname, Email, Password, Confirm Password,
Gender, country)

Coverage Percentage = Number of Test Cases / Total Form Elements × 100

Coverage Percentage = 25 / 7 × 100 = 357.14


So, we have achieved 100% coverage of the form elements with our test cases.

ii) Defect Density

Assuming we have executed the test cases and found the following defects:

Total number of defects found = 4


Total number of form elements = 7

Defect Density per Form Element:


Defect Density = (Total number of defects found) / (Total number of form elements) Defect Density
= 4 / 7 ≈ 0.57

So, the defect density per form element is approximately 0.57.

iii) Test Execution Time

To calculate the test execution time, we need to know the start and end times of your testing
process. The formula to calculate the test execution time is:
Test Execution Time = End Time - Start Time

Assuming we started our testing at 10:00 AM and finished at 1:30 PM:


Start Time: 10:00 AM
End Time: 1:30 PM

Convert the times to a common unit in minutes:

Start Time in Minutes = 10:00 AM * 60 minutes/hour = 600 minutes


End Time in Minutes = 1:30 PM * 60 minutes/hour = 810 minutes

Test Execution Time = End Time in Minutes - Start Time in Minutes


Test Execution Time = 810 minutes - 600 minutes = 210 minutes So, the test execution time is 3
hours and 30 minutes.

6. Results Analysis and Reporting:

i) Testing Objectives:
The main testing goals were to check the accuracy of the data input, make sure that validation
Error handling were done correctly, and evaluate the user experience as a whole. All form fields,
Including firstname, lastname, email, password, confirm password, birthdate, gender and country,
Were included in the scope..

ii) Total Executed Test Cases and Outcomes:


A total of 10 test cases were executed, encompassing a wide range of scenarios. The outcomes of
these test cases were as follows:

Pass: 20 test cases Fail: 4 test cases


Error Messages Displayed: 1 test case

iii) Metrics Analysis and Interpretation:


Test Case Coverage: coverage achieved, as all form elements were tested. Defect Density per
Form Element: Approximately 0.57 defects per form element. Test Execution Time: 210 minutes (3
hours and 30 minutes).

iv) Defects Identified and Their Severity:

Defect: Empty First Name Field


Severity: Minor
Description: The form allows submission with an empty first name field, leading to incomplete user
information.

Defect: Password Mismatch


Severity: Major
Description: Submitting the form with mismatched passwords does not result in a clear error
message, confusing users.
Defect: Missing Gender Selection
Severity: Moderate
Description: The form can be submitted without selecting a gender, potentially causing data
Analysis issues later.

v) Improvement:
Test password matching and validation logic thoroughly. Gender selection would be validated
and empty field of firstname are also validated.

You might also like