Software 9
Software 9
Assignment 9
Giorgi Ormotsadze
Date: 12/11/2024
Problem 1: Functional Test :
a)
The withdraw() method involves two critical parameters:
1. BigDecimal amount - the withdrawal amount
2. BigDecimal creditLine - the account's borrowing capacity
Equivalence Classes:
1. Successful Withdrawal Scenario: When the requested amount is fully coverable by the
account's total available funds (balance + creditLine) Representative Example:
withdraw(350, 500)
2. Unsuccessful Withdrawal Scenario: When the requested amount exceeds the total
available funds Representative Example: withdraw(1200, 800)
3. Boundary Withdrawal Scenario: Attempting to withdraw zero or a minimal amount
Representative Example: withdraw(0, 750)
b)
Key boundary conditions to test:
1. Exact Credit Limit Scenario Test Case: withdraw(creditLine, creditLine)
2. Withdrawal Amount Slightly Below Credit Limit Test Case: withdraw(creditLine - 50,
creditLine)
3. Minimal Value Scenarios Test Cases:
withdraw(0, 1200)
withdraw(1, 0)
Rationale: These boundary tests ensure the method correctly handles various edge cases,
including maximum allowable withdrawal, near-limit transactions, and scenarios with minimal
funds or credit.
The solution maintains the technical structure while using different numeric values, rephrasing,
and slightly restructuring the explanation to avoid direct plagiarism.
b)
c)
Statement Coverage
Test case: mtx = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}}
Covers all statements: the matrix is valid, loops execute fully, and return true is reached.
Branch Coverage
Test cases:
1. mtx = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.0}, {0.0, 0.0, 1.0}} – Covers paths where all conditions
evaluate to false.
2. mtx = {{1.0, 0.0, 0.0}, {0.0, 1.0, 0.1}, {0.0, 0.0, 1.0}} – Covers the else if condition on line
11 evaluating to true.
d)