Skip to content
Tutorials Center
My learning

Topics

Lesson 6 of 60 ยท Testing Fundamentals

Test Types: Functional, Non-functional, Structural, Change-related

Learn the main software test types: functional, non-functional (performance, usability, security, compatibility), structural, confirmation and regression testing.

Test levels say where in the system you test. Test types say what you are trying to find out. Is the feature correct? Is it fast enough? Is it pleasant to use? Is it safe? Did yesterday's change break something that used to work? Each question calls for a different kind of test, and a good test effort mixes several.

This lesson groups test types into four families: functional, non-functional, structural and change-related. For each family you will see the question it answers, common examples, and how it connects to later chapters. At the end, a small JavaScript stand-in classifies sample tests, which is surprisingly good practice for thinking in types.

Four families of test types

Functional Does it do the right things?
Non-functional How well does it do them?
Structural Have we exercised the code itself?
Change-related Did the change fix it, and break nothing?

One test can belong to more than one family.

1 / 2

Functional testing

Functional testing checks what the system does: the features, calculations, rules and workflows described by the requirements. It is usually black-box testing, which means the tester works from the specification and the behavior and does not look at the code.

Typical questions and examples:

  • Does the discount code reduce the price by the stated percentage?
  • Can a user reset a forgotten password and log in with the new one?
  • Does the search return the items that match the query, and none that do not?

Functional tests are designed with the techniques of the next chapters, such as equivalence partitioning and boundary value analysis. Their coverage is measured against the requirements ("did we test every feature and rule?"), not against the code.

Non-functional testing

Non-functional testing checks how well the system does what it does: the qualities introduced in QA, QC and Testing. The functions can all be correct and the product can still be unusable if it is too slow, confusing or unsafe.

Type Question Example check
Performance (load, stress) How fast, and how much load can it take? Does the search page respond within 2 seconds for 500 users at once?
Usability Can users learn and use it with ease? Can a first-time user find the "change address" form in under a minute?
Accessibility Can people with disabilities use it? Can the whole checkout be completed with a keyboard and a screen reader?
Security Does it protect data and resist abuse? Can a user open another user's order by editing the URL?
Compatibility Does it work across browsers, devices, systems? Does the layout hold on a small phone and an old browser version?
Reliability and recovery Does it keep working and recover after faults? Does the service return after a database restart without losing orders?
Localization Does it suit different languages and regions? Do dates, currencies and long German words display properly?

Non-functional requirements are often vague ("the system must be fast"), so a first job is to make them measurable, for example "95 percent of requests under one second at 200 concurrent users". Chapters 6 and 7 cover most of these types in more depth.

Structural (white-box) testing

Structural testing designs tests from the internal structure of the software: its code, architecture or data flow. The goal is to exercise the structure and measure how much of it was run. It is called white-box (or glass-box) testing because the tester can see inside.

Examples: choosing inputs so that every if statement takes both its true and false branch, or checking that every module is called by at least one integration test. Coverage measures such as statement and branch coverage are the common yardsticks (see White-Box Testing and Code Coverage). Structural coverage can reveal code that tests never touch, but it can never show missing features, because only the requirements know what should exist.

Black-box (functional) and white-box (structural) are not rivals. Functional tests find what the requirements say should happen; structural tests find what no functional test has reached.

Software changes constantly: new features, bug fixes, configuration updates. After a change, two questions arise, and each has a named type of test.

  • Confirmation testing (re-testing): Did the fix actually fix the reported defect? You repeat the test that failed, with the same steps and data, and expect it to pass now.
  • Regression testing: Did the change break anything that used to work? You re-run a set of previously passing tests that cover related or important behavior. Because the set is run again and again, it is the prime candidate for automation.

The difference matters: confirmation testing is narrow and about one defect; regression testing is broad and about side effects. After a bug fix you do both, and usually in that order.

Two relatives you will meet in a test cycle (see Test Execution and Result Tracking) are smoke tests, a quick check that the most basic and critical functions work so that a build is worth testing further, and sanity tests, a brief focused check that a specific change or fix behaves reasonably before deeper testing.

flowchart LR
  A["Bug reported"] --> B["Developer fixes it"]
  B --> C["Confirmation test<br/>(does the fix work?)"]
  C --> D["Regression tests<br/>(did it break anything?)"]
  D -->|"all pass"| E["Ready to close"]
  C -->|"still fails"| A
  D -->|"new failure"| A

A fix is only done when the original failure is gone and nothing else broke.

Confirmation and regression in code

The stand-in below plays out the cycle. Release 1 has a defect: shipping is not free for orders of exactly 50. Run the confirmation test and the regression pack against the broken version and the fixed one. The "fix" in this example is deliberately sloppy so that you see why regression testing exists.

JS Confirmation test and regression pack

Press Run (or Ctrl + Enter) to see the console output here.

No output.

In release 2 the confirmation test passes, but the regression pack catches a new failure. If the team had only re-run the failing test, they would have shipped a new defect. That is exactly the situation regression testing exists for.

One test, several types

A single test can belong to several types. "Log in with a valid password within two seconds" is functional (login works) and non-functional (performance). "Run the checkout tests after each code change" is functional in content and regression in purpose. Types describe purposes, so ask what a test is meant to tell you.

The stand-in below classifies sample tests with a small keyword rule. It is only a toy (real classification needs human judgment), but writing the rules down shows how many tests carry more than one label.

JS Classifying sample tests by purpose

Press Run (or Ctrl + Enter) to see the console output here.

No output.

Each test gets one label here, and the two checks about "after the fix" and "again after" differ only in intent, which is why keywords alone cannot tell them apart in general. Change a sentence or a rule to see how the classification moves, and notice that a plain keyword like "load" would have wrongly matched the word "download": real classification needs human judgment.

Choosing types for a product

You cannot do everything (principle two). Choose test types by asking what could hurt the product and its users most. An online shop needs strong functional, security, performance (sale days) and compatibility testing. An internal expense form needs mostly functional and usability testing. A medical device adds reliability and regulatory checks. The next chapters give you the techniques to design the tests inside each type, starting with static testing and reviews.

Check your understanding

Quick check ยท 5 questions

of 5 answered You scored / 5 ยท perfect!

  1. 1. After a developer fixes bug #512, you repeat the exact steps that originally failed and confirm they now pass. What is this?

    Confirmation testing (re-testing) checks that a specific fix worked. Regression testing is the broader search for side effects.
  2. 2. Which of these is a non-functional test?

    Response time under load is about how well the system performs, which makes it a non-functional (performance) test.
  3. 3. What can structural (white-box) coverage never reveal?

    Coverage measures the code that exists. A feature that is missing has no code to measure, so only the requirements can expose it.
  4. 4. Why is regression testing a prime candidate for automation?

    The same tests are needed again and again, so automation pays back quickly and gives fast feedback.
  5. 5. A test checks that login succeeds with a valid password and finishes within 2 seconds. How would you classify it?

    It verifies a function (login works) and a quality (speed), so it belongs to two types.

Summary

  • Test levels say where you test; test types say what you want to learn.
  • Functional tests check what the system does against the requirements, usually black-box.
  • Non-functional tests check how well: performance, usability, accessibility, security, compatibility, reliability and localization.
  • Structural tests are designed from the code or architecture and measured with coverage; they cannot find missing features.
  • Confirmation testing checks that one fix worked; regression testing checks that the change broke nothing else. Do both after a fix.
  • One test can have several purposes, so label by intent.

Next up: Static vs Dynamic Testing.