Test Cases for an Elevator: Learn How to Write Mission Critical Tests That People Depend On

Test Cases for an Elevator [featured image]

How many times have you used an elevator without giving it a second thought?

My best experience of using an elevator was the one in the Burj Khalifa in Dubai.

124 floors in 60 seconds defying gravity and not even feeling like we’d even moved.

It was awesome.

Now most of the elevators you’ve used are unlikely to be like that.  

For example, like the one I use at work or my Saturday morning grocery shopping trip.

However, they all do have a lot of similar characteristics.

In this article, I’m going to give you a list of test cases for an Elevator system for FREE.

Are You New to Software Testing?

Are you thinking about a career in software testing or new to the world of QA testing?

We have some very useful resources to help give you an idea of what it entails.

What are the key challenges of software testing? You might be surprised.

Learn How to Write Test Cases

There’s no point in reading this article until you know the fundamentals on how to write a test case.

You should read that first.  Great if you’re a newbie and also a good refresher for those already in the industry.

Context and Scope

This article will only focus on the user interface of the elevator.

The kind of lift we will be looking at will be the Single up and down collective system.

We will not look at load testing or testing the actual setup or build of the elevator.

Understanding How Lifts Work

There are many elevator types in operation.  One of the most popular is an Otis Lift System that was first developed in the late 1800’s which is still popular today.

The video below may help you to understand some of the logic behind how it works when it comes to testing the functionality and putting together your test plan.

Below is also a useful video which explains some science behind elevators and how to make it more efficient.

Assumptions

It’s very difficult to test something in the absence of any requirements.

As a result, I’ll be creating test cases based on a number of assumptions

  • The lift will only stop at the corresponding floor that were selected to stop at.
  • The lift will stop at successive floors where a button was selected and NOT the order of the floor button pressed.
    • For example, if floor 1 then 3 then 2 is selected, the elevator will stop at 1, 2 and 3.  If the elevator is heading downwards, then this will be in a descending order.

Test Scenarios

Below are some test scenarios that I could think of to get your mind “ticking”.

User calls an unoccupied and “uncalled” elevator 

This scenario tests the behaviour of a lift where a user is the only person calling the lift and where there is nobody inside the lift.

Ideally you would assume that the lift would come to you straightaway regardless of which floor it is at and take you to the desired floor on the assumption of all other requirements have been fulfilled.

User calls an elevator that is travelling in the direction of travel requested by the user.

In this test scenario, the user who is currently outside of the elevator wants to go in the direction that the lift is currently heading in already.

For example, the user selects (makes a car call)  the “down” button and the lift is already occupied with passenger(s) that are also heading down.

This test, will verify what should happen based on the requirements….and plenty of assumptions.

User calls an elevator that is travelling in opposite direction of travel requested by the user.

The only difference between the above scenario and this is that the lift is heading downwards but you want to go upwards.

For example, I am on floor 3 and I want to go to floor 6.  However, the current passengers want to go to floor 2 and 1.

The assumption is that the lift door should open for me and proceed in its original direction of floor 1 and 2 before it continues upwards to floor 6.  

Will it stop to every call on the way up or does it go just to floor 6?

You should read your documentation and requirements to conduct functional testing of the requirements.

User wants to ensure the lift doors do not close on the passengers

This test scenario will essentially test the safety element of the lift where a passenger is entering or exiting the lift.

The test is to ensure the lift does not move whilst there is a passenger halfway.

Test Cases for Elevator Functionality 

Below I will look at areas of functionality and break these down by test case.

There are a number of immediate things that come to mind to me;

  1. Outside the lift – What can the user waiting to call the lift see and what do they need to do.
  2. Inside the Lift – What does the user see and do once they are inside the lift.
  3. User Interface – How does the UI look and feel inside and outside of the elevator.
