0
0
Testing Fundamentalstesting~10 mins

Waterfall testing model in Testing Fundamentals - Test Execution Trace

Choose your learning style9 modes available
Test Overview

This test simulates the Waterfall testing model by verifying that each testing phase completes before the next begins. It checks that requirements are reviewed, design is validated, implementation is tested, and final acceptance is confirmed in order.

Test Code - unittest
Testing Fundamentals
class WaterfallTestingModel:
    def __init__(self):
        self.phases = ["Requirements Review", "Design Validation", "Implementation Testing", "Acceptance Testing"]
        self.current_phase_index = 0

    def complete_phase(self, phase_name):
        if self.current_phase_index < len(self.phases) and self.phases[self.current_phase_index] == phase_name:
            self.current_phase_index += 1
            return True
        else:
            return False

import unittest

class TestWaterfallModel(unittest.TestCase):
    def setUp(self):
        self.model = WaterfallTestingModel()

    def test_phases_in_order(self):
        self.assertTrue(self.model.complete_phase("Requirements Review"))
        self.assertTrue(self.model.complete_phase("Design Validation"))
        self.assertTrue(self.model.complete_phase("Implementation Testing"))
        self.assertTrue(self.model.complete_phase("Acceptance Testing"))

    def test_phases_out_of_order(self):
        self.assertFalse(self.model.complete_phase("Design Validation"))
        self.assertTrue(self.model.complete_phase("Requirements Review"))
        self.assertFalse(self.model.complete_phase("Acceptance Testing"))

if __name__ == "__main__":
    unittest.main()
Execution Trace - 8 Steps
StepActionSystem StateAssertionResult
1Test starts - unittest framework initializes test class and methodsTest environment ready with WaterfallTestingModel instance-PASS
2Calls complete_phase with 'Requirements Review'Current phase is 'Requirements Review'Check if phase matches current phasePASS
3Calls complete_phase with 'Design Validation'Current phase is 'Design Validation'Check if phase matches current phasePASS
4Calls complete_phase with 'Implementation Testing'Current phase is 'Implementation Testing'Check if phase matches current phasePASS
5Calls complete_phase with 'Acceptance Testing'Current phase is 'Acceptance Testing'Check if phase matches current phasePASS
6Calls complete_phase with 'Design Validation' out of orderCurrent phase reset to 0 for new test, which is 'Requirements Review'Check if phase matches current phaseFAIL
7Calls complete_phase with 'Requirements Review'Current phase is 'Requirements Review'Check if phase matches current phasePASS
8Calls complete_phase with 'Acceptance Testing' out of orderCurrent phase is 'Design Validation'Check if phase matches current phaseFAIL
Failure Scenario
Failing Condition: Trying to complete a testing phase out of the defined order
Execution Trace Quiz - 3 Questions
Test your understanding
What does the test verify about the Waterfall testing model?
APhases can be completed in any order
BOnly the last phase is important
CPhases must be completed in order
DPhases can be skipped
Key Result
Always verify that testing phases follow the defined sequence in Waterfall to catch errors early and maintain process discipline.