0% found this document useful (0 votes)
14 views

Lesson 4

Uploaded by

Yaseen Mythem
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

Lesson 4

Uploaded by

Yaseen Mythem
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Functional&Non functional tests

paramtech.com.tr
©2024. Tüm hakları saklıdır.
Functional testing

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.
Functional 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
Functional testing
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.
Functional testing
Positive Login Page Test Cases
Positive test cases are test cases that follow the “happy path” i.e. testing if the Login page functions as expected under valid inputs. These test
cases explore scenarios where users do what they are supposed to do, such as:

1. Valid username and password combination successfully logs the user in.
2. Testing with the minimum allowed username and password length.
3. Testing with a username and password containing alphanumeric characters.
4. Successful login with the "Remember Me" option selected.
5. Testing login with a username that contains both uppercase and lowercase characters.
6. Successful login using a valid email address as the username.
7. Successful login using a valid phone number as the username.
8. Successful login with multi-factor authentication (MFA) enabled.
9. Testing login with a username that includes special characters (e.g., @, #, $).
10. Successful login using social media accounts (if applicable).
11. Successful login using biometric authentication (e.g., fingerprint, face recognition).
12. Testing login after a password reset to ensure the new password works.
13. Successful login after an account recovery process.
Functional testing
2. Negative Login Page Test Cases
In contrast, negative testing for the Login page aims to explore scenarios that deviate from that “happy path”. Users don’t always do
what we want them to do. Sometimes they do unexpected things, and a good tester understands that unpredictability to test
accordingly. Some common negative test cases you should test on your Login page include:

1. Entering an incorrect password for a valid username.


2. Entering an incorrect username for a valid password.
3. Entering an empty username field.
4. Entering an empty password field.
5. Entering a username that does not exist in the system.
6. Entering a password that does not meet password strength requirements.
7. Testing login with excessive length usernames and passwords.
8. Testing login with incorrect case (uppercase/lowercase) in the username.
9. Testing login with expired or deactivated user accounts.
10. Testing login with suspended user accounts.
11. Multiple consecutive failed login attempts triggering an account lockout.
12. Testing login after the session has expired due to inactivity.
13. Testing login with incorrect multi-factor authentication (MFA) codes.
14. Entering invalid characters (e.g., scripts) in the username or password
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.
Non-Functional testing

. 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?
Non-Functional testing

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.
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.
Aspect Functional Testing Non-Functional Testing

Purpose To verify if the software functions as intended and meets To evaluate non-functional attributes like performance, security, usability,
functional requirements. 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 Unit Testing, Integration Testing, System Testing, User Performance Testing, Security Testing, Usability Testing, Compatibility
Types
Acceptance Testing. Testing.

Test Criteria Pass/fail criteria are often straightforward based on Pass/fail criteria may involve thresholds or benchmarks (e.g., response
expected outcomes. time should be below 2 seconds).

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

Objective Often involves binary outcomes (pass/fail) based on Often involves quantitative measurements and benchmarks for
Measurement
expected behavior. non-functional attributes.

Tools and Functional testing tools may include Selenium, JUnit, TestNG, etc. Non-functional testing tools may include JMeter, OWASP ZAP,
Technologies
LoadRunner, etc.
Non-Functional testing
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.
Functional testing

1) Unit Testing
Unit testing is a vital type of functional testing that involves testing the smallest functional and testable unit of
code. To ensure the highest quality of software, unit testing is an essential part of the software development
process. Below are some key points to keep in mind about unit testing:
● Unit testing is mostly performed by developers, as it is a white-box testing technique.

● It is performed during the earliest stages of development, which helps in uncovering defects during the

initial development phases.

● Various techniques are used in unit testing, including branch coverage, statement coverage, boundary

value analysis, and decision coverage.

● Branch coverage ensures that all the logical paths and conditions are covered during testing.

● Statement coverage ensures that all the statements present in the function or module are traversed at

least once during testing.


Functional testing
2) Integration Testing
During integration testing, the aim is to validate the interaction between two or more unit-tested
components of a software system. To achieve this, the following are tested:
● Communication of commands, data, database calls, API calls, and micro-services processing

between the units

● No unexpected behavior is observed during this integration

