Tosca tester
Functional testing
There is a file that defines what is acceptable behaviour in software application and what is not. It is a functional specification or requirements specification. A requirements specification is a document that describes what the software is supposed to do and includes a description of functional and non-functional requirements.
- Functional requirements describe what the software should do. They include descriptions of the functions that software must provide, as well as the inputs and outputs of those functions.
- Non-functional requirements describe features of the software that are not directly related to its functionality. They include requirements for performance, reliability, safety and usability.
Requirements specification is important for software testing because it provides testers with the information they need to design and execute tests. So let’s take a look at what exactly functional testing is.
Functional testing – definition
Functional testing is a type of software testing in which the basic functions of an application are tested against a predetermined set of specifications. In functional testing, each function is tested by specifying a value, determining the output and verifying the actual output against the expected value.
Functional testing is performed as black box testing, which is presented to confirm that the functionality of an application or system behaves as expected.
Functional testing is also called black box testing because it focuses on the application’s features rather than the actual code. The test results are binary: pass/fail.
There are two functional testing techniques than can be performed:
- Requirements Based Testing: contains all functional specifications that form the basis for all tests to be performed.
- Business Scenario Testing: contains information on how the system will be perceived in terms of business processes.
Objectives of functional testing
- Verify that the software meets its functional requirements.
- Identify bugs in the software.
- Improve software quality.
- Verify that the software is processing input/output data correctly.
- Verify that the software responds correctly to various input data.
- Verify that the software works correctly in different scenarios.
What is the functional testing process?
In functional testing, every IT tester follows the following steps:
- The tester performs verification of the requirement specification in the software application.
- After analyzing the requirements specification, the tester creates a test plan.
- After scheduling the tests, the tester designs a test case.
- Once the test case is designed, the tester creates a traceability matrix document.
- The tester performs the test case design.
- A coverage analysis will be created to examine the application’s covered testing area.
- Defect management should address the errors that occur.
See also the functional testing checklist and make sure you don’t forget anything.
Functional testing vs non-functional testing
Functional tests verify that specified functional requirements are met, while non-functional tests can be used to test non-functions such as performance, security, scalability or application quality. In other words, functional testing is concerned with whether key functions in the application work correctly and non-functional testing is more concerned with how operations are performed, i.e., they are interested in performance, security, usability and more.
Types of functional testing include: Unit Testing, Integration Testing, System Testing, User Acceptance Testing, Regression Testing, Sanity Testing, etc.
While non-functional testing includes: Performance Testing, Security Testing, Usability Testing, Compatibility Testing, Load Testing, Stress Testing, Volume Testing, Penetration Testing, Migration Testing.
Regarding test criteria for functional testing, pass/fail criteria are often simple and based on expected results. However, for non-functional testing, pass/fail criteria may include thresholds or benchmarks (e.g., response time should be less than 2 seconds).
Functional testing types
We are familiar with various functional testing types:
- Unit testing: unit testing is a type of functional testing technique in which the smallest parts or modules of an application are tested. It ensures that each module is working properly.
Example: a restaurant needs an app to help customers order food at a table without service. The developer will create a unit test to explore the “add to order” feature. Other features, such as “remove from order” or “send order”, would also go through unit testing.
- Integration testing: integration testing tests the combined parts of the program as a group and detects errors in the interaction between the integrated parts.
Example: users can set up a savings account in the banking app. It includes the ability to transfer money from their main account to a savings account. Since these are separate modules, testers must perform integration testing to ensure that transactions between them run smoothly and correctly.
- Smoke testing: Smoke testing is a type of functional testing technique in which the basic functionality or feature of an application is tested because it ensures the most important function is working properly.
Example: a utility company has created an application with an outage reporting feature at customers’ homes. This feature will report address and other important information, as well as alert the homeowner when a dispatcher is on his way to assist. Smoke testing will validate this feature at a basic level to ensure that when an outage is reported, the correct information is sent so that the dispatcher can arrive on the correct location in time.
- User Acceptance Testing: user acceptance testing is performed by the client to confirm that the system meets the requirements and functions as intended. This is the final phase of testing before the product is released into production.
Example: suppose a customer buys a new pair of shoes from an online shoe store. UAT tests verify that the customer can successfully add the desired shoes to the shopping cart and pay.
- Interface Testing: Interface testing is a type of software testing technique that checks for proper interaction between two different software systems.
Example: a customer tries to pay for an order via Paypal in an online shopping app. During interface testing, it is verified that the Paypal application is filled in correctly and the payment is processed.
- Usability Testing: usability testing is performed to measure how simple and user-friendly a software application is.
Example: a group of users are asked to complete a set of tasks when using an online shopping application, for example: a user is asked to find a specific product, such as a pair of white running shoes. The user is observed while searching for the product and navigating the app. Next, the user is asked to add the item to the shopping cart. The user is observed as they add an item to the cart and proceed to checkout and complete the checkout process. The customer’s intuition and ability to navigate the system is assessed.
- System testing: system testing is a type of software testing that is performed on a complete integrated system to evaluate the system’s compliance with the relevant requirements.
Example: a fitness app was created with options such as setting and tracking monthly fitness goals, listing fitness metrics, creating personal workout plans and smartwatch integration. Each of these features will be considered individually as well as all together when testing the system.
- Regression Testing: regression testing is performed to ensure that changes to the code would not affect the existing functionality and features of the application. It focuses on whether all the parts work or not.
Example: a food delivery app has added a feature that helps users add multiple discount codes at once. A regression test needs to be performed to ensure that the checkout and payment process will not be affected.
- Sanity Testing: sanity testing is a subset of regression testing and is performed to make sure that the implemented code changes work as expected.
Example: on an e-commerce website, users cannot add a specific product to their cart even if it is in stock. Once the problem has been corrected, validation testing will be performed to ensure that the “add to cart” function is actually working.
- White box testing: white box testing is a type of software testing that allows the tester to verify the internal functionality of a software system. This includes analysis of the code, infrastructure and integration with the external system.
Example: a developer is testing a function that calculates the sum of two numbers. Examines the function code to identify potential errors or deficiencies. The tester creates test cases that cover all possible inputs and outputs of the function. Execute test cases and monitors results. If any bugs are found, the developer will debug and fix the code.
- Black Box Testing: Black box testing is a type of software testing that tests the functionality of a software system without examining the inner functionality or structures of the software system.
Example: a tester is testing an ATM application. The tester will review the ATM application requirements to understand its functionality. He creates test cases that cover all the major features of the ATM application. Execute test cases and monitors results. If any bugs are found, the tester will report them to the development team.
- Database testing: Database testing is a type of software testing in which the schema and tables of the database under test are checked.
Example: a tester is testing a database application. He examines the database schema to understand the structure of the database. Then creates test data that covers all the different types of data that will be stored in the database. Executes test cases that insert, update and delete data from the database. The tester verifies that the data in the database is accurate and complete. If performance issues are found, the tester will report them to the development team.
- Adhoc testing: adhoc testing, also known as monkey testing or random testing, is a type of software testing in which no documentation or test plan is followed during testing.
Example: suppose a developer is working on a new feature of a web application. He has finished coding the feature and wants to make sure it works as expected. Instead of writing formal test cases, he can start using the feature randomly, clicking different buttons and entering different data. This is an example of ad hoc testing.
- Recovery Testing: recovery testing is a type of software testing that verifies the ability of software to recover from failures such as hardware failures, software failures, crashes, etc.
Example: consider an online banking application. A network outage or server failure may occur during the transaction. Recovery testing would involve simulating these scenarios and verifying that the application handles the interruption gracefully, the application should not suddenly freeze or display error messages. It should maintain the integrity of transaction data and ensure that information is not lost or corrupted. The application should provide the user with clear instructions or options to resume the transaction or perform alternative actions. Once the interruption has been removed, the application should resume its normal functionality without having to perform a full restart.
- Static Testing: Static testing is a type of software testing that is performed to check software bugs without actually running the software application code.
Example: this is a line-by-line manual review of the code to identify potential errors or deficiencies.
- Greybox testing: greybox testing is a type of software testing that includes black and white box testing.
Example: a tester is testing a web application. He first examines a section of the web application code to understand its general structure and functionality. Then creates test cases that cover both known and unknown areas of the web application. Later, he executes test cases and monitors the results. The tester uses tools to analyze the code for potential bugs or flaws. If any bugs are found, the tester will report them to the development team.
- Component testing: component testing, also known as program testing or module testing, is a type of software testing that is performed after unit testing. Test objects can be tested on their own as a component without integration with other components.
Example: the health services app has a feature that helps patients schedule appointments with doctors of their choice. The part that needs to be tested is the way the system displays “nearby” hospitals or health centres using the user’s GPS data. To test this feature, the user profile is stub, and healthcare provider schedules is driver.
Functional testing API (functional testing API)
API functional testing is a type of software testing that verifies the functionality of application programming interfaces (APIs). It helps ensure that the application and APIs perform as expected under the specific workload they can handle.
APIs are the engines that power our software applications. They allow different systems to communicate with each other and transfer data seamlessly. But just like any other engine, APIs can break down and malfunction if not tested properly.
This is where functional API testing comes in. It involves testing the behaviour and functionality of the API to ensure that it performs as expected, meets specified requirements and returns the correct response in different scenarios.
Example: verify that the API can retrieve flight information based on the specified parameters.
- Departure point: Vienna
- Destination: Mumbai
- Departure date: 01-05-2023
- Return date: 25-05-2023
- Number of passengers: 2
- Expected output –
The expected output is checked through the Status and Response body as shown below:
- Status: if the response status code is 200, then the API was executed successfully.
- Response body: the body of the response will contain a list of all flights that meet the above criteria. In this case, the result will be flights by Air Arabia, Air India, IndiGo, Air France, etc.
In addition, when customers confirm their booking and decide to pay the ticket price using any online payment platform such as Stripe or Paypal, testers need to test that the travel app can communicate with the payment service to ensure a successful and secure payment for users.
Functional testing tools
Selenium
Selenium is an open-source project covering a range of tools and libraries developed to support the automation of web applications.
- The Selenium test script can be written in programming languages such as Java, C#, Python, Ruby, PHP, Perl and JavaScript.
- Selenium offers record and playback functionality with its Selenium IDE browser plug-in.
- The powerful Selenium WebDriver tool helps you create more complex and advanced automation scripts.
- Price: the tool is open-source, so it is free.
QTP
The QTP tool is a tool designed to perform automated functional testing without the need to monitor the system.
- It can be used to test web, desktop and client-server applications.
- It is based on VB scripting language.
- It is one of the widely used automation tools in the testing industry.
JUnit
JUnit is an open-source unit testing framework for the Java programming language. It is used to write and execute automated test cases.
- It can be used with Selenium WebDriver to automate web application testing.
- It provides several annotations to identify test methods.
- It has test triggers to run tests for a set time.
SoapUI
It is one of the leading tools for testing SOAP and web services. It makes it easy and fast to create and execute functional, regression and stress tests.
- The software’s graphical interface is easy to navigate and use.
- The vulnerability testing feature helps secure websites from hackers and viruses.
- Detailed analysis can be performed using the reporting function.
- The SQL Injection function, which can be used to perform functional testing, provides several standard SQL queries and methods to identify application weaknesses.
Cucumber
Cucumber is an open-source testing tool written in Ruby.
- This tool works best in test-driven development.
- It is used to test many other languages such as Java, c# and Python.
- This tool focuses on the end-user experience.
- Quick and easy setup and test execution.
- This tool makes it easy to reuse code in tests due to the test writing style.
Functional testing best practices
- Automate: functional tests can be repetitive, time-consuming processes, so the more automated the tests are, the faster can bugs be identified and fixed, and the more time and costs can be saved.
- Dedicated automation team: automation takes time, effort and special skills. It is considered the best to assign automation tasks to those who are skilled enough to perform them.
- Early test creation: it is best to create test cases when the project is in its early stages, as the requirements are fresh in the mind and it is always possible to change the test cases later in the project’s development cycle.
- Choose the right tests: it is very important to choose the right test cases for automation. Some tests require setup and configuration during and before execution, so it is better not to automate them. Automate tests that must be run repeatedly, tests that are more prone to human error.
- Prioritize: testers have limited time and budget, so it’s not possible to test every feature in the app. When creating test cases, consider high-priority features first.
Functional testing interview questions
If you want to learn more about functional testing or prepare for an interview, I recommend going through a few interview questions that will give you the answer right away. Find the questions here:
- Functional testing interview questions 1
- Functional testing interview questions 2
- Functional testing interview questions 3
You can download the functional testing template here – functional testing template.
If you are an IT tester and you speak German, take a look at our employee benefits and respond to job offers.