Python TDD Workflow – Unit Testing Code Example for Beginners



Python TDD Workflow – Unit Testing Code Example for Beginners

Python TDD Workflow - Unit Testing Code Example for Beginners

In this tutorial we will play the game of unit testing! 🎮🎮🎮
To do so – we will learn a brand new coding workflow, implementing a set of programming principles known as Test Driven Development.
I will introduce you to the Three Laws of TDD (also known as the Three Laws of Uncle Bob) and show how to write a piece of software unit by unit, test by test, 2 minutes at a time! ⏱️
The end result is not only a cool encryption algorithm known as Caesars Cipher – but also a series of unit tests that ensures its accuracy and reliability.
In the very end – I also have a 🏆 CHALLANGE 🏆 for you! So make sure you tune in at minute 23:10 to participate and practice your new set of skills! 💪

⭐ CLONE MY CODE ⭐
—————————————–
https://app.wayscript.com/lairs/45150c67-1bd6-487b-940f-cc60bb6093de/public/

Also, please feel free to revise it and reshare your versions with the world!
Quick instructions of how to do this via Wayscript at minute 23:50

🚀 JUPYTER SYNTAX 🚀
—————————————–
unittest.main(argv=[”], verbosity=2, exit=False)

📽️ RELATED TUTORIALS OF MINE 📽️
—————————————————————–
⭐ Classes and OOP:
https://youtu.be/f0TrMH9s-VE
⭐ Inheritance and Private Class Members:
https://youtu.be/6c6NYPjO_rI
⭐ If __name__ == “__main__” for Python Developers:
https://youtu.be/NB5LGzmSiCs
⭐ List Comprehension:
https://youtu.be/SNq4C988FjU
⭐ Software Design and Development Exam Practice Stream:
https://youtu.be/uDnm7nlodDk

⏰ TIMESTAMPS ⏰
—————————————–
00:00 – Intro
01:19 – Three Laws of TDD
—————————————–
TEST 1 – Test Data Exists
—————————————–
02:07 – Basic syntax
03:59 – Jupyter Notebook syntax
04:30 – Assertion
06:28 – Production Code
07:32 – 2 minutes
—————————————–
07:54 – Test Input Data Type
09:12 – Test Return Output
10:16 – Test Input and Output Length
11:45 – Test Input different from Output
14:28 – Test Output Data Type
15:46 – Test Caesars Cipher
20:40 – Test More Inputs
23:10 – Challenge for you!
23:50 – How to share your code via Wayscript
25:09 – Thanks for watching! 🙂

🤝 Connect with me 🤝
————————————–
🔗 Github:
https://github.com/mariyasha
🔗 Discord:
https://discord.com/invite/wgTTmsWmXA
🔗 LinkedIn:
https://ca.linkedin.com/in/mariyasha888
🔗 Twitter:
https://twitter.com/mariyasha888
🔗 Blog:
https://www.pythonsimplified.org

🎯 Sources 🎯
————————————–
⭐ Python unittest Documentation:
https://docs.python.org/3/library/unittest.html
⭐ Professionalism and Test-Driven Development by Robert C. Martin:
https://ieeexplore.ieee.org/document/4163026

💳 Credits 💳
———————-
⭐ Beautiful animated graphics by:
mixkit.co
⭐ Beautiful icons by:
flaticon.com

Comments are closed.