Index
Index
1. Introduction
1.1 Purpose
1.2 Scope
1.3 Audience
2. System Overview
2.1 System Description
2.2 Functional Requirements
2.3 Non-Functional Requirements
3. System Requirements
3.1 Hardware Requirements
3.2 Software Requirements
4. Test Plan
4.1 Test Categories
4.2 Test Environment
5. Test Cases in IEEE 829 Format
5.1 Test Case Table
5.2 Test Case Theory
6. Implementation and Maintenance
6.1 Coding Standards
6.2 Maintenance
7. Conclusion
TEST CASES FOR A CALCULATOR
APPLICATION
1. Introduction
1.1 Purpose
The purpose of the Calculator Application project is to develop a simple yet efficient calculator
that can perform basic arithmetic operations, such as addition, subtraction, multiplication, and
division. This document provides an overview of the project, including design specifications,
system requirements, functional features, and test cases, ensuring that all necessary features are
covered for successful project completion.
1.2 Scope
The Calculator Application is designed to provide users with an intuitive interface to perform
basic mathematical operations. The application will:
Support arithmetic operations: addition, subtraction, multiplication, and division.
Handle basic error cases, such as division by zero.
Provide clear functionality to reset inputs and results.
Have a user-friendly GUI for mobile and desktop platforms.
1.3 Audience
This document is intended for:
Developers: To implement and improve the calculator's features.
Test Engineers: To design and execute test cases.
Project Managers: For monitoring progress and ensuring the project meets the
requirements.
End Users: To understand how the application functions and is used.
2. System Overview
2.1 System Description
The Calculator Application is a simple desktop or mobile-based application that
allows users to perform basic mathematical calculations. It features a GUI with
numeric buttons, arithmetic operation buttons, a clear button (C), and an equal
button (=).
The system will provide the following features:
Arithmetic Operations: Users can add, subtract, multiply, or divide
numbers.
Error Handling: The application will handle division by zero and other
basic input errors.
Clear Functionality: Users can clear the current input or reset the display.
2.2 Functional Requirements
Basic Operations: The calculator will support addition, subtraction, multiplication, and
division.
Error Handling: The application should display an error message when dividing by zero or
performing any invalid operation.
Clear and Reset: The clear button should reset the current input or result.
Order of Operations: The calculator should handle the order of operations correctly
(PEMDAS).
3. System Requirements
3.1 Hardware Requirements
Processor: 1 GHz or higher
Memory: 2 GB RAM or more
Storage: At least 100 MB of free disk space
Display: Minimum resolution of 1024x768
4. Test Plan
4.1 Test Categories
The test cases for the Calculator Application are divided into the following categories:
Unit Testing: Testing individual components like arithmetic operations.
Integration Testing: Testing the interaction between different modules.
System Testing: Testing the application as a whole to ensure it functions correctly.
Acceptance Testing: Validating whether the application meets the user requirements.
1.
Enter
5.
Ensure the 2.
Verify Pass if
calculator Calculator Press
Addition result is
TC_CAL correctly application +.
of Two 8 None 8. Fail
C_001 adds two is open and 3.
Positive if result
positive ready. Enter
Numbers is not 8.
numbers. 3.
4.
Press
=.
1.
Enter
Ensure the
10.
calculator
Verify 2. Pass if
correctly Calculator
Subtractio Press -. result is
TC_CAL subtracts application
n of Two 3. 6 None 6. Fail
C_002 one positive is open and
Positive Enter if result
number ready.
Numbers 4. is not 6.
from
4.
another.
Press
=.
1.
Enter
7.
Verify Ensure the 2. Pass if
Multiplic calculator Calculator Press result is
TC_CAL ation of correctly application *. 42. Fail
42 None
C_003 Two multiplies is open and 3. if result
Positive two positive ready. Enter is not
Numbers numbers. 6. 42.
4.
Press
=.
TC_CAL Verify Ensure the Calculator 1. 4 None Pass if
C_004 Division calculator application Enter result is
of Two correctly is open and 8. 4. Fail
Positive divides one ready. 2. if result
Press /.
3.
positive Enter
Numbers number by 2. is not 4.
another. 4.
Press
=.
1.
Enter
Ensure the 5.
Verify
calculator 2.
Addition Pass if
adds a Calculator Press
of a result is
TC_CAL positive application +.
Positive 2 None 2. Fail
C_005 number and is open and 3.
and a if result
a negative ready. Enter -
Negative is not 2.
number 3.
Number
correctly. 4.
Press
=.
1.
Enter
Ensure the
Verify 10.
calculator Pass if
Subtractio 2.
subtracts a Calculator result is
n of a Press -.
TC_CAL positive application 14. Fail
Positive 3. 14 None
C_006 number and is open and if result
and a Enter -
a negative ready. is not
Negative 4.
number 14.
Number 4.
correctly.
Press
=.
1.
Enter
Ensure the 7.
Verify
calculator 2. Pass if
Multiplic
multiplies a Calculator Press result is
ation of a
TC_CAL positive application *. -21.
Positive -21 None
C_007 number and is open and 3. Fail if
and a
a negative ready. Enter - result is
Negative
number 3. not -21.
Number
correctly. 4.
Press
=.
TC_CAL Verify Ensure the Calculator 1. -2 None Pass if
C_008 Division calculator application Enter result is
of a divides a is open and 8. -2. Fail
Positive positive ready. 2. if result
and a number by Press /. is not -
Negative a negative 3. 2.
Number number Enter -
correctly. 4.
4.
Press
=.
1.
Enter Pass if
5. error
Ensure the
2. Display messag
calculator Calculator
Verify Press /. error e is
TC_CAL handles application
Division 3. Cannot None shown.
C_009 division by is open and
by Zero Enter divide by Fail if
zero ready.
0. 0. no error
correctly.
4. messag
Press e.
=.
1.
Enter
5.
2. Pass if
Ensure the Press display
Verify Calculator
"Clear All" +. The resets to
TC_CAL Clear All application
button 3. display None 0. Fail
C_010 Functiona is open and
works Enter shows 0. if
lity ready.
properly. 3. display
4. is not 0.
Press
C or
Clear.
1.
Enter
5.5.
Ensure the 2. Pass if
Verify
calculator Calculator Press result is
Decimal
TC_CAL adds application +. 8.7. Fail
Addition 8.7 None
C_011 decimal is open and 3. if result
of Two
numbers ready. Enter is not
Numbers
correctly. 3.2. 8.7.
4.
Press
=.
1.
Enter
5.5.
Ensure the Pass if
Verify 2.
calculator Calculator result is
Decimal Press -.
TC_CAL subtracts application 3.2. Fail
Subtractio 3. 3.2 None
C_012 decimal is open and if result
n of Two Enter
numbers ready. is not
Numbers 2.3.
correctly. 3.2.
4.
Press
=.
1.
Enter
2.5.
Pass if
Verify Ensure the 2.
result is
Decimal calculator Calculator Press
10.0.
TC_CAL Multiplic multiplies application *.
10.0 None Fail if
C_013 ation of decimal is open and 3.
result is
Two numbers ready. Enter
not
Numbers correctly. 4.0.
10.0.
4.
Press
=.
1.
Enter
7.5.
Ensure the Pass if
Verify 2.
calculator Calculator result is
Decimal Press /.
TC_CAL divides application 3.0. Fail
Division 3. 3.0 None
C_014 decimal is open and if result
of Two Enter
numbers ready. is not
Numbers 2.5.
correctly. 3.0.
4.
Press
=.
1.
Enter -
5.
Ensure
Verify 2. Pass if
negative
Negative Calculator Press result is
numbers are
TC_CAL Number application +. -3. Fail
displayed -3 None
C_015 Display is open and 3. if result
properly
after ready. Enter is not -
after a
Operation 2. 3.
calculation.
4.
Press
=.
1.
Enter
100000
0. Pass if
Ensure the
2. result is
calculator
Verify Calculator Press 199999
handles
TC_CAL Large application +. 9. Fail
large 1999999 None
C_016 Number is open and 3. if result
number
Addition ready. Enter is not
addition
999999 199999
correctly.
. 9.
4.
Press
=.
TC_CAL Verify Ensure the Calculator 1. 500000 None Pass if
Enter
100000
0.
calculator 2. result is
Large handles Press -. 500000.
application
Number large 3. Fail if
C_017 is open and
Subtractio number Enter result is
ready.
n subtraction 500000 not
correctly. . 500000.
4.
Press
=.
1.
Enter
5.
2.
Press
M+
Verify Ensure the Pass if
Calculator (Memo
Memory calculator's result is
TC_CAL application ry
Recall memory 5 None 5. Fail
C_018 is open and Plus).
Functiona recall works if result
ready. 3.
lity properly. is not 5.
Press
MR
(Memo
ry
Recall)
.
1.
Enter
50.
2. Pass if
Verify Ensure the
Calculator Press result is
Percentag calculator
TC_CAL application %. 10. Fail
e calculates 10 None
C_019 is open and 3. if result
Calculatio percentages
ready. Enter is not
n correctly.
20. 10.
4.
Press
=.
TC_CAL Verify Ensure Calculator 1. 16 None Pass if
C_020 Button buttons application Enter result is
Functiona function is open and 5. 16. Fail
lity after correctly ready. 2. if result
Multiple after Press is not
Operation multiple +. 16.
s operations. 3.
Enter
3.
4.
Press
*.
5.
Enter
2.
6.
Press
=.
6.2 Maintenance
Bug Fixes: Any issues identified post-deployment will be addressed.
Feature Enhancements: Additional features like scientific calculations can be added in
future releases.
Security: Future updates may include security features for platform-specific concerns
(e.g., protecting user data on mobile platforms).
7. Conclusion
This document provides a thorough overview of the Calculator Application project, covering
everything from its functional and non-functional requirements to its design, system
specifications, and test cases. The goal is to ensure that the application performs all basic
operations correctly, handles edge cases appropriately, and delivers a smooth and intuitive user
experience. By outlining the various levels of testing, including unit tests, integration tests,
system tests, and acceptance tests, this documentation confirms that the application is reliable,
user-friendly, and ready to handle real-world usage. With these steps completed, the calculator is
well-positioned for further development, rigorous testing, and eventual deployment.
This comprehensive approach gives us confidence that the system will meet user expectations
and function seamlessly in a variety of scenarios.