"Fuzzing" In Python Can PREVENT Your Functions From FAILING

  Рет қаралды 10,886

Indently

Indently

Жыл бұрын

Have you heard of fuzzing? In this lesson we will be going over what it is, and how we can use it to make sure that our functions are robust and cannot be broken.
▶ Become job-ready with Python:
www.indently.io
▶ Follow me on Instagram:
/ indentlyreels

Пікірлер: 33
@spiralsight.7464
@spiralsight.7464 Жыл бұрын
great work
@xxyy1282
@xxyy1282 Жыл бұрын
Thanks!
Жыл бұрын
Good shit! 😀
@kilatev
@kilatev Жыл бұрын
Although it looks interesting approach, would it be better to use something like Hypothesis librarym that not only searches for inputs that may fail and provides that data, but also have some more tricks?
@christlebeau7848
@christlebeau7848 Жыл бұрын
Hi I have a question, when you write: text:str="hello world" What does the ":" mean? Thanks in advance !
@Indently
@Indently Жыл бұрын
It’s syntax used for type hints
@christlebeau7848
@christlebeau7848 Жыл бұрын
@@Indently tks but how does it work?
@neutrinoxicin6108
@neutrinoxicin6108 Жыл бұрын
@@christlebeau7848 just tells u what data type is the variable is, read pep 0484
@christlebeau7848
@christlebeau7848 Жыл бұрын
Thanks but how do type hints work ?
@DrDeuteron
@DrDeuteron 10 ай бұрын
they don't. They just sit there are look annoying.
@VojtechMach
@VojtechMach Жыл бұрын
Correct me if Im wrong, but this concept doesnt seem very useful in practice because of its (possibly infinite) runtime (unless stop condition) and resource consumption. Testing functions with random inputs doesnt seem very systematic, since the tests will pass once and fail next time. If the inputs were not random, then maybe one is better of using some library for that, e.g. hypothesis.
@federicobau8651
@federicobau8651 Жыл бұрын
Good stuff and good example as it very simple and not opinioned so to show the concept. But would be nice if you show a real life scenario where to use i. For instance I dont think do this makes sense everywhere but only in some places /block of codes, but where it does yea , could save in apfront huge amunt of money to a company!
@SkyyySi
@SkyyySi Жыл бұрын
Why are you using an int as a boolean value?
@aaronater1088
@aaronater1088 Жыл бұрын
You can totally use int as a bool shorthand as they actually represent truthy/falsey values where True == 1, and False == 0. If you test that out, they do truly equal each other
@SkyyySi
@SkyyySi Жыл бұрын
@@aaronater1088 "It's possible" isn't really an explanation of *why* you'd do it.
@aaronater1088
@aaronater1088 Жыл бұрын
@@SkyyySi Well, I believe I did explain why, it's more of a "shorthand". Though, it would be more concise to use True/False. What he did is no different than replacing them with True or False. So question you asked is why do it then? Again, quick way of representing True or False. Different code bases have used that merely out of preference, and now if you spot that in code, you'll know what they doin. Of course, you'll need to evaluate the context what the code is doing, but yeh
@abdullatif3704
@abdullatif3704 Жыл бұрын
Isn't better to just use ''.join(random.choices(characters, k=length)) ?
@Indently
@Indently Жыл бұрын
I didn't really focus on optimisations during this video. If you can explain why you think it's better, I would love to hear about it?
@abdullatif3704
@abdullatif3704 Жыл бұрын
I think it's better in readability, since both of them are doing the same thing I think it's also better to just use one that's already made for that job. Performance wise never really test it, most of the times it doesn't matter anyway. Also a question, I've seen your video about uuid and I'm interested in checking which one is better to do. I'm using the random generator, usually just with string.hexdigits to generate id for like ever. Most of the times it's for simple things but I do want to know, can I just use this or is there any problem with this method.
@hemanth8195
@hemanth8195 Жыл бұрын
next level bro 🤟🏾🤟🏾
@pinklemonade8444
@pinklemonade8444 Жыл бұрын
nig
@DrDeuteron
@DrDeuteron 10 ай бұрын
got enumerate?
@telebot
@telebot Жыл бұрын
Hi, what editor is that?
@firstprinciples4078
@firstprinciples4078 Жыл бұрын
fleet by jetbrains it's still in free preview phase
@EpicNoobx
@EpicNoobx Жыл бұрын
@@firstprinciples4078 It's actually PyCharm by JetBrains.
@firstprinciples4078
@firstprinciples4078 Жыл бұрын
@@EpicNoobx Oh thank you My mistake They do look kind of similar
@tzabarpho.
@tzabarpho. Жыл бұрын
@@firstprinciples4078 yeah there is a new ui
@telebot
@telebot Жыл бұрын
@@firstprinciples4078 Thanks!
@LambdaCreates
@LambdaCreates Жыл бұрын
Great video! Also, why are you STILL CHANGING THE PROFILE PICTURE? (by now most youtube channels would have stuck to a single icon)
@Indently
@Indently Жыл бұрын
Most channels do a lot of things, eventually I will hire a brand designer, and stick to one, but until then, no promises :)
@Whomst12321
@Whomst12321 10 ай бұрын
My corpse will be preserved in the cold my corpse will be preserved in the cold my corpse will be preserved in the cold my corpse will be preserved in the cold
@larseneivind
@larseneivind Жыл бұрын
Well made! Great video. The historical reasons why this technique was invented is quite interesting as well. en.wikipedia.org/wiki/Fuzzing#History
Learning To Code From ChatGPT Is A HUGE Mistake (Seriously)
5:14
Python's 5 Worst Features
19:44
Indently
Рет қаралды 96 М.
A pack of chips with a surprise 🤣😍❤️ #demariki
00:14
Demariki
Рет қаралды 46 МЛН
La revancha 😱
00:55
Juan De Dios Pantoja 2
Рет қаралды 69 МЛН
Why You Should Always Help Others ❤️
00:40
Alan Chikin Chow
Рет қаралды 130 МЛН
5 Good Python Habits
17:35
Indently
Рет қаралды 386 М.
This Is Why Python Data Classes Are Awesome
22:19
ArjanCodes
Рет қаралды 792 М.
5 Useful Python Decorators (ft. Carberra)
14:34
Indently
Рет қаралды 87 М.
5 Really Cool Python Functions
19:58
Indently
Рет қаралды 50 М.
Premature Optimization
12:39
CodeAesthetic
Рет қаралды 763 М.
5 Uncommon Python Features I Love
15:09
Indently
Рет қаралды 132 М.
Unlocking your CPU cores in Python (multiprocessing)
12:16
mCoding
Рет қаралды 294 М.
5 Cool Python One-Liners
12:23
Indently
Рет қаралды 27 М.
What's new in Python 3.13?
5:08
Carberra
Рет қаралды 75 М.
A pack of chips with a surprise 🤣😍❤️ #demariki
00:14
Demariki
Рет қаралды 46 МЛН