There are two types of integration testing: Incremental and Big-Bang. Incremental integration testing
involves combining one or more components in stages and testing them until the entire system is
successfully tested. There are three approaches to incremental integration testing: Top-Down,
Bottom-Up, and Hybrid. The Big-Bang approach, on the other hand, involves integrating and testing
all of the components as a whole system.
Functional testing
3) Interface Testing
Interface testing and integration testing are two distinct types of software testing that are performed to ensure the
seamless performance of software applications. Interface testing is primarily focused on testing the communication
between different interfaces, while integration testing is focused on testing the integrated group of modules as a
single unit. During interface testing, the correctness of data exchange, data transfer, messages, calls, and
commands between two integrated components are tested. Communication between databases, web-services,
APIs, or any external component and the application is also tested during interface testing. There should not be any
error or format mismatch during this data or command communication. If any such problem is encountered, it
needs to be corrected. In summary, interface testing and integration testing are both essential to ensure that
software applications work seamlessly and without any issues.
● Interface testing focuses on testing the communication between different interfaces.

● Integration testing focuses on testing the integrated group of modules as a single unit.

● Interface testing tests the correctness of data exchange, data transfer, messages, calls, and commands between

two integrated components.

● Communication between databases, web-services, APIs, or any external component and the application is also

tested during interface testing.


Functional testing

4) System Testing
System Testing is a crucial phase in the Software Testing Life Cycle (STLC) that ensures that all
components of the system are seamlessly integrated and working together as per the
requirement specifications. This testing technique is a Black-Box testing method that validates
the integrated system against the predefined requirements. System Testing is performed in an
almost real-life environment and according to real-life usage. It is essential to perform System
Testing before the User Acceptance Testing (UAT) to ensure that the system is fully functional and
meets the business requirements. The following bullet points summarize the key aspects of
System Testing:
● All components of the system are combined and tested against the requirement specifications

(Functional or System).

● It is a Black-Box testing technique that validates the integrated system.

● System Testing is performed in an almost real-life environment and according to real-life usage.
Functional testing

4) System Testing
System Testing is a crucial phase in the Software Testing Life Cycle (STLC) that ensures that all
components of the system are seamlessly integrated and working together as per the requirement
specifications. This testing technique is a Black-Box testing method that validates the integrated system
against the predefined requirements. System Testing is performed in an almost real-life environment and
according to real-life usage. It is essential to perform System Testing before the User Acceptance Testing
(UAT) to ensure that the system is fully functional and meets the business requirements. The following
bullet points summarize the key aspects of System Testing:
● All components of the system are combined and tested against the requirement specifications

(Functional or System).

● It is a Black-Box testing technique that validates the integrated system.

● System Testing is performed in an almost real-life environment and according to real-life usage.
Functional testing
6) Smoke Testing
After the development of an application, it is essential to ensure that all major functionalities work seamlessly.
Smoke Testing is performed for the newly released build to ensure that the application is ready for the next level
of testing. Smoke testing is usually done for the builds created during the initial phase of development, which
are not yet stable. The goal of Smoke Testing is to verify that the application’s critical functionalities are working
correctly, and the build is stable enough to move to the next level of testing. If any major functionality is not
working as expected during testing, that particular build is rejected, and developers need to fix the bugs and
create a new build for further testing. Once the Smoke Testing is successful, the application is ready for the next
level of testing.
In summary, Smoke Testing is an essential testing technique that helps ensure that the newly released build
meets the required quality standards. Here are the key points to remember:
● Smoke testing is done to verify that the application’s critical functionalities are working correctly.

● Smoke testing is usually performed on the builds created during the initial phase of development, which are

not yet stable.

● If any major functionality is not working as expected during testing, that particular build is rejected, and

developers need to fix the bugs and create a new build for further testing.
Functional testing
7) Sanity Testing
Sanity testing is an essential type of testing that covers the major functionalities of an application. It is normally
performed on a new build created by developers for a relatively stable application. The main aim of this testing is
to verify whether the application is working as expected or not. Once the application passes the Sanity Testing, it
is considered ready for the next level of testing. Here are some key points to remember about Sanity Testing:
● Sanity Testing is mainly focused on the major functionalities of an application.

● It is performed on a new build that has been created by developers.

● The aim of this testing is to ensure that the application is working as expected and meets the basic

requirements.

● It is essential to note that Sanity Testing is not a replacement for other types of testing, such as Smoke

Testing or Regression Testing.


