Merken

Entomology 101: Effective Bug Hunting

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Beta
Erkannte Entitäten
Sprachtranskript
I don't know know if and it is the the last thing a if you could prove that you can use so
the deadline for putting a talk was coming out i-vector catastrophic about it I wasn't coming up with any good ideas and working super busy and I get home and my youngest daughter so let's go look for bonds in the yard and it was hot and I was tired will rebound stressful I really wasn't the 1 we went out there and you know how you say
no to that few days so I go out and wall out
there was I yeah depending on the bonds although it work like really on while computer box I have then I would finding real blogs can you find a bug that day which might have been because it was like a hundred degrees outside right but but we both writers and we just do it in years and
air-conditioning and not only did this
he are the Kansas Humanities but 1 of the
things that we were going about 100 you gotta get the proper equipment right so we get we need enough about I would it again 1 and then to go above the so as a diagram what's 1 of the 1st Spain's you reach full our but when when you're demanding the I've ever greater than a rear involving values the that you should suppressed the and think that's a trick question imagery using this print statement by the US was originally the by the way I uh the Geneva Convention this man
very and then during early in the common bugs regular bugs we can use something a little easier that helps in more general way specifically rejected
J. U. debunk lot who will use gender the local OK and they're both everybody but something like I'm always surprised the people who have never heard of it and have a look at it and think it's hard user that is something difficult to read quick look agenda the one-to-one but
what a silly little happen I'm working on and if you look over here this is a lot of things like like this it shows me all sorts of interesting information about my side it shows me it
shows me which versions of things are installed how wonderful different things that on which I know I spend the request Don content shows settings all the different things and I'm confused you to look at my satisfy what settings of the news right now but that matters that and then requested so all my cookies Everything anyone knows but your average Django request and this is 1 of the I think people don't use enough which shows all the signal queries this is where your back slow we can see false statement and that exactly where is generous we can see a query plan proposed crest see missing and that's is somewhat showing up your template it print out statements and see that it's set in context or you can just click in the here and see exactly what is in the temple context you also see the signals a fired at times you called cash very long statement here is what
what
a part of my voice is a little worse a little bit under the weather but sometimes is hard
bugs but then you just get to the but a lot scary the so maybe Rangers something like
the the thing about who here uses the Python the bond surprise it's almost the same number of people I I never ever used others I don't know why I don't it's just never been my thing I never confused about the program's flow I'm always just confused about this wrong when what data is set well I think it's right I think I've got a list of that tuple I think I've got a dictionary filled with data and it's actually unknown right like that those are my confusion those amendments come from they don't come from I don't understand why this it is in firing is not firing because the data is not set right so you can indeed if you're
not familiar with Python you can learn about the parameters that trace any any particular spot I the program was stopped and then you can slowly iterate through go to the next slide go to the next function show me the value of this variable here and you step through your program line by line but that I don't particularly find it useful so but maybe you well this is really helpful if you're going to give a very very complicated program you very confused as to why he went up over here when you think you should be over here but in my state of your problems that complicated you should probably work under simplifying the program rather than getting in more advanced about the
the so it's not the I am however a huge fan of this you can embed a on shelf IPython shell anywhere you want it's in my opinion basically the same thing as using a debugger I so we should accept but
so this is the view for this dashboard page were looking at and if I do the that's so my Python import in bed and then call and that use it so much I have hockey for insulin so I go back here
I revert the page you'll see is just spending just waiting but I go back over to my server is that that me into an IPython shell right next slide instead itself request user that's right and what's in the context I can add stuff to the context but the 1 the exit it continues on normally we go we refresh the pages and if I look in here
it
if Finland context the we've added food or variant of so I'm really just plug right in that line but now did when I got which is something that use all the time and not stepping through within about having remember almost but
the cost you draw the the
and but real secret effective bond is to use a lot there's really 2 kinds of bonds and the bonds that I've just generated locally in my local development then there's the bonds that happened after we've deployed staging a production longing gives you the information about and about belonging and while the locally I did my answers about what my dataset to and then when I got a production I had that same and some killing 2 birds with 1 stone 2 bonds with constant so the
I obviously you can use use the standard Python Morgan library and it's really it's really ideas but this is an example of using by the longer just set up this stranger to standard out using containers a good 12 factor at this is really all you need to do for a script I this at different levels you can turn off so I now we're getting the deeper level so we see everything from the debugger level above and so we would see both testing and debug analogs when we in this if we set that just info we would always see the testing so we can turn off the reliever boasts data that we don't see there's a slightly better version of the armor notion shouldn't long book found it's squandered faster so if you have the wanting you do a lot of logging in you're worried about leaking out that last little better performance to your after having a whole lot of logic statements is actually fairly slow a log is quite a bit faster made not twice as fast but and it's just about as easy to use here we just set up slightly differently and this will just long to standard out the will log here's info finding bugs is there's also a Python library called struct long and it's example does not fit well a sliding and it's much more verbose but what allowed you to do is as you're going through your code you can say I'm behind this variable here to this name in my structure long and then when I get to a point where I want to emit along I just say that this long and all the variables that I bound their values and up in the structure law and you can decide output them as J. on Orosius media however you want to use in downstream the so as I mentioned my daughter something about a bit about hunting some reviewing out there like at turning over
rocks and we were finding any bonds 1 of the 1 of the techniques for finding where is your is the divide and conquer 1st I looked up this rod don't want to learn about of this but the stock number the so the idea is that we have this middle well the rock and so I can begin there what's the right it's not over here and start over here it must be somewhere in here I can begin it and get into the meat of but the thing that I found people don't do is they keep attacking the problem from the kind of the same State and often did you start with a clean slate predicate cluttered Mr. on testing data recreate whatever you need the best perspective the Web lunch going to walk over a coffee when I used to be a smoker I can tell you how many times and be so frustrated above that get up to go outside for a smoke and I would even make it outside of our and all that electrons just getting your mind out of out of the problem the fact that some people talk about is called member that the debugging the top this is just say it out loud did your friend come over to take a look at it with you sometimes just explaining the problems of them will will help you find it and then you got this complicated mass whatever you do only change 1 thing at a time we His University and figure out where this is going lower your problems like if you're calling out for wires it and then we a
questions at the the few few the actually might want to get you to put half my money granted the net 1st unofficial uh would have and who could be uh we actually do have point C at time for questions there please don't be shy and just for reporting verbs to come to the mike on either side and that's chapter thank it and it's going of is this we describe the story of my life and they are identical and select the solid is once and I guess I could make a lot of comments from woman ask the question of after you done all this stuff talk our love to see talk about the role of regular expressions of when the things like that right you know the fine all the instances clear how quickly a lot of this particular about yeah and well that's really more of a problem being dry of not repeating yourself like you know you should really only have about and that's same boat in 1 spot right if you're having to find it copied in many many places that's probably just bad all of of but not you're using using the questions the common patterns happens I do a lot of refactoring for people and solve see that they're using something of a bad pattern of it's more of a maintenance nightmare that really above it does what it needs to do it's just you know verbose so or slower or something like that and so I have to search through codebase under some really great tool called AC AC OK found that will it's basically grant for programmers so you can say search all these they act dash dash Python search and a search for it will search from the current directory background only Python files for that straight or you can say act after CSS role will for CSS but also smart looks for Sarson unless and those kinds of things so so that that saves me so much of it gives you some contacts lines around each match so you can kind of see where in the code room watching examples what you what since the get picked
up a bunch of each to mailbox and stuff were mentioned there and so I just do
act better to Python it only find it in the Python fast as no person was going to strange codebases large strange for these normal sold rewriting is is not option in you know refactoring is not an option you know what fixing bugs is a require no no I don't I would like to use online text it's got great search replace feature so that you can step through and I should replace this section replace that I should be replacing this when a can walk you through you can do multiple files with the same so that might be of some use the
right we talked about the question so you mentioned of PV in high enough to fund in the new mentioned so I thought you love it before we thought so I PDP which is PTV that IPython shell how it's so things that might that never put for me but until recently is that with us ideas better right it's got the better of contemplation type interface everything and the history that they could for me was that with PDB you could you can issue the interact command and then it basically gives you an IPython shell at that point of but for me I don't know the 1st thing I was always tired right and so I just switched over to going straight to the shell because I didn't need to step the anything of a designer I'm I'm very rarely confused as to why I'm in this function or why you know how this flow ITC to see the data here and maybe over here but I don't typically need to do that in 1 section Maslow's more habit thing I think I could be I think a like this like due you that I Pfizer the altered the I was little bit more of a bigger alternative question but you know I find that as you become more experienced of programming you sort of develop your own way of debugging in you get better at the but for basically what when working with a novice programmer someone who's learning and a lot of times state sort of and issued in the dark because they they haven't really learned how to properly debug at and you know I always say the 1st step is look at the error message right plot do you have any experience or just comments on when you're working with someone who's new to programming out a sort of guide them through the debugging process but so the would it depends on the bottom this really happened long ICT I know exactly what it done right so that's different than if I have to dig a little bit if I'm doing a little bit I very much tell them exactly what I'm doing this thing doing that I'm gonna look over here because I think the problem is in the template and it's just that you're using the wrong template variable names and started the date is wrong it's just you're using the wrong here OK so I'm wrong but you you've used it right so it's that the the starting set we now need to go to the view and look and see how the data's being said right and instead of just going at all it's right here because I'm junta therefore files for quick and confused for the yeah I don't know it's debugging is heart right right it's it is something you get better at engineer hopefully also you get better and not any bonding not putting them in the 1st place but I you know but debugging is is what we do libraries you know that I am the 1 thing I do when I'm writing training classes is I tell people as I know just last week I spent 2 hours going what topic why is this not working and you know it can be something very small but I just 3 or 4 times right answer to give them encouragement that it still happens to me it still happens to be better than me right you're never going to read this it's always just a matter of no working through each 1 you may have mentioned regular expressions uh there in the last 1 I just realized that for me the hardest thing in the world but is a problem with the regular expressions in neural stuff by but I'm really good with regular expressions like into the world and so like I read Mastering Regular expressions 5 or 6 times a really good with regular expressions but for whatever reason that is the hardest thing like you don't see them the see the problem in the Urals sorry we have I think we have enough time to get these 2 and that 1 so we'll let you go ahead since you're now idea just wondering if you had any specific tools that you know 1st strategies as far as like debugging Micah services if you have like a pipe micro-services architecture if you're familiar with like is I think like the PDB and assorted tools work really well if you have something monolithic but like if you trying to trace something across a bunch of different even if the altar arrest framework it was you got it is logical right and you need longer 1 central that so that you can you can look at and and then you can see OK and issuing this request and I know about this data and then it went in the service in addition this request and ask for this data that the statement in each 1 that's really the only way you can go ahead and otherwise items that are going to have to put up subtrees in here and stuff the stuff wasn't so here instead of stuff that and work for a while he also the gender tool bars
really great but what if you somebody's doing a single page of the ApEn using something like our react Gs and everything's in AJAX and suddenly all I'm doing is using the browsers con full to see what the network traffic is you have something to
recommend verb but in that need so if you're using react and redox there's really good of browser plug-ins for redox I can show you the the redox dev tools on is really great but also mounting that people in this and I'm going to have to look this up real quick because I don't remember in this project was 1 way the p but if you for a lot
of and
if you hit the generous framework and point didn't were still works and in that way so for example if you wanna see the queries on USC anything about so if you get the browser this was the human consumable part if you have any questions about how that it is getting in there on the data side you can still use the tools but in
entirely new jobs abroad you got lot on the JavaScript tools really to help you there of thank you the government request came as a big fan as Benjamin and the people in this room who don't know spectrum check check it out what outcomes less dense spectrum if there are any new cool features on the way so now I'm so spectrum is a product that we put out there that makes landing useful for the developer right now adding support for other languages so i'm gonna come plugin and seeking the council along and slowly adding in Ruby and go and and JavaScript longing libraries for spectrum the weather was good so in other words few chief is and
you look you
Minimalgrad
Web log
Quader
Computer
Programmfehler
Diagramm
Befehl <Informatik>
Rechter Winkel
Hochdruck
Eigentliche Abbildung
Metropolitan area network
NP-hartes Problem
Regulärer Graph
Lesen <Datenverarbeitung>
Programmfehler
Befehl <Informatik>
Subtraktion
Menge
Mittelwert
Versionsverwaltung
Automatische Handlungsplanung
Cookie <Internet>
Abfrage
Inhalt <Mathematik>
Information
Kontextbezogenes System
Quick-Sort
Bit
Mereologie
Programmfehler
Rechenschieber
Lineares Funktional
Parametersystem
n-Tupel
Zahlenbereich
Kontrollstruktur
Mailing-Liste
Optimierung
Gerade
Aggregatzustand
Sichtenkonzept
Nabel <Mathematik>
Fächer <Mathematik>
Debugging
Homepage
Rechenschieber
System F
Nabel <Mathematik>
Rechter Winkel
Server
Kontextbezogenes System
Homepage
Kontextbezogenes System
Gerade
Konstante
Softwareentwickler
Biprodukt
Bit
Punkt
Betragsfläche
Versionsverwaltung
Zahlenbereich
Mathematische Logik
Gesetz <Physik>
Code
Übergang
Benutzerbeteiligung
Variable
Perspektive
Programmbibliothek
Skript <Programm>
Datenstruktur
Figurierte Zahl
Grundraum
Analogieschluss
Funktion <Mathematik>
Softwaretest
Befehl <Informatik>
Ruhmasse
Teilbarkeit
Programmfehler
Prädikat <Logik>
Tablet PC
Hypermedia
Debugging
Information
Aggregatzustand
Standardabweichung
Softwarewartung
Regulärer Ausdruck
Videospiel
Programmiergerät
Punkt
Matching <Graphentheorie>
Rechter Winkel
Mustersprache
Strömungsrichtung
Elektronische Publikation
Verzeichnisdienst
Code
Gerade
Bildauflösung
Instantiierung
Chipkarte
Programmiergerät
Bit
Wellenpaket
Nabel <Mathematik>
Klasse <Mathematik>
Interaktives Fernsehen
Framework <Informatik>
Variable
Minimum
Datentyp
Programmbibliothek
Elektronischer Programmführer
Schnittstelle
Addition
Lineares Funktional
Befehl <Informatik>
Sichtenkonzept
Template
Plot <Graphische Darstellung>
Elektronische Publikation
Datenfluss
Quick-Sort
Konfiguration <Informatik>
Programmfehler
Regulärer Ausdruck
Dienst <Informatik>
Menge
Geschlecht <Mathematik>
Rechter Winkel
Strategisches Spiel
Garbentheorie
Computerarchitektur
Refactoring
Aggregatzustand
Fehlermeldung
Browser
Projektive Ebene
Plug in
Homepage
Punkt
Browser
Mereologie
Abfrage
Framework <Informatik>
Prozess <Informatik>
Fächer <Mathematik>
Formale Sprache
Programmbibliothek
Plug in
Wort <Informatik>
Biprodukt
Softwareentwickler
Punktspektrum

