Test-Driven Development In Python // The power of red-green-refactor
Video Statistics and Information
Channel: ArjanCodes
Views: 30,571
Rating: undefined out of 5
Keywords: test-driven development, test-driven development with python, red green refactor, test driven development, red green refactor technique, software engineering, software development, test driven development example, test driven development in software engineering, test driven development python, software engineering course, software engineering tutorial, unit testing, software engineering for beginners, software engineering full course, tdd, unit testing python, Python unittest
Id: B1j6k2j2eJg
Channel Id: undefined
Length: 15min 9sec (909 seconds)
Published: Fri Aug 13 2021
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.
Your content on python is pretty cool. Thanks.
Love this guy! The code he presents is challenging and elegantly advanced that even novices will learn other things they were not expecting.
There are so many different paradigms for development.
I have found TDD to be most effective for refactors - especially rewriting code in another language while keeping the functionality the same or similar enough.
However, it really does not make sense at all to do TDD when developing something completely new. In this case, TDD actually causes the development time to increase considerably and if the code that's being tested is not actually going to be kept (e.g. the approach was a bad one), then it was just a waste of effort to build the tests first. For new things I generally prototype the code, execute the code to see what happens and then write tests around it. The final piece is to document so that my future self knows what I tried, what didn't work and why I have the current code. At each stage (prototype, execute, test, document), I am asking the question is this what I really want the code to do. Is this really the best way to present the code so I can understand it later and maintain it? And this approach works exceedingly well for new things because what I want is quick feedback loops to know if my approach is a good idea.
I also think language/tooling is important. Python in particular requires more testing on average to show correctness.
Can you explain why you should
int
for counting finance in a program? I get whyfloat
is inaccurate because it has this weird behavior like for example( 0.1 + 0.2) doesn't produce an accurate 0.3.But why
int
and notdecimal
? Why do you do when you have.... well a decimal number like $ 1.99 ?Personally I think BDD is better. It is similar to TDD, but focuses on what is actually important for the program to be usable by the end users instead of focusing on the developer's code, which the end users don't actually care about if it doesn't do what they want it to do.
Love your content man. Big fan. I watch them during my morning routine
I find your videos so useful that even some topics like the design patterns look easy. Thanks to this I've started re-learning them with a lot more confidence. Keep the great work, Arjan!
Nice video. TDD seems to assume that tests can be run very fast. In my experience eventually this stops being true so TDD becomes hard to do effectively.
What was the formatting shortcut used around the 8:30 mark? Created a multi-line assignment.