tdd in python
play

TDD in Python with pytest and mock Leonardo Giordani - @lgiordani - - PowerPoint PPT Presentation

TDD in Python with pytest and mock Leonardo Giordani - @lgiordani - thedigitalcatonline.com About Me Born in 1977 with Star Wars, bash, Apple ][, BSD, finger, Zork, Galaxy Express 999, Little Pollon, Dire Straits, The Police, Rumours, The


  1. TDD in Python with pytest and mock Leonardo Giordani - @lgiordani - thedigitalcatonline.com

  2. About Me Born in 1977 with Star Wars, bash, Apple ][, BSD, finger, Zork, Galaxy Express 999, Little Pollon, Dire Straits, The Police, Rumours, The Silmarillion, Squad Leader. Interested in operating systems and computer languages, photography, fantasy and science fiction, video- and boardgames, guitar playing, climbing, horseback riding, Aikido, fencing, rollerskating, drawing, painting, bookbinding. I programmed in Z80 and x86 Assembly, GW-Basic, Logo, Borland Turbo Pascal, Prolog, C, C++, PHP, Lisp, Ada, Objective-C, bash, Python, Erlang, Clojure, Scala, JavaScript. I love mathematics and cryptography. tl; dr me = nerd + coder TDD in Python - Leonardo Giordani - @lgiordani

  3. thedigitalcatonline.com @thedigicat AMQP - architectures - C - Clojure - compilers - concurrent programming - C++ - decorators - Django - Erlang - functional programming - generators - Git - metaclasses - metaprogramming - Notebook - OOP - operating systems - Python - Python2 - Python3 - RabbitMQ - Scala - TDD - testing - versioning TDD in Python - Leonardo Giordani - @lgiordani

  4. AGENDA Introduction Part 1 - Write a library in TDD Part 2 - Mocks and complex tests Part 3 - Refactoring and legacy code TDD in Python - Leonardo Giordani - @lgiordani

  5. What you are going to learn today What you can learn in the next years TDD in Python - Leonardo Giordani - @lgiordani

  6. What is TDD? TDD in Python - Leonardo Giordani - @lgiordani

  7. It is not a tool It is not a language It is not a book It is a mindset TDD in Python - Leonardo Giordani - @lgiordani

  8. We a r e wor k i n g t oo sl owl y , we sol v e d t oo f e w i ssu e s l a st mon t h ! C a n y ou i n c r e a se t h e p r od u c t i v i t y of t h e d e v e l op e r s? H ow ma n y i ssu e s d i d we sol v e ? N ot e n ou gh ! H ow ma n y i ssu e s d o y ou w a n t u s t o sol v e ? Mor e ! TDD in Python - Leonardo Giordani - @lgiordani

  9. L a st mon t h We sol v e d 1 0 i ssu e s, a n d we n e e d t o sol v e a t l e a st 3 0 of t h e m e v e r y mon t h . C a n y ou d o some t h i n g? We l l , si n c e e v e r y d e v e l op e r wor k s on a v e r a ge on e we e k on a n i ssu e , a n d we h a v e 3 d e v e l op e r s we c ou l d b l a b l a . . . A N D P E R H A P S B L A B L A . . . N i c e I D E A ! L e t ’ s T R Y I T ! I ’ l l k e e p a n e y e on t h e i ssu e c ou n t e r . T h a n k s. TDD in Python - Leonardo Giordani - @lgiordani

  10. Test first code later TDD in Python - Leonardo Giordani - @lgiordani

  11. COVERAGE every line of code has a reason TDD in Python - Leonardo Giordani - @lgiordani

  12. REGRESSIONS Past tests are always run TDD in Python - Leonardo Giordani - @lgiordani

  13. DOCS There are examples, at least TDD in Python - Leonardo Giordani - @lgiordani

  14. REFACTORING Never without tests TDD in Python - Leonardo Giordani - @lgiordani

  15. TDD Workflow pick a bug/missing feature Write a test write code that passes the test TDD in Python - Leonardo Giordani - @lgiordani

  16. if the test you wrote doesn’t fail ask yourself “Is this test useful?” (which doesn’t mean “the test is useless”, it means “double check it”) TDD in Python - Leonardo Giordani - @lgiordani

  17. WRITE CODE THAT WORKS TDD in Python - Leonardo Giordani - @lgiordani

  18. BE REasonable TDD in Python - Leonardo Giordani - @lgiordani

  19. STRUCTURE OF THE repository my-refactoring refactoring my-mocks mocks git checkout -t origin/mocks my-tdd git checkout master git checkout -b my-tdd master TDD in Python - Leonardo Giordani - @lgiordani

  20. Where to go now pytest https://docs.pytest.org unittest.mock https://docs.python.org/3/library/unittest.mock.html tox https://tox.readthedocs.io/ travis.ci https://travis.ci TDD in Python - Leonardo Giordani - @lgiordani

  21. THANK you thedigitalcatonline.com @thedigicat AMQP - architectures - C - Clojure - compilers - concurrent programming - C++ - decorators - Django - Erlang - functional programming - generators - Git - metaclasses - metaprogramming - Notebook - OOP - operating systems - Python - Python2 - Python3 - RabbitMQ - Scala - TDD - testing - versioning TDD in Python - Leonardo Giordani - @lgiordani

Recommend


More recommend