Metadaten

Formale Metadaten

Titel Entomology 101: Effective Bug Hunting
Serientitel DjangoCon US 2016
Teil 26
Anzahl der Teile 52
Autor Wiles, Frank
Lizenz CC-Namensnennung - Weitergabe unter gleichen Bedingungen 3.0 Unported:
Sie dürfen das Werk bzw. den Inhalt zu jedem legalen und nicht-kommerziellen Zweck nutzen, verändern und in unveränderter oder veränderter Form vervielfältigen, verbreiten und öffentlich zugänglich machen, sofern Sie den Namen des Autors/Rechteinhabers in der von ihm festgelegten Weise nennen und das Werk bzw. diesen Inhalt auch in veränderter Form nur unter den Bedingungen dieser Lizenz weitergeben.
DOI 10.5446/32694
Herausgeber DjangoCon US
Erscheinungsjahr 2016
Sprache Englisch

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract From Frank's his early childhood of having a simple ant farm, up to and including his long experience in the deepest, most pristine, and undisturbed wilds of the Internet, his experience has honed his abilities to find and identify bugs. Learn some of the best tools of the trade that will help in your daily hunts. Bug hunting tech you will learn about: django-debug-toolbar pdb/ipdb using iPython embed effectively using Python logging so you don't need to use the last quite so often Bug hunting is all about visibility. You may have the best net ever invented, but you can't catch a bug you can't see. Sure, you can spend all day turning over rocks and hope for the best or you can gear up with the tried and true night vision goggles all the pros use.

Ähnliche Filme

Loading...