Functional testing
8) Acceptance Testing
Acceptance testing is a crucial step in the software development life cycle, which aims to ensure that
the developed system meets all the requirements agreed upon during the business requirement
creation. This type of testing is performed just after the System Testing and before the final release of
the application in the real world. Acceptance testing becomes a criterion for the user to either accept or
reject the system, which makes it a crucial step in the software development process.

Here are the different types of Acceptance Testing:


User Acceptance Testing: This type of testing is performed by real users to ensure that the application
meets their needs and expectations. It is also known as Beta Testing, which is done at the client site.
Business Acceptance Testing: This type of testing is performed to ensure that the application is able
to meet business requirements and goals. It is done to ensure that the application is ready for
deployment and will help the business achieve its objectives.
Regulation Acceptance Testing: This type of testing is performed to ensure that the developed
application does not violate any legal regulations put in place by the governing bodies. It is done to
ensure that the application is compliant with legal requirements and can be deployed without any
legal issues.
Functional testing
Functional Testing Techniques
Functional testing

Equivalence Class Partitioning


In equivalence partitioning, the testers will divide the inputs into classes or groups of data that are expected to
produce similar results. It helps reduce the number of test cases and provides a high test coverage.
For example, if an application accepts numerical inputs from 1 to 10, you might choose test cases from three classes,
that is, less than 1, between 1 and 10, and greater than 10.
Functional testing

Boundary Value Analysis


Boundary value analysis focuses on testing the boundary values between equivalence classes. It
includes testing both the minimum and maximum values along with values just inside those
boundaries.
For example, if the application accepts passwords of lengths 8 to 14, then you would test with values
like 7,8,14, or 15.
Functional testing
Decision-Based Testing
The decision-based testing technique involves creating test cases based on the decision points or conditions in
the code.
That is, you would create test cases to cover every user condition. For example, consider the below scenario,
1. If the user enters the wrong credentials to log in to the application, then the system should throw an error.

2. If the user enters the correct credentials, then the application should redirect the user to the home page.
3.

Ad hoc Tests
Ad hoc tests are unplanned tests that are performed without using a specific test case or script. Testers use
domain knowledge, intuition, and experience to explore the application to find hidden bugs.
You can use these testing techniques in various combinations, depending on the nature of the application
and its requirements. They help ensure that software is thoroughly tested and reliable before its release.
Functional testing

Functional Testing Process: Typical Steps


Functional testing involves testing the application’s UI, APIs, databases, and functionality. The below steps
depict how testers usually perform functional testing manually or using automated testing tools. Though,
these steps may vary from project to project. Let’s dive in.
Functional testing
Step 1 – Requirements Analysis
Understand and analyze the functional requirements of the software.
Step 2 – Test Planning
Create a detailed test plan based on these requirements. Identify the functionalities that need to be tested. Define the
testing environments and tools required. Select a perfect test automation platform that fits your development pipeline.
Step 3 – Test Case Design
Write detailed test cases that cover all the functional aspects of the software.
Step 4 – Test Data Preparation
Create test data that will be used for testing. It may include valid and invalid input data for negative and positive testing.
Step 5 – Execute Tests
Run the test cases according to the test plan. Log the actual results, including any deviations from the expected results.
Step 6 – Compare Results
Now, compare the actual test results with the expected test results.
Step 7 – Test Reports
Once you have analyzed the test results, create a detailed test report outlining the test cases’ status.
Once the developers fix the reported defects, retest the application to ensure it is free of bugs. This repeated testing is
called regression testing.
Functional testing

Benefits of Functional Testing


Some of the advantages of functional testing include,
● It will help identify bugs or inconsistencies in the application.

● You can provide users with a pleasant and positive user experience with thorough functional testing.

● Functional testing and regression testing go hand in hand. It is crucial for maintaining the application’s stability

as it ensures that new code changes or bug fixes do not break existing functionalities.

● With functional testing, you check the entire application’s features and functionality, like UI, API, database,

integrations, etc. API functional testing is crucial to ensure the client/server communications work properly.

● While functional testing mainly focuses on testing the features and functionalities, it can also help identify

certain security issues, such as authorization issues, input validation problems, and so on.

● It improves the overall quality and stability of the application.


Teşekkürler

paramtech.com.tr
©2024. Tüm hakları saklıdır.

You might also like