The Katalon Blog

What is Functional Testing? Definition, Types & Examples

Written by Katalon Team | Oct 28, 2022 3:46:50 AM

 

When people refer to "testing" in a general context, they often have functional testing in mind. It's about making sure that the core functions are working as they should. The scope of functional testing is so broad that it encompasses so many other types of testing. 

 

In this article, we'll explore the concept of functional testing in-depth, its challenges, best practices, and tools.

 

What is Functional Testing?

Functional testing is a type of software testing where testers check if features of the application are working as expected according to its specified requirements. These requirements are either collected from the users or provided by the stakeholders (development team or product owner).
 

The primary goal of functional testing is to ensure that the software performs the functions it was assigned to do, and typically does not concern itself with the internal code structure or implementation details. It is one of the most common and foundational types of testing.

 

Examples of Functional Testing

Imagine you are testing a web application that requires users to log in. In this case, functional testing simply is used to check if the Login page is working as expected.

What are the “expected” features from a Login page then? Several that come to mind are:

  1. User Authentication
  2. Account Lockout
  3. Password Reset
  4. Remember Me 
  5. Account Recovery
  6. Multi-Factor Authentication (especially critical for high-risk applications)
  7. Session Management (ensure that users are logged out automatically after a period of inactivity for security purposes)
  8. User Monitoring

Those requirements are agreed upon and carefully documented to guide the functional testing effort. Generally, the more emphasis placed on security, the more functional testing needs to be done for the Login feature. Here are several examples of functional test cases on the Login page:

  1. Test that users can successfully log in with valid credentials (e.g., a registered username/email and password).
  2. Test that users receive an error message when attempting to log in with invalid credentials (e.g., incorrect password or non-existent username).
  3. Test that after a specified number of consecutive failed login attempts, the account is locked and the user cannot log in.
  4. Test the password reset feature by initiating a password reset request through the "Forgot Password" link.
  5. Test the "Remember Me" feature to ensure that the user remains logged in across browser sessions.
  6. Test the implementation of MFA by logging in with valid credentials and verifying that the MFA method (e.g., SMS code, app-based token) works correctly.

Read More: 100 Test Cases For The Login Page

 

Functional Testing vs Non-functional Testing: Key Differences

While indeed accounting for a major part of the test plan, functional testing should not be the only testing type your team performs. Non-functional testing is the much needed counterpart.

 

1. What is Non-functional Testing?

Non-functional testing is a type of software testing that focuses on evaluating the non-functional such as the system's performance, reliability, and stability.  

 

When doing functional testing, testers try to answer the question Can the system do what it was built to do? 

 

When doing non-functional testing, testers try to answer the question Can the system do what it was built to do well enough? 

 

Here are 5 non-functional test cases for you to better understand the concept:

  1. Measure the response time of the system under normal load conditions.
  2. Simulate concurrent user connections to determine how the system performs under heavy load, checking for response time degradation or failures.
  3. Conduct usability testing with actual users to gather feedback on navigation, intuitiveness, and overall user experience.
  4. Assess the system's ability to handle an increased workload by gradually increasing the load and observing performance metrics like CPU and memory usage.
  5. Test user roles and permissions to ensure that users can only access the features and data they are authorized for. 

 

2. What are the differences between functional testing and non-functional testing?

Functional testing primarily focuses on whether the system delivered the output desired. 

 

Non-functional testing validates the “hows” of the AUT’s features, performance, security, scalability, etc.

 

Here's a quick comparison table for you:

Aspect

Functional Testing

Non-Functional Testing

Purpose

To verify if the software functions as intended and meets functional requirements.

To evaluate non-functional attributes like performance, security, usability, and more.

Focus

Tests what the software should do.

Tests how well the software performs certain functions or behaves under specific conditions.

Scope

Typically focuses on specific features or functionalities.

Covers a broader range of attributes beyond functionality.

Examples of Testing Types

Unit Testing, Integration Testing, System Testing, User Acceptance Testing.

Performance Testing, Security Testing, Usability Testing, Compatibility Testing.

Test Criteria

Pass/fail criteria are often straightforward based on expected outcomes.

Pass/fail criteria may involve thresholds or benchmarks (e.g., response time should be below 2 seconds).

User Focus

Ensures that the software meets user needs and expectations in terms of features.

Ensures that the software meets user needs and expectations in terms of performance, security, usability, etc.

Objective Measurement

Often involves binary outcomes (pass/fail) based on expected behavior.

