Introduction
Finding bugs late in software development can be costly and slow down delivery. Shift-left testing helps catch problems earlier by moving testing activities closer to the start of the development process.
Imagine building a house and checking the foundation carefully before adding walls and roof. Fixing foundation problems early is much easier and cheaper than after the house is complete.
┌───────────────┐
│ Requirements │
└──────┬────────┘
│
┌──────▼────────┐
│ Design & Code │
└──────┬────────┘
│
┌──────▼────────┐
│ Early Testing │
└──────┬────────┘
│
┌──────▼────────┐
│ Continuous │
│ Feedback Loop │
└──────┬────────┘
│
┌──────▼────────┐
│ Final Release │
└───────────────┘import unittest def add(a, b): return a + b class TestAddFunction(unittest.TestCase): def test_add_positive(self): self.assertEqual(add(2, 3), 5) def test_add_negative(self): self.assertEqual(add(-1, -1), -2) if __name__ == '__main__': unittest.main()