flowchart TB
classDef writecode fill:#7D7ABC,stroke-width:0px;
classDef testspass fill:#23F0C7,stroke-width:0px;
classDef testsfail fill:#EF767A,stroke-width:0px;
subgraph id1 [<b>Code-driven development</b>]
A((1. write test)) --> B((2. test<br>passes/fails))
B-->|test passes|A
B-->|test fails|C((3. Write only<br>enough code))
C-->|test fails|C
end
subgraph id2 [<b>Refactoring</b>]
C-->|test passes|D((4. Check all tests))
D-->|tests pass|E((5. Refactor))
E-->D
D-->|Some tests fail|F((6. Update failing tests<br>Correct regressions))
F-->D
end
class A,C,E,F writecode;
class B testsfail;
class D testspass;











