Skip main navigation

New offer! Get 30% off one whole year of Unlimited learning. Subscribe for just £249.99 £174.99. New subscribers only. T&Cs apply

Find out more

Test design techniques

In this video Julian describes test design techniques, specifically focusing on boundary value analysis and equivalence partitioning.

In this video Julian describes test design techniques, specifically focusing on boundary value analysis and equivalence partitioning. He explains that test design techniques are systematic approaches that help us generate test cases efficiently and effectively.

Now it’s your turn to design a simple test case with equivalence partitioning. Here’s the scenario:

Imagine a software application that calculates the price of a cinema ticket based on the age of the customer. The app accepts number-only inputs representing the customer’s age and provides the ticket price according to the following rules:

  1. Children aged 0 to 12 years old receive a 50% discount.
  2. Teenagers aged 13 to 17 years old receive a 25% discount.
  3. Adults aged 18 to 64 years old pay the full price.
  4. Senior citizens aged 65 and above receive a 30% discount.

Using the equivalence partitioning technique, create test cases for the cinema ticket pricing software based on the provided age categories. Divide the input domain (age) into partitions and select one test case from each partition to ensure adequate test coverage.

Here’s the same cinema ticket pricing software as pseudocode:

function calculate_ticket_price(age)

if age >= 0 and age <= 12:

apply 50% discount

elif age >= 13 and age <= 17:

apply 25% discount

elif age >= 18 and age <= 64:

apply 0% discount (full price)

elif age >= 65:

apply 30% discount

else:

return "Invalid age input"

end if

return ticket_price

end function

For this equivalence partitioning task, you should create test cases that cover each partition or category in the age input domain. Here’s an example of the partitioning:

  1. Children: Age 0-12
  2. Teenagers: Age 13-17
  3. Adults: Age 19-64
  4. Senior citizens: Age 65 and above
  5. Invalid age input (negative values)

You should then select one test case from each partition to ensure adequate test coverage.

Your task

  1. Identify the equivalence partitions for the age input domain based on the given pseudocode.
  2. Select one test case from each partition.
  3. Describe the input (age), expected output (discount), and reasoning for each test case.
  4. Share one example test case with equivalence partitioning with your fellow learners in the comments below. Please comment on your fellow learners’ efforts too. How did they do?

Here’s an example to get you started

Test case 1: Children

  • Input: Age = 5
  • Expected output: 50% discount
  • Reasoning: Since the age falls within the children category (0-12), a 50% discount should be applied according to the pseudocode.
This article is from the free online

Foundations of Software Testing and Validation

Created by
FutureLearn - Learning For Life

Reach your personal and professional goals

Unlock access to hundreds of expert online courses and degrees from top universities and educators to gain accredited qualifications and professional CV-building certificates.

Join over 18 million learners to launch, switch or build upon your career, all at your own pace, across a wide range of topic areas.

Start Learning now