Functional Testing

Functional testing checks what a system does: the functions it should perform and the results they produce. ISTQB states its main objective as checking three things: functional completeness, functional correctness and functional appropriateness. If a requirement says the promo code WELCOME10 takes 10% off the items in a cart, a functional test applies the code to items worth 200.00 SAR and checks that the discount is exactly 20.00 SAR.

Its expected results come from requirements, user stories and acceptance criteria, not from the code, so functional tests are usually designed black-box. How fast, secure or easy to use a feature is belongs to non-functional testing, the next lesson.

Why it matters

People use software to get a job done: pay a bill, book an appointment. When a function is missing, gives a wrong result or makes the job needlessly hard, users notice at once, and with money or personal data a wrong result does harm even when nothing crashes. A fast, secure checkout that shows the wrong total is still a failure.

For a tester, functional testing is the core of daily work. It also builds the habit everything else depends on: working out the expected result from the test basis before you look at what the system does.

A test type you apply at every test level

ISTQB groups tests by level and by type. Functional testing is a test type: it asks what the test object should do, while non-functional testing asks how well it behaves. Every test type can be applied at every test level, so each level from the previous lessons gets functional tests; only the test object grows.

  • Component: the discount function returns 20.00 for a subtotal of 200.00 and the code WELCOME10.
  • Integration: the cart service sends the discounted total, not the original one, to the payment service.
  • System: at checkout in the browser, applying the code adds a discount line and a new total.
  • Acceptance and end-to-end: a customer applies the code, pays and receives a confirmation that shows the discounted amount.

Completeness, correctness and appropriateness

These three are the sub-characteristics of functional suitability in ISO/IEC 25010, which you met in the lesson on software quality. They cover stated needs, written in the requirements, and implied needs that nobody wrote down. Each one gives you a different question to ask of the same feature:

  • Functional completeness: do the functions cover all the specified tasks and user objectives? A promo-code feature with no way to remove an applied code is incomplete, however well the rest works.
  • Functional correctness: do the functions give accurate results? Check calculations, stored data, state changes and messages against the rule. A 10% discount on 249.95 SAR must be rounded the way the business decided, not the way the code happens to round.
  • Functional appropriateness: do the functions help users complete their tasks without unnecessary steps? If the code field exists only in the cart, a customer at the payment step must go back to use it: the function is present and correct, but not appropriate. How easy a supported task is to perform is usability (called interaction capability in ISO/IEC 25010:2023), a non-functional question.

The test basis: requirements and user stories

Functional tests are usually designed black-box: you derive them from documentation external to the test object, without reading its code. Some teams use "functional" and "black-box" as synonyms, but ISTQB keeps them apart: functional says what is checked, black-box says where the tests come from. A developer’s unit test of the discount function is functional even though it was written with the code open.

Typical test basis for functional tests:

  • Requirements, specifications and business rules, such as "orders of 300.00 SAR or more ship free".
  • User stories and their acceptance criteria, the main basis in agile teams.
  • Use cases, for flows with alternatives and exceptions.
  • API contracts, regulations, user manuals or a system being replaced, when the team agrees they apply.

Try it: Requirements → Test Cases Try it: Acceptance Criteria Generator

The anatomy of a functional check

Every functional check has the same parts: the state the system starts in, an input or action, the rule from the test basis, and the expected output that the rule predicts. Take a cart with items worth 200.00 SAR plus a 15.00 SAR delivery fee, and the criterion "WELCOME10 takes 10% off the item subtotal; the delivery fee is not discounted". For the input WELCOME10, the rule predicts a 20.00 SAR discount and a total of 195.00 SAR.

One functional check of the promo code: state, input and rule AC-1 predict a 20.00 SAR discount and a 195.00 SAR total, written down before the run and then compared with the actual output.

Check F1 from the worked example

Part 1:state     items 200.00 SAR + delivery fee 15.00 SAR
Part 2:input     promo code WELCOME10, then Apply
Part 3:rule      AC-1: 10% off the item subtotal; fee not discounted
Part 4:expected  discount 20.00 SAR, total 195.00 SAR
Part 5:actual    discount 20.00 SAR, total 195.00 SAR
  1. 1StateThe precondition: what is in the cart before the input.
  2. 2InputWhat the tester enters or does.
  3. 3Rule from the test basisAcceptance criterion AC-1 decides the result, and the check traces to it.
  4. 4Expected outputWorked out before the run: 10% of 200.00 is 20.00, and 215.00 minus 20.00 is 195.00.written first
  5. 5Actual outputIt matches the expected output, so the check passes. A total of 193.50 would be a failure: the fee was discounted too.Pass

Write the expected output down before the run. Afterwards it is easy to accept whatever the screen shows: 193.50 SAR looks plausible, but it means the fee was discounted too. That is a failure, and the report names the rule it breaks.

When the basis is silent, for example on how to round 24.995, the silence is itself a finding: ask the product owner and record the answer, or record the assumption you tested against.

Worked example: functional checks for a promo code

The story and its four acceptance criteria below are the test basis. The tester derives at least one check per criterion, works out every expected output in advance, then asks the three questions of the whole feature.

  • Correctness: F1 and F2 test the calculation, F3 to F5 the rejection rules. F2 has no expected result yet because AC-1 gives no rounding rule, so the tester asks before testing.
  • Completeness: F6 needs a remove function. If the build has none, that is a missing function, a functional defect.
  • Appropriateness: the story says "at checkout", so the tester confirms that the code field is available on the payment step, not only in the cart.
  • Not in the table: how fast the discount appears, or whether codes can be guessed. Those are non-functional questions.
