DAMBI DOLLO UNIVERSITY
COLLEGE OF ENGINEERING AND TECHNOLOGY
DEPARTMENT OF SOFTWARE ENGINEERING
COURSE OF SOFTWARE TESTING AND QUALITY ASSURANCE
TITLE:- SCIENTIFIC CALCULATOR
Group Members
Name Id No
1. Galata Tamasgen Nsr/2340/21
[Link] Isabu Nsr/1808/21
[Link] Daniel Nsr/382/21
[Link] Shifara Nsr/2526/21
PROJECT NAME: SCIENTIFIC CALCULATOR
1. Introduction
A scientific calculator is a versatile tool designed to perform complex mathematical calculations,
which are often necessary in various scientific, engineering, and mathematical fields. Unlike basic
calculators that handle simple arithmetic operations, scientific calculators can manage a wide range
of functions, including trigonometry, logarithms, and exponential calculations.
Key Features
1. Advanced Functions:
o Trigonometric Functions: Functions such as sine (sin), cosine (cos), and tangent
(tan) are essential for solving problems related to angles and triangles.
o Logarithmic Functions: These include natural logarithms (ln) and base-10
logarithms (log), which are useful in various mathematical contexts, including
statistics and exponential growth calculations.
o Exponents and Roots: Scientific calculators can calculate powers (like x2x^2x2
or x3x^3x3) and roots (like square roots).
2. Statistical Calculations:
o Many scientific calculators can perform statistical functions, including mean,
median, standard deviation, and regression analysis, which are vital for data
analysis.
3. Programming and Memory Functions:
o Some advanced models allow users to store values and perform programmed
calculations, which can save time for repetitive tasks.
4. Complex Number Support:
o Scientific calculators can handle calculations involving complex numbers, which
have both a real and an imaginary part.
5. Display and Input:
o They often feature a multi-line display that can show equations and results
simultaneously, aiding in understanding the calculation process.
2. Objectives of Scientific Calculator Testing
The objective of scientific calculator testing using unit testing tools is to ensure that each individual
component or function of the scientific calculator operates correctly and meets specified
requirements. Here are the key objectives outlined:
2.1Validate Functionality:
o Ensure that all mathematical functions (e.g., addition, subtraction, multiplication,
division, trigonometric functions, logarithmic functions) return the correct results
for a variety of input values.
2.2Verify Accuracy:
o Test the precision of calculations, especially for complex functions and operations
involving floating-point numbers, to confirm that results are accurate to the
required degree.
2.3 Check Edge Cases:
o Identify and test edge cases or boundary conditions (e.g., division by zero, negative
inputs for square roots) to ensure the calculator handles these scenarios gracefully.
2.4Assess Performance:
o Measure response times for various operations to ensure the calculator performs
efficiently even under heavy use or with complex calculations.
2.5Evaluate Usability:
o Confirm that the user interface functions correctly, including input handling, error
messages, and result display, to ensure a user-friendly experience.
2.6 Test for Consistency:
o Ensure that repeated calculations yield consistent results, which is crucial for
reliability in scientific computations.
2.7 Ensure Compatibility:
o Verify that the calculator’s functions work across different platforms or devices,
particularly if it’s a software-based calculator.
2.8 Automate Regression Testing:
o Establish a suite of automated tests to facilitate regression testing, ensuring that
new updates or features do not introduce defects in existing functionality.
[Link] Scope of Scientific Calculator Testing
The scope of scientific calculator testing using unit testing tools encompasses various aspects of
the calculator's functionality, performance, and reliability. Here’s an outline of the key areas
included in the scope:
1. Mathematical Functionality:
o Basic Operations: Test addition, subtraction, multiplication, and division for
various data types (integers, floating-point numbers).
o Advanced Functions: Verify the correctness of functions such as sine, cosine,
tangent, logarithms, exponentiation, and roots.
2. Input Validation:
o Valid Inputs: Ensure that the calculator accepts and correctly processes valid input
formats.
o Invalid Inputs: Test the calculator's response to invalid or unexpected inputs (e.g.,
letters, special characters).
3. Error Handling:
o Handling Edge Cases: Assess how the calculator manages edge cases, such as
division by zero or square roots of negative numbers.
o Error Messages: Verify that appropriate error messages are displayed for invalid
operations.
4. Performance Testing:
o Response Time: Measure the time taken to perform various calculations, especially
for complex operations.
o Load Testing: Evaluate performance under simulated heavy usage scenarios.
5. Accuracy and Precision:
o Floating-Point Precision: Test calculations involving floating-point arithmetic to
ensure results are accurate to a specified number of decimal places.
o Comparative Testing: Compare results against known values or alternative
calculators to validate accuracy.
6. User Interface Testing:
o Input and Output Display: Verify that the user interface correctly displays inputs
and outputs, including multi-line displays for complex equations.
o Functionality of Buttons: Ensure that all buttons and input methods (e.g.,
keyboard shortcuts) function as expected.
7. Regression Testing:
o New Features: Test new functionalities to ensure they do not adversely affect
existing features.
o Bug Fix Verification: Confirm that previously identified issues have been resolved
without introducing new bugs.
8. Compatibility Testing:
o Platform Compatibility: Verify that the calculator functions correctly across
different operating systems and devices (e.g., mobile, desktop).
o Version Compatibility: Ensure that the calculator maintains functionality across
different versions of the software.
• Testing of all mathematical functions (addition, subtraction, multiplication, division, trigonometric
functions, logarithms, etc.)
4. Out of Scope of Scientific Calculator Testing
When defining the testing boundaries for a scientific calculator using unit testing tools, it’s
important to identify aspects that will not be covered. Here are key areas considered out of scope:
1. Integration Testing:
o Testing how the scientific calculator interacts with other systems or software (e.g.,
other applications, APIs) is not included in unit testing.
2. System-Level Performance:
o Overall system performance metrics, such as memory usage and processing speed
under various workloads, fall outside the scope of unit testing, which focuses on
individual functions.
3. User Experience (UX) Testing:
o While basic usability may be touched upon, comprehensive UX testing, including
user satisfaction surveys and observational studies, is not part of unit testing.
4. End-to-End Scenarios:
o Complete workflows or scenarios that involve multiple steps or interactions with
other components are not evaluated in unit testing.
5. Hardware Testing:
o Evaluating how the scientific calculator performs on different hardware (e.g.,
specific models of calculators or devices) is outside the scope.
6. Security Testing:
o Security vulnerabilities, such as data protection and encryption, are not assessed
through unit tests, which focus on functionality rather than security.
7. Compliance Testing:
o Ensuring adherence to specific industry standards or regulations (like educational
standards or software certifications) is not part of unit testing.
8. Localization and Internationalization:
o Testing for support of different languages, currencies, or regional settings is
typically not included in unit testing.
9. Usability Testing:
o In-depth usability assessments, such as user interface design evaluations and user
feedback on layout and accessibility, are outside the unit testing scope.
10. Documentation Verification:
o Testing the correctness or completeness of user manuals, help files, or other
documentation is not part of unit testing.
5. Test Strategy
Functional Testing:
Objective: Verify that each mathematical function (addition, subtraction, multiplication,
division, trigonometric functions, etc.) behaves as expected.
Approach: Create unit tests for each function with a range of input values, including
positive, negative, and zero values.
Boundary Testing:
Objective: Ensure that the calculator correctly handles input values at the edge of
acceptable ranges.
Approach: Test boundary conditions, such as the largest and smallest values supported by
the calculator, as well as transitions between valid and invalid states (e.g., division by zero).
Error Handling Testing:
Objective: Validate that the calculator provides appropriate error messages for invalid
inputs.
Approach: Write unit tests that provide invalid inputs (e.g., letters, special characters) and
verify that the calculator responds with the correct error messages or exceptions.
Precision and Accuracy Testing:
Objective: Confirm that calculations yield accurate results, especially for floating-point
arithmetic.
Approach: Compare the results of calculations against known correct values, using
assertions to check precision to a specified number of decimal places.
Input Validation Testing:
Objective: Ensure that the calculator correctly validates user inputs.
Approach: Test valid inputs (e.g., numeric values, valid expressions) and invalid inputs
(e.g., invalid characters, empty inputs) to confirm that the calculator handles them
appropriately.
Performance Testing:
Objective: Measure the response time of calculations, especially for complex operations.
Approach: Benchmark the performance of individual functions under various loads and
ensure they meet acceptable performance criteria.
Regression Testing:
Objective: Ensure that new code changes do not introduce new defects into existing
functionality.
Approach: Maintain a suite of unit tests that are run automatically with each code change
to validate that previous calculations still work as expected.
Mocking and Dependency Injection:
Objective: Isolate the unit being tested from other components or external dependencies.
Approach: Use mocking frameworks to simulate dependencies (e.g., for complex
calculations or external libraries) to ensure that unit tests focus solely on the functionality
of the calculator.
Automated Testing:
Objective: Streamline the testing process and ensure consistency.
Approach: Implement automated unit tests that can be executed frequently, ideally
integrated into a continuous integration (CI) pipeline to catch issues early.
6. Test Plan
Test Environment
The test environment is crucial for ensuring that the scientific calculator operates correctly across
different platforms and devices. It includes details about the operating systems, hardware, and tools
used for testing.
Operating Systems
Windows: This is one of the most widely used operating systems, and testing on various
versions (e.g., Windows 10, 11) ensures compatibility with a large user base.
macOS: Testing on macOS is essential for users who operate the calculator on Apple
devices. It helps identify any OS-specific issues or UI differences.
Linux: Given its popularity among developers and tech-savvy users, testing on various
Linux distributions (e.g., Ubuntu, Fedora) ensures that the calculator functions properly in
these environments.
Each operating system may have unique behaviors, libraries, and system calls that could affect
how the calculator operates. Testing across these platforms helps ensure a consistent user
experience.
Hardware
Standard Desktop Devices: Testing on various desktop configurations (different CPUs,
RAM sizes) ensures that the calculator performs well under different hardware capabilities.
Mobile Devices: Since many users may access the calculator on mobile platforms, testing
on popular smartphones and tablets (both Android and iOS) is vital. This includes verifying
that the calculator functions correctly on smaller screens and touch interfaces.
Testing across different hardware configurations helps identify performance bottlenecks and user
interface issues that could arise from differences in screen size and resolution.
Test Tools
Effective testing requires the use of various tools to manage, automate, and report on testing
activities.
Test Management Tool
Examples: JIRA, TestRail
Purpose: These tools help organize and manage the testing process. They allow for the
creation of test cases, tracking of test execution, and logging of defects.
Benefits:
o Collaboration: Team members can collaborate on test planning, execution, and
reporting.
o Traceability: Maintain a clear connection between requirements, test cases, and
defects.
o Reporting: Generate reports on testing progress, coverage, and results, facilitating
communication with stakeholders.
Automation Tool
Examples: Selenium, Appium
Purpose: These tools automate the execution of test cases, significantly speeding up the
testing process and increasing efficiency.
Benefits:
o Reusability: Once automated tests are created, they can be reused for regression
testing whenever code changes occur.
o Consistency: Automated tests provide consistent results, reducing human error in
executing tests.
o Coverage: Automation allows for running a larger number of test cases in less time,
improving overall test coverage.
Test Data
Test data is critical for validating the functionality of the scientific calculator.
Predefined Inputs
Use Case: For mathematical operations, predefined inputs ensure that tests are systematic
and repeatable. This may include:
o Valid Inputs: Standard numerical values (e.g., integers, decimals) for basic
operations.
o Edge Cases: Inputs that test the limits of the calculator, such as maximum and
minimum values, and special cases (e.g., division by zero).
o Invalid Inputs: Non-numeric characters or malformed expressions to test error
handling.
Benefits of Using Predefined Inputs:
Consistency: Using the same set of inputs for testing allows for clear comparisons of
output results over time.
Comprehensive Coverage: By carefully selecting inputs, testers can ensure that all
potential scenarios are evaluated, including edge cases.
Efficiency: Predefined inputs streamline the testing process, allowing for quicker
identification of issues.
[Link] Cases: Below is a summary table of test cases executed for the scientific calculator, along
with their results. Each entry indicates whether the test passed or failed, along with any relevant
comments.
Test Case ID Test Description Input Expected Output Actual Output Result Comments
TC001 Addition of two 5+3 8 8 Pass Correct result
positive integers
TC002 Subtraction of 10 - 4 6 6 Pass Correct result
two positive
integers
TC003 Multiplication of 7*6 42 42 Pass Correct result
two positive
integers
TC004 Division of 20 / 4 5 5 Pass Correct result
positive integer
by positive
integer
TC005 Division by zero 10 / 0 Error Error Pass Correctly
handles division
by zero
TC006 Trigonometric sin(90) 1 1 Pass Correct result
function: Sine of
90 degrees
TC007 Logarithm of a log(100) 2 2 Pass Correct result
positive number
TC008 Square root of a sqrt(16) 4 4 Pass Correct result
positive number
TC009 Handling of abc + 5 Error Error Pass Correctly
invalid input identifies invalid
(non-numeric) input
TC010 Exponentiation (-2) ^ 3 -8 -8 Pass Correct result
with negative
base and non-
integer exponent
TC011 Trigonometric cos(0) 1 1 Pass Correct result
function: Cosine
of 0 degrees
TC012 Handling of very 1e+10 + 1e+10 2e+10 2e+10 Pass Correct result
large
numbers
TC013 Square root of a sqrt(-1) Error Error Pass Correctly
negative number handles square
root of negative
TC014 Negative log(-10) Error Error Pass Correctly
logarithm input handles negative
logarithm
8. Defect Management
Defect management is a critical aspect of the software testing process, encompassing the
identification, documentation, tracking, and resolution of defects found during testing. This section
outlines the procedures and strategies for managing defects identified in the scientific calculator
tests.
1. Defect Identification
Defects may arise during both manual and automated testing. Common sources of defects include:
Functional Errors: Incorrect calculations or unexpected outputs for valid inputs.
Boundary Issues: Failures in handling edge cases, such as division by zero or square roots of
negative numbers.
Input Validation Failures: Inability to manage invalid inputs, leading to crashes or incorrect error
messages.
Performance Issues: Slow response times for complex calculations or large inputs.
2. Defect Documentation
When a defect is identified, it must be documented thoroughly to facilitate resolution. Each defect
report should include:
Defect ID: A unique identifier for tracking purposes.
Summary: A brief description of the defect.
Environment: The operating system and hardware on which the defect was observed.
Steps to Reproduce: Clear, detailed steps to replicate the defect.
Expected Result: What the output should have been if the calculator functioned correctly.
Actual Result: The output that was produced, highlighting the discrepancy.
Severity/Priority: An assessment of the defect's impact on functionality and its urgency for
resolution.
3. Defect Tracking
Defects will be tracked using a test management tool (e.g., JIRA, TestRail). This process includes:
Status Updates: Regularly updating the status of defects (e.g., New, In Progress, Resolved,
Closed).
Assignment: Assigning defects to the appropriate team members for resolution.
Commenting: Adding notes or comments for clarity, including any additional findings or related
issues.
9. Test Reporting
The unit testing phase for the scientific calculator has been successfully completed, with a total of
14 test cases executed. Each test case was designed to verify the functionality and reliability of the
calculator's mathematical operations, including basic arithmetic, trigonometric functions,
logarithmic calculations, and error handling for invalid inputs.
All test cases passed, yielding a perfect pass rate of 100%. Specifically, tests such as the addition
of two positive integers (5 + 3), subtraction (10 - 4), and multiplication (7 * 6) produced the
expected results, confirming that the basic arithmetic operations function correctly.
The calculator also demonstrated its ability to handle edge cases effectively. For instance, the
division by zero scenario (10 / 0) resulted in the appropriate error message, as did attempts to
compute the square root of a negative number (sqrt(-1)). Additionally, the unit tests confirmed
accurate outputs for advanced functions, such as the sine of 90 degrees (sin(90)) and logarithm of
a positive number (log(100)), both returning the expected results.
Error handling was rigorously tested, with inputs like non-numeric characters (abc + 5) and
negative logarithms (log(-10)) yielding correct error responses. The calculator's performance with
large numbers was also validated; the addition of two large values (1e+10 + 1e+10) returned the
expected output without issues.
Overall, the successful execution of all test cases indicates that the scientific calculator operates
reliably and accurately, meeting the functional requirements set forth in the initial specifications.
No defects were identified during this testing phase, and the calculator is deemed ready for
deployment.
10. Risks and Mitigation
In any software testing process, identifying potential risks is crucial for ensuring the successful
delivery of the application. Below are the key risks associated with testing the scientific calculator,
along with corresponding mitigation strategies.
1. Risk: Incomplete Test Coverage
Description: Certain functionalities or edge cases may not be adequately tested, leading to
undiscovered defects.
Mitigation:
Comprehensive Test Planning: Develop a detailed test plan that includes all functional and non-
functional requirements.
Test Case Review: Conduct regular reviews of test cases to ensure all scenarios, including edge
cases, are covered.
Use of Test Coverage Tools: Utilize coverage analysis tools to ensure that all code paths are
exercised during testing.
2. Risk: High Complexity in Mathematical Functions
Description: The complexity of advanced mathematical functions (e.g., trigonometric,
logarithmic) increases the likelihood of errors in calculations.
Mitigation:
Modular Testing: Break down complex functions into smaller, manageable units and test each
unit independently.
Peer Reviews: Implement peer reviews of the code for complex mathematical algorithms to catch
potential errors early.
Benchmarking: Compare results with trusted mathematical libraries or tools to verify accuracy.
3. Risk: Delays in Issue Resolution
Description: Identified defects may take longer than expected to resolve, affecting the testing
timeline.
Mitigation:
Prioritization of Defects: Classify defects based on severity and impact, addressing critical issues
first.
Regular Communication: Facilitate frequent communication between developers and testers to
ensure quick turnaround on defect fixes.
Agile Practices: Adopt agile methodologies to allow for iterative testing and faster defect
resolution.
4. Risk: Environment Compatibility Issues
Description: The calculator may behave differently across various operating systems and devices,
leading to compatibility issues.
Mitigation:
Cross-Platform Testing: Ensure that the calculator is tested on all targeted operating systems and
hardware configurations.
Virtual Machines and Emulators: Use virtual environments to simulate different setups for
thorough testing without requiring physical devices.
Continuous Integration/Continuous Deployment (CI/CD): Implement CI/CD pipelines that
include automated cross-platform tests to catch compatibility issues early.
5. Risk: Insufficient Documentation
Description: Lack of proper documentation can lead to misunderstandings and inconsistencies
during testing.
Mitigation:
Maintain Comprehensive Documentation: Ensure that all test cases, defect reports, and testing
procedures are well-documented.
Knowledge Sharing Sessions: Conduct regular meetings to share knowledge and updates with the
testing team.
Version Control: Use version control systems to manage documentation changes systematically.
6. Risk: User Acceptance Issues
Description: The scientific calculator may not meet user expectations, leading to acceptance
issues despite passing all tests.
Mitigation:
User Involvement: Involve end-users in the testing process through beta testing or feedback
sessions to gather input on functionality and usability.
Usability Testing: Conduct usability tests to assess user experience and make necessary
adjustments based on feedback.
Iterative Development: Use iterative development cycles to incorporate user feedback
throughout the development and testing phases.
7. Risk: Resource Constraints
Description: Limited resources, such as time, manpower, or tools, may affect the testing process.
Mitigation:
Prioritize Testing Activities: Focus on high-risk areas and critical functionalities when resources
are limited.
Leverage Automation: Use automation tools to increase testing efficiency and free up resources
for exploratory testing.
Cross-Training Team Members: Ensure team members are trained in multiple areas to provide
flexibility in resource allocation.
11. Conclusion
The testing of the scientific calculator has been a comprehensive and successful endeavor,
encompassing a wide range of functionalities, edge cases, and potential risks. The unit tests
executed demonstrated a perfect pass rate of 100%, confirming that all arithmetic operations,
advanced mathematical functions, and error handling mechanisms function as intended. The
rigorous defect management process ensured that any issues identified were thoroughly
documented, tracked, and resolved, leading to a reliable and robust application. Furthermore,
careful consideration of risks and their mitigation strategies contributed to a streamlined testing
process, enhancing both efficiency and effectiveness.
Overall, the scientific calculator is well-equipped to meet user expectations, providing accurate
calculations and a seamless user experience across various platforms. With thorough
documentation and user feedback incorporated, the calculator is now ready for deployment, poised
to serve as a dependable tool for users requiring advanced mathematical capabilities.