Non-functional testing
Non-functional testing checks software qualities such as performance, reliability, security, usability and scalability, using measurements and experiments rather than checking specific functional requirements.
Drafted with Aria, reviewed by the AiCanCode.org team · Updated . How we write and check our notes. Spotted an error? Use Give Feedback at the bottom of the page.
Why it matters
Engineers use non-functional testing when they must ensure a system not only does the right things (functional testing) but also meets quality targets such as speed, reliability, security and usability under realistic conditions. Non-functional tests find problems that cause user dissatisfaction, outages or legal/security failures which functional tests can miss.
Key ideas
Start by defining terms you will see again and again.
- Non-functional testing: testing that evaluates characteristics of the software system that are not about specific functions or features. These characteristics are often called quality attributes or quality-of-service (QoS) attributes.
- Quality attribute (quality-of-service attribute): a measurable or observable property such as performance, reliability, availability, scalability, security, usability, maintainability, portability, and interoperability. Each attribute must be defined with measurable criteria to be testable.
- Service Level Agreement (SLA): a contract or specification that gives measurable targets for non-functional attributes (for example: 99.95% availability, 200 ms 95th-percentile response time).
- Load: the external demand placed on the system (e.g., number of concurrent users or requests per second).
- Workload: a realistic pattern of requests and activities representing typical or peak usage.
- Throughput: the rate at which the system completes work (requests per second). Throughput is often expressed in requests/s, transactions/s, or bytes/s (SI: s⁻¹ for request rate).
- Response time: time between a request and its completion (SI: seconds). Use percentiles (e.g., 95th) for meaningful measures in variable systems.
- Failure: an observable deviation from expected behavior. Fault (or bug/defect) is the underlying cause in code or design. Error may mean an incorrect internal state.
Precise definitions and assumptions commonly used in exams
Definition (Availability): Availability is the fraction of time a system is operational and able to serve requests, normally averaged over an agreed period. Assume a two-state model (UP/DOWN) unless told otherwise.
Definition (Reliability): Reliability is the probability the system performs without failure for a specified time interval under stated conditions.
Assumptions behind exponential reliability model: failures occur randomly and independently at a constant average rate λ (Poisson process). Under this assumption the time-to-failure T is exponentially distributed.
Little's Law (for performance queues): For a stable system in steady-state, the long-term average number of items L in a queuing system equals the long-term average effective arrival rate λ multiplied by the average time W an item spends in the system: L = λ · W. Assumptions: system is stable (arrival rate equals throughput over time), averages exist, and the system is observed in steady-state.
What to draw for typical exam diagrams (describe exactly):
Performance test architecture: draw three boxes left-to-right: (1) "Load Generator(s)" with arrows labeled "simulated users / requests", pointing right; (2) "System Under Test (SUT)" with sub-boxes: "Web server", "App server", "Database"; (3) "Monitoring" box above or to the right with arrows from SUT showing "CPU, Memory, Disk I/O, Network". Label network links with bandwidth.
Availability timeline: draw a horizontal time axis; mark UP intervals and DOWN intervals. Label one DOWN interval with length MTTR and a preceding UP interval with length MTTF. Show a repeating cycle if helpful.
Response time distribution: draw either a histogram (vertical bars) or a CDF. For a histogram, X-axis: response time (s), Y-axis: frequency or probability density. For a CDF, X-axis: response time (s), Y-axis: cumulative probability. On the CDF, mark the 50th (median) and 95th percentile points and label values.
When to use which non-functional test:
- Use load testing to check behavior under expected load.
- Use stress testing to find breaking points and behavior under extreme loads.
- Use soak (endurance) testing to check for resource leaks over long runs.
- Use spike testing to check sudden large changes in load.
- Use security testing for vulnerabilities, authentication, authorization and data protection.
- Use usability testing with real users or scripted tasks to measure effectiveness and satisfaction.
- Use scalability/capacity testing to evaluate how throughput and response time change as load or resources scale; identify saturation points.
- Use volume testing to validate behavior and performance with large data sets or storage sizes.
- Use recovery/failover testing to verify resilience, redundancy, and recovery objectives (MTTR, Recovery Time Objective RTO, Recovery Point Objective RPO) under component or node failures.
- Use compatibility/configuration testing to assess behavior across OS/browser/device/drivers and configuration variations.
- Use accessibility testing to check conformance to standards (e.g., WCAG) and support for assistive technologies.
Traceability and measurement: every non-functional requirement must have a metric, a target, a test workload, and a pass/fail rule (e.g., 95th-percentile response time ≤ 400 ms under 1000 concurrent users for 1 hour).
Formulas
List each formula on its own line, followed by symbol meanings, SI unit and when it applies.
Availability = MTTF / (MTTF + MTTR) — MTTF = mean time to failure (seconds or hours), MTTR = mean time to repair (same unit). Applies to two-state up/down model averaged over many cycles.
MTBF = MTTF + MTTR — MTBF = mean time between failures (same unit as MTTF/MTTR). For a two-state repairable system, Availability = MTTF / MTBF.
MTTF = 1 / λ — λ = constant failure rate (failures per time unit, e.g., failures/hour). Applies if time-to-failure is exponentially distributed.
R(t) = e^{-λ·t} — R(t) = reliability (probability of no failure during time t), λ = failure rate (s⁻¹ or h⁻¹), t = time in same unit. Applies under exponential failure-time assumption.
L = λ · W (Little's Law) — L = average number in system (dimensionless count), λ = arrival/throughput rate (items per second), W = average time in system (seconds). Applies in steady-state.
Throughput = Completed requests / Measurement interval — units: requests per second (s⁻¹). Applies to measured test interval.
CPU Utilization ≈ (Service Time × Arrival Rate) / Number of Cores — Service Time in seconds per request, arrival rate in requests/second. This is an approximate utilisation model.
Hazard (failure rate) h(t) = f(t) / (1 - F(t)) = dF/dt / (1 - F(t)) — where F(t) is the cumulative failure distribution (CDF) and f(t) = dF/dt is its density. Units: failures per time. Note: in software reliability growth models (NHPP), the failure intensity is d m(t)/dt (derivative of the mean value function), which is different from the hazard function.
Worked examples
Example 1 — Availability from MTTF / MTTR (numerical, step-by-step)
Given: MTTF = 2000 hours, MTTR = 2 hours. Compute Availability.
- Formula:
Availability = MTTF / (MTTF + MTTR). - Substitute: Availability = 2000 h / (2000 h + 2 h) = 2000 / 2002.
- Calculation: 2000 / 2002 = 0.999000999... ≈ 0.999001.
Final answer: Availability ≈ 0.999001 = 99.9001%.
Example 2 — Reliability for exponential model (numerical, step-by-step)
Given: constant failure rate λ = 0.0005 failures/hour. What is the probability the system survives 100 hours without failure? Also compute MTTF.
- Formula for reliability:
R(t) = e^{-λ·t}. - Substitute: R(100) = e^{-0.0005 × 100} = e^{-0.05}.
- Compute: e^{-0.05} ≈ 0.951229.
- MTTF =
1 / λ= 1 / 0.0005 = 2000 hours.
Final answers: R(100) ≈ 0.95123 (95.123%), MTTF = 2000 hours.
Example 3 — Little's Law (performance) (numerical, step-by-step)
Given: average number of concurrent requests in system L = 10 requests, average arrival (and throughput) λ = 50 requests/second. Find average time in system W (average response time).
- Formula:
L = λ · W. - Rearrange:
W = L / λ. - Substitute: W = 10 / 50 = 0.2 seconds.
Final answer: Average response time W = 0.2 s (200 ms).
Common mistakes
- Applying exponential reliability model without stating the constant failure-rate assumption. If exam gives data that shows changing failure rate, do not use R(t)=e^{-λt}.
- Forgetting units or mixing hours and seconds in formulas (MTTF in hours vs λ in per-second). Always convert to consistent SI units.
- Not specifying workload or environment: non-functional tests need a clear workload pattern and test environment; answers lacking that are incomplete.
- Treating throughput and arrival rate as independent when the system has finite capacity (queueing effects). Little's Law assumes steady-state.
For your exam
Question types you will see about non-functional testing:
- Definitions and short notes: define non-functional testing and major attributes (performance, reliability, security, usability) with examples.
- Derivations and formula use: derive availability formula from an up/down cycle and compute numbers; derive MTTF = 1/λ under exponential model.
- Numericals: compute availability, reliability R(t), MTTF, or use Little's Law to compute response time or concurrency.
- Design tasks: design a non-functional test plan for performance or security, including workload, metrics, tools and pass/fail criteria. You may be asked to draw the test architecture diagram described above.
- Interpretation: given a response-time CDF or time-series of CPU and response time, explain bottlenecks and recommend fixes.
What a full-marks answer includes:
- Precise definitions with bold terms and units.
- Explicit assumptions (e.g., "assuming exponential time-to-failure" or "steady-state" for Little's Law).
- Correct formulas with unit consistency and step-by-step arithmetic for numericals.
- Diagrams drawn as described, properly labelled when required.
- Test criteria (SLA), workload description, and pass/fail rules for design questions.
Quick check
- What is the formula relating MTTF, MTTR and Availability?
- Under the exponential failure-time assumption, what is the relationship between λ and MTTF?
- Using Little's Law, if arrival rate λ = 20 req/s and average time in system W = 0.5 s, what is L?
Answers: 1) Availability = MTTF / (MTTF + MTTR). 2) MTTF = 1/λ. 3) L = λ·W = 20 × 0.5 = 10 requests.
Finished this topic? Mark it so your progress, study plan and readiness keep up.
Stuck on something here?