Often involves quantitative measurements and benchmarks for non-functional attributes.

Tools and Technologies

Functional testing tools may include Selenium, JUnit, TestNG, etc.
 

→ Check out the top functional testing tools

Non-functional testing tools may include JMeter, OWASP ZAP, LoadRunner, etc.

 

How To Do Functional Testing?

Step 1. Decide on test scenario

Functional testing starts from requirements. Requirements start from user story. 

That means functional testing is about translating that user story into the right requirements, which will then be turned into the right test cases.

A user story typically follows a specific format:

  • As a [role]: This describes the type of user or stakeholder who will benefit from the feature.
  • I want [feature]: This describes the specific functionality or capability that the user desires.
  • So that [benefit]: This explains the reason or goal behind the desired feature, providing context for its implementation.

For example, a user story might look like this:

"As a customer, I want to be able to view my order history online so that I can track the status of my purchases."

This is a good user story, but it is not enough for the development team and QA team. They work as a starting point at best. Testers need to work with the end users, sit with them, look at the issue from their perspective, and put that user story into a specific context to ensure that the developed feature aligns with what they want.
 

A user story combined with a realistic example and conversation becomes a requirement. From this requirement comes the first functional tests to guide development activities later down the road.
 

So, how do we actually do that? The keyword here is “divide to conquer”.
 

A user story might be too general. The user wants X, but to achieve X, what are the action items we need to take, specifically? Break the user story into smaller chunks that are easier to tackle. This practice also significantly mitigates risks associated with the story, and you can also code and test that small chunk of the story faster.
 

From the user story above, we can immediately break it into 8 smaller slices:

Slice

Description

Details

1

Basic Order History Page Setup

- Create the Order History page in the navigation menu.

- Set up a basic HTML/CSS structure for the page.

- Display a placeholder message like "No orders found" or "Your order history will appear here."

2

Fetching Order Data

- Create an API endpoint that fetches the customer's order history.  

- Connect the frontend to this API to fetch data.

3

Displaying Order List

- Design a list view for orders.  

- Populate the list with order data (e.g., order ID, date, and total amount).

4

Order Details View

- Enable each order item in the list to be clickable.  

- Create a detailed order view that shows items in the order, quantities, prices, etc.

5

Order Status Tracking

- Display the current status of each order (e.g., processing, shipped, delivered).  

- Provide a status timeline or progress bar if applicable.

6

Pagination and Sorting

- Implement pagination to handle a large number of orders.  

- Allow sorting by date, amount, or status.

7

Mobile Responsiveness

- Adjust the layout and styles for different screen sizes.  

- Test and refine user interactions on mobile devices.

8

Error Handling and Notifications

- Display error messages if the order data fails to load.  

- Show loading indicators while data is being fetched.  

- Provide user-friendly messages for any issues encountered.

Of course, you can break it into even smaller slices and more slices depending on how granular you want to go.

 

Step 2. Design the tests

Now that you know which area to test. How do you know what to test.

Test design approaches differ depending on the opacity of the system i.e. how much do you know about its internal structure?

If you don't know anything about the internal mechanism, you are essentially testing a black box. There are several techniques you can leverage

  • Equivalence Partitioning – Divides input data into valid and invalid partitions to reduce test cases.
  • Boundary Value Analysis – Focuses on testing values at the boundaries of input ranges.
  • Decision Table Testing – Uses a table to map combinations of inputs with expected outputs.
  • State Transition Testing – Tests system behavior based on different states and events.
  • Error Guessing – Relies on tester experience to guess potential error-prone areas.
  • Use Case Testing – Tests the software based on user scenarios or real-world use cases.

Learn more about black box testing techniques here

 

Same goes with white box testing where you have complete knowledge of the internal mechanism. Popular techniques include:

  • Statement Coverage – Ensures every line of code is executed at least once.
  • Branch Coverage – Tests all possible branches or decision points in the code.
  • Path Coverage – Checks all possible paths through the code, including loops and conditions.
  • Condition Coverage – Tests individual conditions within decision statements.
  • Loop Testing – Focuses on validating loops, including single, nested, and unbounded loops.
  • Control Flow Testing – Analyzes the flow of control (execution order) in the code.

 

Step 3. Write the tests

Here comes the tricky part. 

If you're doing manual testing, you don't really have to write the tests, but you still need a test management system to track test results.

If you're doing automation testing, you can code the scripts to execute the test cases on your behalf. Popular test automation frameworks (like Selenium or Playwright) provide testers with all of the necessary commands, syntax, and features to do that with ease. 

