7. Testing, Debugging, Exceptions, and Assertions

  Рет қаралды 182,611

MIT OpenCourseWare

MIT OpenCourseWare

Күн бұрын

Пікірлер: 100
@denisecarillo2586
@denisecarillo2586 5 жыл бұрын
She's really easy to learn from. Thank you for teaching and positing this online without charge
@willcheung7041
@willcheung7041 4 жыл бұрын
and she is hot
@jcavs9847
@jcavs9847 3 жыл бұрын
@@willcheung7041 feels weird man
@88Oleksiy
@88Oleksiy 3 жыл бұрын
@@willcheung7041 very inappropriate
@EZ-hc5sh
@EZ-hc5sh 3 жыл бұрын
Don’t care. Before I go, why did you volunteer that info? Unless she requested said statement be relayed, who youis, P? Either way, is a quick way to farm out, there..uum, P. Or p, really, cuz u ain’t proper- or correct. correctional yes, attitude-oh yard time gotta go fill my cup one drop at a time
@leixun
@leixun 4 жыл бұрын
*My takeaways:* 1. Defensive programming: testing/validation and debugging 4:20 2. Three classes of test: unit testing, regression testing and integration testing 6:25 3. Testing approaches: natural boundaries for numbers, random testing, black box testing and glass box testing 7:45 4. Black box testing is based on specification, an example 9:05 5. Glass box testing tries to test every single path of the code 10:20 6. Using the print statement to debug 15:17 7. General debugging steps 17:20 8. How to debug logic errors 18:42, try rubber ducky debugging 9. Do and Don't 20:00 10. Exceptions 21:40 11. Assertions 37:45
@muneebqureshi8862
@muneebqureshi8862 4 жыл бұрын
Good work.
@Amy_Yu2023
@Amy_Yu2023 4 жыл бұрын
Lei Xun Thanks for sharing
@steverobinson8771
@steverobinson8771 2 жыл бұрын
Thank you for taking the time over your reply
@MaeLSTRoM1997
@MaeLSTRoM1997 Жыл бұрын
If bug fell in the soup, just eat it
@dhruv_aditya
@dhruv_aditya 3 жыл бұрын
Dr. Anna Bell is a great instructor, Thank you MIT OCW for making this high quality content online absolutely for free.
@rooneymara8061
@rooneymara8061 6 жыл бұрын
Amazing how she gets better as the lectures go on
@JamBear
@JamBear 3 жыл бұрын
Just like coding
@mohammadsamir2713
@mohammadsamir2713 6 жыл бұрын
although i am not a native or the best in english , i can hear every word and understand her i want to thank you a lot Dr. Ana
@nancylu4049
@nancylu4049 3 жыл бұрын
Dr. Ana Bell is a great instructor!
@DistortedV12
@DistortedV12 3 жыл бұрын
Where was this video when I started learning programming, would've saved me a lot of time
@鄭心和
@鄭心和 3 жыл бұрын
pre labeling ​​0:01:02 We aim for high quality - an analogy with soup 0:02:00​ 0:03:46 Programming so far 0:06:48 Classes of test 0:08:02 Testing approaches 0:10:00 Glass box testing ​0:11:02 ​0:11:48 ​0:14:00​ 0:16:00 0:17:26 Debugging steps 0:19:33 0:20:05 Don't and Do ​0:22:16 Other types of exception 0:24:08 ​ 0:25:41 Handling specific exception 0:27:09​ Other exception 0:28:15 What to do with exception 0:31:15 ​Example : Raising an exception 0:32:00 0:33:52 ​ 0:35:31 ​Option 1 0:37:01​ Option 2 0:38:38 Example 0:40:48 Where to use assertion
@Saganist420
@Saganist420 7 жыл бұрын
"Decide it's high protein and declare it a feature". That's hilarious. ahahah
@yukeyang5735
@yukeyang5735 6 жыл бұрын
I guess the soup would be tasty.That guy is funny.Haha.
@serkansenturk6945
@serkansenturk6945 5 жыл бұрын
The Elder Scrolls V: Skyrim likes this
@juanperezmondragon1676
@juanperezmondragon1676 4 жыл бұрын
that's actually what we do in mexico, grasshoppers are a traditional snack in some parts of the country, cus in the prehispanic times the solution to famines due to plagues was eating the insect that caused them.
@IACOIACOIACO
@IACOIACOIACO 2 жыл бұрын
this lecture was a godsend, feeling a lot more eager and motivated to learn programming, especially when there are tools at your disposal when shit hits the fan !!
@TheMinaProject
@TheMinaProject 2 жыл бұрын
Watched so many videos but only Dr Ana Bell's one stuck! Thank you!
@nephetssnephetss1508
@nephetssnephetss1508 Жыл бұрын
Dr. Anna Bell. This is great.
@davidorsa4406
@davidorsa4406 5 жыл бұрын
Dr.Hanna, you are awesome instructor and you made learning fun. Thank you very much!!!!
@jiakai7254
@jiakai7254 Жыл бұрын
perhaps the most valuable lecture in this series
@bla3029
@bla3029 3 жыл бұрын
Your voice and words are very clear good for concentration
@Lexaire
@Lexaire 4 жыл бұрын
26:35 for the last case, it will raise an Exception on interrupts like KeyboardInterrupt when you press CTRL+C. Programmers should be careful having broad except cases. If you had an infinite loop that caught all exceptions it would be hard to kill the program.
@PradeepKumar-gq8ej
@PradeepKumar-gq8ej 5 жыл бұрын
Love this session, fund very easy and clear and fun. Thank you so much for sharing..
@tes33720
@tes33720 5 жыл бұрын
These are great, and Ana is great. Was worried when there was a new teacher in the last video.
@adas21
@adas21 5 жыл бұрын
Mr. Eric Grimmson is actually better and more experienced
@oximas-oe9vf
@oximas-oe9vf 2 жыл бұрын
@@adas21 yaa but prof. Ana is more fun and has more jokes
@geekyprogrammer4831
@geekyprogrammer4831 Жыл бұрын
@@oximas-oe9vf we are here to learn not for jokes
@oximas-oe9vf
@oximas-oe9vf Жыл бұрын
@@geekyprogrammer4831 welll jokes secrete happy hormones inside you which generate emotion and emotions help with memory and help you get motivated to learn more
@jaddadzakaria
@jaddadzakaria 11 ай бұрын
love these lectures
@jojojojo4862
@jojojojo4862 7 ай бұрын
You are the best👏🏻👏🏻❤️ thanks Professor Anna
@hectort88
@hectort88 7 жыл бұрын
We use the "rubber ducking" method, not for coding but for general problem solving in our IT department with an empty pringles can.
@oximas-oe9vf
@oximas-oe9vf 2 жыл бұрын
I talk to my tulpa (a consious imaginary friend) LOL
@jmjtoob
@jmjtoob 6 жыл бұрын
"Decide it's high protein and declare it a feature"... I may have worked as a software engineer for that student's father in the past.
@hektor6766
@hektor6766 5 жыл бұрын
I think he has many fathers.
@sarthakraj3981
@sarthakraj3981 5 жыл бұрын
Pretty sure that was John, and not a student
@jesuelmarques2241
@jesuelmarques2241 Жыл бұрын
At 26:42 she says that she couldn't think of an error that would be raised besides these two. I thought of one: if a/b is too large, Python won't be able to represent it as a float and would raise an OverflowError
@h3ll_sds
@h3ll_sds 4 ай бұрын
yeah same
@akbarrauf2741
@akbarrauf2741 7 жыл бұрын
thank you ,mit
@alexandrugheorghe5610
@alexandrugheorghe5610 Жыл бұрын
26:43 one more exception can be KeyboardInterrupt
@oussematoussli8085
@oussematoussli8085 4 жыл бұрын
this proffesor is really great i wish i could study for her
@McAwesomeReaper
@McAwesomeReaper Жыл бұрын
I feel like 85% of the engineers I work with skipped this class.
@obli8984
@obli8984 3 жыл бұрын
thanks she is back after him
@HexagonalColumbus
@HexagonalColumbus 10 ай бұрын
36:21 How did you divide 100 by 3 and got 15.41666? Same for other lines. You should debug your code
@aviliocarcamo6454
@aviliocarcamo6454 Жыл бұрын
Does anyone know in which video she talks about the Rubber Ducky?
@jpdroidjp
@jpdroidjp 2 жыл бұрын
Lecturer is very good, it's not easy teaching programming. But for some reason I'm hung up on her pacing back and forth, and I can't get it out of my head! I wish I never thought of it now.
@Tintak_hatpin
@Tintak_hatpin 4 жыл бұрын
I am surprised that no one in the class asked why does it raise ValueError instead of TypeError, as the user provides the wrong Type of input i.e string Type whereas the expected input was integer Type. I had to google to find the answer. May be they already know the answer ?
@anlbasaran8206
@anlbasaran8206 Жыл бұрын
even though the user provides a string , n = int(input("How old are you? ")) this line converts n to an integer, even though n = twenty , which doesnt sount like an integer but when you ask type() it will return the answer "integer" so the error isnt a type error, sorry for the messy explaination even if you already googled and learned the answer , it might help the people who hasnt :D
@evanmcarthur478
@evanmcarthur478 5 жыл бұрын
The first answer was genius, she laughs, but thats what companies do all the time release buggy software .....then endless patches.
@Mark-wq7wd
@Mark-wq7wd Жыл бұрын
Your brain is the kitchen. Keep that place clean and sharp
@iansullivan9738
@iansullivan9738 5 жыл бұрын
Current American model for dealing with the first analogy: Burn the ceiling down
@Tarun-zf5ep
@Tarun-zf5ep 3 жыл бұрын
CD Projekt Red should watch this.
@antoniobuccoliero5437
@antoniobuccoliero5437 6 жыл бұрын
Bravissima, complimenti!!!
@adrianivanov6626
@adrianivanov6626 4 жыл бұрын
How do I do the thing where she selects multiple lines of code and adds a # in front of each of them at once?
@jasonchen0429
@jasonchen0429 4 жыл бұрын
Select the code then press ctrl+1
@adrianivanov6626
@adrianivanov6626 4 жыл бұрын
Jason Chen Thanks
@quintonconoly
@quintonconoly 2 жыл бұрын
@@jasonchen0429 Thanks
@xmnemonic
@xmnemonic 3 жыл бұрын
she has BLE: big lecture energy
@PhilippeCarphin
@PhilippeCarphin 7 жыл бұрын
Don't backup your code, make a commit with git
@PhilippeCarphin
@PhilippeCarphin 7 жыл бұрын
That's a bit much for people who are learning about if statements. All they need is version control. The advice she was giving was one of version control even though she used the word backup. But if you're going to do a backup, wouldn't it be better to backup your repo by having a remote repository whose url is a path to some place on another drive.
@sandeepkosta5750
@sandeepkosta5750 7 жыл бұрын
these days ide does that for us.. making our life a lot easier
@seanpatrickmcdevitt
@seanpatrickmcdevitt 7 жыл бұрын
i still havent found out how to get all the #(comments) away like shes does. she highlights a block and does something that gets them to all be not commented then
@windzhang6708
@windzhang6708 7 жыл бұрын
select all the #(comments), then press ctrl + 1. It is working in the spyder.
@seanpatrickmcdevitt
@seanpatrickmcdevitt 7 жыл бұрын
thanks, i thought it was something simple like that but that doesnt work in pyscripter :/
@mihirpatel8216
@mihirpatel8216 7 жыл бұрын
try doing Ctrl-/ or Ctlr/#
@ReverendRichardSeeland568209
@ReverendRichardSeeland568209 6 жыл бұрын
@ But then you have to install Numpy and PySci manually.
@gehanameresekere1345
@gehanameresekere1345 4 жыл бұрын
Python IDLE has this feature comment section or uncomment section.
@TedsWorld101
@TedsWorld101 Жыл бұрын
Anyone: Did you learn anything today? Me: Yeah, talking to rubber duckies helps me with my problems.
@sheikhakbar2067
@sheikhakbar2067 3 жыл бұрын
Could debugging be fun; I hope so!
@dve845
@dve845 5 жыл бұрын
be conservative in what you output and liberal in accepting your input? ... exceptions demand catches, just as return values rquire if's
@aymensekhri2133
@aymensekhri2133 4 жыл бұрын
thanks a lot
@Rollo_and_Jeet
@Rollo_and_Jeet 4 жыл бұрын
what is need of raising the exception? we can simply use print statement and break ?
@varungupta5493
@varungupta5493 5 жыл бұрын
is there a way to know which pset to do after which lecture?
@mitocw
@mitocw 5 жыл бұрын
At the bottom of the Syllabus page on the full course site on OCW ocw.mit.edu/6-0001F16 there is a Calendar with the release and due dates of the psets. Good luck with your studies!
@varungupta5493
@varungupta5493 2 жыл бұрын
@@mitocw Thanks!
@JeffBarron1
@JeffBarron1 2 жыл бұрын
stand still damn it!
@funandmotivationweekly
@funandmotivationweekly 4 жыл бұрын
comment the code what you have written and not working, so you don't endup doing the same implemenation again while doing the testing, cleanup at the end of finding the solution.
@chrischungy
@chrischungy 4 жыл бұрын
19:33 Professor's kid is probably going start to dreaming in code and grow up to be a wizard.
@pgoeds7420
@pgoeds7420 6 жыл бұрын
Try not to use ingredients with bugs already in.
@yodgoralisherov289
@yodgoralisherov289 2 жыл бұрын
👍👍👍
@quocvu9847
@quocvu9847 Жыл бұрын
32:53
@Xgckl
@Xgckl 7 жыл бұрын
That program for the class wouldn't work. The first student in class_list would get a correct entry in new_stats but then in the next step of the for-loop his grades and the next student would go into new_stats. Also, the program would try to do avg on his name, so you would definitely get an error message.
@hoangfuongduy
@hoangfuongduy 6 жыл бұрын
no dude, she separated the avg function to debug, that means when insert in back to the main function, she will amend the argument to be the right argument. As earlier we know that to debug we will devide the main program to smallers functions and check indiviualy.
@sharketespark6495
@sharketespark6495 Жыл бұрын
Deadpool never comes to any tests😢
@wanyinleung912
@wanyinleung912 5 жыл бұрын
Voice crack at 38:57
@quintonconoly
@quintonconoly 2 жыл бұрын
lol
@germanarrowood2748
@germanarrowood2748 2 жыл бұрын
The abundant look prenatally slow because test noteworthily tug barring a many confirmation. mammoth, hollow passive
@sanjeetkumarrai4998
@sanjeetkumarrai4998 3 жыл бұрын
disappoint beyond belief!!!
@ramazanaktas3699
@ramazanaktas3699 5 жыл бұрын
I wish she had praticed a little before lectures. Maybe 1/5 of lectures goes with "ehm", "umm", "err" or an awkward silence.
@quocvu4023
@quocvu4023 9 ай бұрын
18:24
Black Box and Glass Box Testing
2:04
MIT OpenCourseWare
Рет қаралды 38 М.
6. Recursion and Dictionaries
48:22
MIT OpenCourseWare
Рет қаралды 377 М.
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 89 МЛН
😜 #aminkavitaminka #aminokka #аминкавитаминка
00:14
Аминка Витаминка
Рет қаралды 3,1 МЛН
У вас там какие таланты ?😂
00:19
Карина Хафизова
Рет қаралды 24 МЛН
PIZZA or CHICKEN // Left or Right Challenge
00:18
Hungry FAM
Рет қаралды 15 МЛН
The Most Important Skill You Never Learned
34:56
Web Dev Simplified
Рет қаралды 216 М.
5. Tuples, Lists, Aliasing, Mutability, and Cloning
41:28
MIT OpenCourseWare
Рет қаралды 230 М.
America’s Forgotten Working Class | J.D. Vance | TED
14:43
2. Branching and Iteration
43:31
MIT OpenCourseWare
Рет қаралды 584 М.
🚀  TDD, Where Did It All Go Wrong (Ian Cooper)
1:03:55
DevTernity Conference
Рет қаралды 566 М.
Debugging 101: Replace print() with icecream ic()
12:36
NeuralNine
Рет қаралды 369 М.
Open Lecture by James Bach on Software Testing
1:38:35
Eesti Infotehnoloogia Kolledž
Рет қаралды 454 М.
DRM explained - How Netflix prevents you from downloading videos?
18:17
Mehul - Codedamn
Рет қаралды 209 М.
1, 2, 3, 4, 5, 6, 7, 8, 9 🙈⚽️
00:46
Celine Dept
Рет қаралды 89 МЛН