Story PROMO-31
As a customer, I want to apply a promo code at checkout
so that I pay the discounted price.

AC-1  WELCOME10 takes 10% off the item subtotal. The delivery fee is not discounted.
AC-2  An expired or unknown code is rejected with a message; the total does not change.
AC-3  Only one code per order: a second code is rejected with a message.
AC-4  The customer can remove an applied code before paying.

Cart unless stated: items 200.00 SAR + delivery fee 15.00 SAR = 215.00 SAR

Check  Basis  Input or action                  Expected output
F1     AC-1   apply WELCOME10                  discount 20.00, total 195.00
F2     AC-1   items 249.95, apply WELCOME10    discount 24.995: 25.00 or 24.99? Ask.
F3     AC-2   apply SUMMER24 (expired)         rejected with a message, total 215.00
F4     AC-2   apply WELCOM10 (typo)            rejected with a message, total 215.00
F5     AC-3   WELCOME10 applied, apply VIP5    VIP5 rejected with a message, total 195.00
F6     AC-4   remove WELCOME10                 no discount line, total 215.00

Try it: User Story → Test Cases Try it: Percentage Calculator

Common mistakes

  • Taking the expected result from what the system shows instead of working it out from the test basis.
  • Checking only correctness on the happy path (the normal flow with valid input), and never asking whether a promised function is missing or fits the user’s task.
  • Treating functional testing as a test level, or as another word for black-box or manual testing.
  • Writing vague expected results such as "discount applied correctly" instead of the exact amount, message or state.
  • Guessing when the requirement is silent instead of asking and recording the answer.

The QA perspective

Functional testing starts at refinement, before any code exists: for each criterion, ask what state, inputs and outputs it implies and where it is silent. The rounding question costs a minute there and a defect fix after release. Agree with the developers who checks what: unit tests usually cover single functions, while you focus on the system and acceptance levels and on the joins between components.

Record each check with the criterion it traces to, its state, input and exact expected output. A failed check then becomes a precise bug report: "AC-1: items 200.00 + fee 15.00 with WELCOME10 should total 195.00; actual 193.50, the fee was discounted." Traceability also lets you report results per requirement, not just a count of passed tests.

Practice exercise

Write functional checks for an appointment cancellation

Your task

A clinic app has the story and acceptance criteria below. Write at least six functional checks in the form state, input, rule and expected output, each traced to a criterion.

Label each check as completeness, correctness or appropriateness, and list what the story leaves open as questions for the product owner.

Material
Story APPT-7
As a patient, I want to cancel an appointment in the app
so that the slot is freed for another patient.

AC-1  A patient can cancel an upcoming appointment from "My appointments".
AC-2  Cancelling 24 hours or more before the start is free. Later cancellations
      cost a 50.00 SAR fee, shown before the patient confirms.
AC-3  After cancelling, the slot can be booked again and the patient
      receives a confirmation SMS.
AC-4  Past appointments cannot be cancelled.
Steps
  1. Restate each criterion as a rule in your own words.
  2. Write at least one check per rule, with the expected output worked out now.
  3. Label each check by objective.
  4. List the open questions.
Show the model answer
Model answer

Correctness: F1 (AC-2) appointment in 3 days, cancel → no fee, status Cancelled. F2 (AC-2) exactly 24 hours before → free, because the rule says "24 hours or more". F3 (AC-2) 23 hours before → a 50.00 SAR fee is shown before confirming. F4 (AC-2) the patient sees the fee and goes back → appointment unchanged, no fee.

Correctness across components: F5 (AC-3) after cancelling, another patient can book that slot. F6 (AC-3) the patient receives an SMS that names the cancelled appointment. If no SMS is sent at all, a promised function is missing (completeness); an SMS naming the wrong appointment is a correctness problem.

Completeness: F7 (AC-1) "My appointments" offers a cancel action on every upcoming appointment. Correctness: F8 (AC-4) a past appointment has no cancel action. Appropriateness: F9 (AC-1) a patient can cancel in a few steps, without phoning the clinic.

Open questions: whose time zone decides the 24 hours? When is the fee collected? Does an appointment that has started but not ended count as past? Does the cancellation stand if the SMS cannot be delivered? Can a patient undo it?

Frequently asked questions

Is functional testing the same as black-box testing?

No. Functional testing is about what is checked: the functions and their results. Black-box testing is about where the tests come from: documentation outside the test object. Most functional tests are designed black-box, but a developer’s unit test of a function is functional too, even though it is written with the code open.

Is functional testing manual or automated?

Either. The term describes what is tested, not how the test is run. Stable checks that are repeated on every change are good candidates for automation; new features are often tested by hand first. Later lessons cover what to automate.

What is the difference between functional and non-functional testing?

Functional testing checks what the system does, for example whether checkout calculates the right total. Non-functional testing checks how well it does it: how fast, how secure, how easy to use, on which devices. Most features need both, and the next lesson covers the non-functional side.

What if there are no written requirements?

Use whatever states the expected behaviour: the system being replaced, a user manual, domain rules, regulations or a conversation with the product owner. Write down the rule you test against and get it confirmed, so that your expected results do not rest on your own guess.

References

Practise with Mutqan tools

Convert a user story (As a / I want / So that) into structured test cases using templates and heuristics.

Test Design

Convert a list of numbered requirements into traceable test cases with a requirement-to-test matrix.

Test Design

Generate structured test cases (id, title, preconditions, steps, expected result, priority) from a feature description and field list.

Test Design

Calculate percentages, percentage change, increase/decrease and what percent X is of Y.

Utilities

Go deeper

Your progress on this topic

Part of the QA Roadmap