Test Case IDTest Case DescriptionPreconditionExpected ResultPost Condition
TC-0001Verify user waiting for the lift can see the button panel (proves the UI is visible)The passenger waiting outside can see the button panel.
The passenger can also see the display (usually above the lift) that informs the passenger which floor the lift is on and the direction the lift is travelling in.
TC-0002Verify when the lift call button is selected, the button is highlighted.The lift call button is selected and the button is highlighted.
Note:  In most cases the button usually lights up to indicate it has been selected.
TC-0003Verify the elevator arrives on the current floor and the lift doors successfully openElevator arrives and the doors open.
TC-0004Verify elevator close door button does NOT close when an object/person is blocking the door from closing.  
Note: This is to test the safety feature to ensure that nobody gets stuck and the lift does not move.
The elevator door does not close and remains open the entire duration the object is blocking the doors.
The elevator does not move whilst the doors remain open.
TC-0005Verify the lift door closes automatically once passenger(s) are fully inside the lift.Lift doors close once there is no obstruction in the way. 
TC-0006Verify the User Interface is visible and as expected.  

Note:  This should as per the UI design.  You should create a test step for each item of the UI, for example buttons, screen display, colours, typefaces, text size etc.
The UI button panel is visible.
TC-0007Verify each button can be selected: a) Each selected button will depress (so you can feel it has been pressed).
b) Each selected button will be highlighted (e.g. a cloured ring around the button or the text will light up – this depends on the requirements). 
c) each time a button is selected the button will beep.
TC-0008Verify alarm and safety buttons work as expected.The emergency safety alarm button will generate an alert to the maintenance team.
TC-0009Verify maintenance staff have received passenger alarm.Maintenance staff have received passenger alarm.
Note: The maintenance staff should then conduct their own further UAT on this test.
TC-0010Verify that selecting the current floor number does not take the passenger(s) to a different floor.  No other passengers should be using the lift in order to test this.  The passenger would have already entered inside the lfit and the door would have closed.  With the passenger inside, the lift door will open as a default action.
TC-0011Verify the user can select the destination floor.    Precondition: No other passenger is using the lift in the building.  a) The corresponding floor button is selected.  
b) elevator door closes 
c) Lift starts to move in the direction of the floor sected.
TC-0012Verify elevator stops at each destination floor by selecting each floor.    a) User must start from the ground floor. 
b) No other user/passenger must be using the elevator. 
c) succeeding floor must be selected prior to the lift reaching that floor. 
TC-0013Verify the close button works. 
Note: The passenger will select the elevator button for the floor they want to travel to.  
When they arrive at the destination floor they will aim to close the door instead of waiting for it to automatically close.    
Test Data: No objects will be  blocking the lift door. 
The passenger is already in the lift and travelling on their way up or down and expected to stop at a selected floor to verify the ‘close door’ feature.  When the passenger arrives at a floor and the door opens, upon selecting the close button, the lift will start to close.
TC-0014Verify the opening lift button opens the lift doorsThe lift doors successfully open.

Usability Tests

If this was a software testing project, you may want to also test user experience or usability (not in scope for this article).

One of the things that comes to mind is looking at the lift interior and whether it is fit for purpose for passengers.

Maybe think about the space, the design, the colours and whether or not it feels safe.

Are there any gaps between the doors?

Does it feel comfortable?

Security Testing

If we compare this to a software testing project, we need to ensure that the application is as secure as it can be.

In this case, we need to ensure that the UI keypad is tamper proof.

We also need to ensure that the security key that calls the elevator is locked.

How easy is it to open the doors mid flight?

Looking to the Future

With the way technology is moving, lift design and algorithm is something that is changing all the time.

I was fascinated to read this article by Swati Tiwari on a hypothetical situation of creating a lift for a 10,000 floor building.

Whilst in some respects I don’t agree with everything, it’s still an eye opening read and allows you to understand what can be achieved.

As a Software testing professional, this is the kind of challenge we like to get our hands dirty with.

Housekeeping for your Test Cases

Don’t forget to tidy up your test cases once done.

You may want to add them to your regression testing suite so they can be used again in the future.

Summary

Hopefully this has given you some thought on how to test an elevator.

Don’t forget that testing a lift is a safety critical application which people’s lives depend on.

I’m interested to know your thoughts on this as a software tester or if you are a mechanical engineer that works on an elevator system.