Functional testing and non-functional testing are very important part of STLC. Both focuses on different aspects of quality and performance for software product. Let's see the differences between these two types of testing.
Functional Testing-
Functional testing validates the software against it functional requirements. It verifies and confirm if application behaves as expected and meets the specified functional specifications.
See below for different types of functional testing with examples -
Integration Testing: Validates interactions between different modules.
Example: Integration Testing for E-Commerce website.
Test Scenario: Place a order on website.
Consider an e-commerce system with the following main components:
- Shopping Cart
- Payment Gateway
- Order Management
Steps to place order -
Add products to the Cart - Open the website url in browser and navigate to the product catalog. Select a product and add them to the shopping cart.
View Cart - Navigate to the shopping cart and verify the selected product is listed with correct price.
Proceed to Checkout - Checkout from cart and proceed to the payment page.
Make Payment -Make a payment using simulator/ payment gateway.
On processing payment, verify the order details are correctly shown in the order management system.
Expected Results:
1.The shopping cart accurately displays the selected product and respective price.
2.The calculated total should match the sum of the product price.
3.The payment process should indicate a successful transaction.
4.The order details should be correctly recorded in the order management page.
System Testing: Validates the entire system end to end.
Acceptance Testing: Verifies if the software meets the requirements.
Example: Login and user profile management
Test Scenario: Login to website and update user profile information
Preconditions:
Steps:
User logs into website
Navigate to Profile Page
Click on the user profile link and access the profile page.
Edit profile information:
Update fields First name, Last name, phone number, address.
Save the updates.
Verify updated information is shown on the profile page.
Expected Results:
- The user is able to access and edit their profile information.
- The changes made are saved successfully.
- The updated information is displayed on the profile page.
Non-Functional Testing:
Non-functional testing focuses on attributes like performance, security and usability. It checks how the system performs under specific conditions.
Load Testing: It evaluates how the system performs under expected load condition.
Example:
Example: Load Testing for e-commerce website during Diwali sale
Objective:
To identify how the e-commerce website handles traffic during Diwali sale.
Load Testing Steps:
- Define test Scenarios: Simulate real user behavior during a sale event which includes
- Login into the website
- Browsing product pages
- Adding products to the cart
Checkout from cart and place order
Identify Open source testing tool: Apache JMeter
Configure the number of virtual users: Specify the number of virtual users that will be part of load test. Start with 100 virtual users and gradually increase load up to 1000 users.
Simulate User Actions:Develop different set of test scenarios with different user interactions on the website.
- Login into website
- Browse products
- Search products
- Add products to the cart
- Place order
- Logout
Define ramp-up period for increasing load: Start with 20 users and increase by 20 every minute.
Execute the Load testing script using tool JMeter
During execution monitor key parameters:
- Response times for various pages
- Transaction throughput (transactions per second)
- Error occurred percentage (Page not found, transaction failed, payment gateway timeout)
- Analyze the test results: Review the reports and data generated by the load testing tool. It helps to find out performance bottlenecks/ issues.
Expected results:
- The e-commerce website should provide reasonable response times during increased load.
- End to end transactions should be completed without any errors or timeout.
- The system should be able to handle the load without affecting the user experience.
Usability Testing:
Assesses the user-friendliness of the software. This involves evaluating how easily users can navigate, understand, and interact with the application.
Example - Usability Testing for a Weather App
To evaluate the user-friendliness of a weather application.
Usability Testing steps:
- Check current location weather: Users open the app and find the current weather conditions for current location.
- View daily forecast: User navigates to the daily forecast section and checks the weather predictions for the next day.
Expected Results:
End user is able to easily find and understand the weather information for their current location.
App's interface is intuitive, allowing users to navigate between different sections without any confusion.
Conclusion - Functional testing confirms that the software meets its defined functional requirements, while non-functional testing addresses quality attributes like performance, security, and usability. Using a combination of both testing methodologies, team can deliver high quality software product that meets user expectations.
Top comments (0)