How TDD drives development

There are a lot of articles about TDD, and I noticed that they all concern mainly the technical component of this approach, and practically do not describe in any way the mental principles underlying TDD.





Therefore, I did not want to write another article describing the Red-Green-Refactor technique. I wanted to look a little deeper at TDD and describe how and why TDD affects human behavior.





The article will focus on some abstractions that are applicable on different layers of the worldview and, regardless of the context, help to achieve a good result. The versatility of these abstractions, and the fact that they even apply to the coding process, made me an ardent advocate of both the TDD approach and these abstractions.





My first steps in TDD

web- 12 . 10 php CMS- Joomla Bitrix. , . CMS 2 javascript (React).

, , , , , , . , -, , TDD , , , 2013 . , , , , .

, , , , . , TDD, Professional Scrum Developer scrum.org.





, (, ) , , , CMS.





- β€œTest Driven Development: By Example” Kent Beck. , TDD, , - , . , , β€œTDDβ€Šβ€”β€Š , ”. , . …





50- , . , TDD,β€Šβ€”β€Š , … , , . , , β€Šβ€”β€Š , 2–5–15 . , β€Šβ€”β€ŠExample of TDD by H. Koehnemann, , acceptance test .





. , TDD , . , , TDD , TDD () .





:





(todo list)

-, TDD. /. . , , , .





, . . , - GettingThingsDone. GTD , , , , .





/ , ( ) , , , (β€œ ”, β€œ ”), . .





? , . .





. , .





Test-First Thinking

Test-first β€Šβ€”β€Š β€Šβ€”β€Š . , , β€œ ?”. test-first , . β€œ ”, , Agile , YAGNI KISS . , β€œ , ?”.





β€Šβ€”β€Š , . , , . , , , ,β€Šβ€”β€Š, ? , . , , , . , . , ( ).





, M S.M.A.R.T. .





, β€Šβ€”β€ŠTest-First Thinking. . β€œ - ?”, β€œ , ?”, β€œ , ?”. , , . , , . , .













, ?

?





, . , , - , . , , .





. , .





? GTD, , , , . , , , β€Šβ€”β€Š.





, TDD: , … … .





, - . , , .





, , - , β€Šβ€”β€Š . , , :





1. β€œ ” , . , , , ;





2. .





:





describe(β€˜ factorial’, () => {
  it(β€˜ 0    ’, () => {
    …
  })
})
      
      



:





describe(β€˜factorial’, () => {
  it(β€˜  0’, () => {
    …
  })
})
      
      



GTD. . ( 3).





( ) . . , THIS IS WHY YOU SHOULDN’T INTERRUPT A PROGRAMMER The Cost of Interruption for Software Developers.





, , , β€Šβ€”β€Š ( ) (, , email-).





, , . . () , , , β€œ ” ( ) .





β€Šβ€”β€Š (, , ). , , .





 

. ( ?β€Šβ€”β€Š. ) .





, TDD, β€Šβ€”β€Š .





coverage

, ,  β€¦ . . , . . , .





, , , . .





( ()β€Šβ€”β€Š []). . , TDD, , , TDD , .





, TDD , . , , . , , TDD. , TDD , . PS- ( 2020) 2020.





TDD

, .





TDD , TDD :





  1. . , , . , , , TDD .

    , , -. , /, . , , , , / , , , .





  2. TDD. TDD. β€œ-”. , , TDD ( , , ).





. . .

- , . -.





P.S. ()





In the comments I noticed a classic holivar on the technical / practical pros / cons of TDD. My favorite holivar on this topic is here - https://habr.com/ru/company/jugru/blog/313514/ . Highly recommend.

But the article was about mental tricks to share a new perspective on this approach. I wanted to talk about them in the comments. Thanks.












All Articles