0
0
Testing Fundamentalstesting~10 mins

Automation ROI calculation in Testing Fundamentals - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test calculates the Return on Investment (ROI) for automation in software testing. It verifies that the ROI formula correctly computes the value based on given inputs for manual and automation costs and savings.

Test Code - unittest
Testing Fundamentals
import unittest

class TestAutomationROICalculation(unittest.TestCase):
    def calculate_roi(self, manual_cost, automation_cost, savings):
        # ROI = (Savings - Automation Cost) / Automation Cost
        return (savings - automation_cost) / automation_cost

    def test_roi_calculation(self):
        manual_cost = 10000  # Cost of manual testing
        automation_cost = 4000  # Cost of automation setup
        savings = 12000  # Savings from automation

        roi = self.calculate_roi(manual_cost, automation_cost, savings)

        # Expected ROI = (12000 - 4000) / 4000 = 2.0
        self.assertEqual(roi, 2.0, "ROI calculation should be correct")

if __name__ == '__main__':
    unittest.main()
Execution Trace - 5 Steps
StepActionSystem StateAssertionResult
1Test startsPython unittest framework initialized-PASS
2Calls calculate_roi with manual_cost=10000, automation_cost=4000, savings=12000Function executes calculation-PASS
3Calculates ROI as (12000 - 4000) / 4000 = 2.0ROI value computed-PASS
4Asserts that ROI equals 2.0Assertion compares expected and actual ROIroi == 2.0PASS
5Test ends successfullyTest suite completes with no errors-PASS
Failure Scenario
Failing Condition: ROI calculation returns incorrect value due to wrong formula or input values
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify in the ROI calculation?
AThat manual testing costs are higher than automation costs
BThat automation always saves money
CThat the ROI formula correctly computes the return value
DThat savings are less than automation cost
Key Result
Always verify your calculation formulas with clear input values and expected results to ensure your automation ROI metrics are accurate and reliable.