A popular type of automation framework to help you write tests faster is the keyword-driven framework. In this framework, the coding parts are abstracted away into keywords. When writing tests, testers only have to group keywords (that represent specific actions) together and specifying the target of those actions. 

For example, this is a sneak peek into the list of keywords available in the Katalon Studio's keyword library. You can choose the Navigate To Url keyword, specifying which URL you want it to navigate to, then use the Click keyword to specify which web element you want to be clicked on. 

One keyword at a time. In no time, you should find yourself with a full test script ready to be executed. Learn more about Katalon Studio here.

 

Types Of Functional Testing and Examples

Functional testing extends from component-level testing all the way to regression testing of existing features. It finds itself in any type of testing involved with functionality. If you are doing regression testing for a certain feature, that is still functional testing.

Let’s look at some popular testing types:

  • Unit Testing – Tests individual pieces of code (like functions or methods) in isolation.
  • Integration Testing – Ensures different modules or components work together correctly.
  • Smoke Testing – A quick, basic test to check if the main functions of the software work properly after a build.
  • Regression Testing – Verifies that recent code changes haven’t broken any existing functionality.
  • Exploratory Testing – Testers explore the software freely to discover issues.

 

Why Automate Functional Testing?

Softwares are powerful. AIs can even paint and write poetry now. If you are not leveraging softwares to test softwares, you are definitely missing out. 
 

Investment into automation testing is the most valuable thing you can do on your testing journey. Functional testing benefits so much from automation. If you embrace TDD, chances are you are writing automated tests so that the dev team can repeatedly re-execute the tests until the feature passes. 
 

With repetitive and time-consuming test cases automated, quality engineers have more time to develop more insightful test scenarios, thoroughly test the product inside-out, and examine the product under edge cases and exploratory testing.
 

Learn more: What is TDD and how to apply it to your daily testing activities? 

 

How to choose your automated functional testing tool?

Functional testing plays a crucial role and is tied to many other activities in the software development life cycle. However, teams usually use a number of fragmented tools that solve separate testing needs, which creates a collection of complex, brittle, and hard-to-scale tool-stacks for quality management.

This means you have 3 options to do functional testing: 

Option 1: Build Your Own Testing Framework with Open-Source Libraries

  • Choose an open-source testing library as the foundation.
  • Use libraries, drivers, design patterns, and coding standards to build.
  • Requires coding and testing expertise but offers high customization.
  • Setup time is significant, but it's budget-friendly.
  • Maintenance and issue resolution may extend testing cycles.

Option 2: Single-Point Commercial Automation Testing Tools

  • Commercial tools for specific testing purposes.
  • Great for focused testing but may lack flexibility as needs evolve.

Option 3: All-in-one software testing solution

  • Integrates all testing functionalities.
  • Streamlines workflows from planning to reporting.
  • Eliminates fragmentation and offers scalability.
  • Initially underutilized but adapts to organizational needs easily.

 

Here's a list of good functional testing tools for your team

 

Functional testing in action with Katalon

Now that you have broken down the user stories into small slices, let's see how you can automate them.

To start, you can download Katalon. In Katalon alone, you can do test planning, write tests, manage them in suites, schedule for execution across environments, and generate test summary reports. This comprehensiveness allows for a lot of customization and flexibility, no matter how complex the application under test is.

 

Download Katalon and Give It A Try

 

Once you have downloaded and installed Katalon, navigate to File > New > Project. You can choose the type of testing for this project, either web, API, mobile, or desktop app. 

 

You have up to 3 modes of test creation:

  1. No-code: turn on the Record-and-Playback mode, and record your screen, just like how an end-user would. Katalon automatically turns that sequence of actions into an executable test script.
  2. Low-code: leverage the rich library of keywords to craft your test scripts. All you have to do is choose the keyword for the action you want to automate and set the parameters. Switch to Full script mode whenever you want.
  3. Full code: write your test scripts in Groovy. Enjoy the customizability along with the simplicity of No-code and Low-code within your hands.

 

Interested? Have a look at the demo here:

Moreover, Katalon sets itself apart by incorporating cutting-edge, native AI features to enhance functional testing. Users can autonomously generate test scripts from plain language input or use the "Explain Code" feature to add comments to code snippets for better understanding among stakeholders and team members. Check out our pioneering AI features here.

Do your team need a better solution for functional testing? Start now with Katalon Studio.

 

Download Katalon and start functional testing for free