Merken

Code Quality in Python - tools and reasons

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Beta
Erkannte Entitäten
Sprachtranskript
hello 1st I wanted to tell you develop a automatically check if is good and I will
tell you I will tell you that is what we can do and this is called quoting by combining so track and
uh let me tell you a bit about my mother are there any other mathematicians here OK no OK so if you will go over some that and so there's some Turin polarized Suraman market that uh
has some very uh obscure at definition but in short works in the words of normal human can a actually comprehend it
means that a we can automatically verify if a program and have some interoperability so that for example we count right of
dictionary when you will have a check if your program is correct so we can't you you can get a dictionary and you will search for your program well my my web application is right here it's correct all good you can't write this as a dictionary and you also
come automatically verified program never fails if programmer at sum some data if you think it's it's well written whichever it means or the WTO fucked because uh because they need you can't you can't do this but again tried in fact
all we all we do is try and with all our automated tools we have we are just really simplify this task a by adding some boundaries and some some some some limits so that this task is easier not so don't worry it
might have been a harsh but it's going to be OK and we can we can do some things to check if program is good OK so I will introduce
you to many tools that are used or at least right in about 2 In the tools that are used for checking for a checking the programs in by or making them groups more and more beautiful like for mother's imports authors and also a bit of the code coverage the
so small summary of what the system going to be about that and then managers here no matematician still managers I don't get you OK so OK that's that's that's right so I will I will be the kingdom of developers perspective as so how do we then we can use that as the schools how we can improve our called a which using them because of course monitors like charts like there uh persons and to like to see that the draw or drop in some cases they but we we developers they are more now are more practical we want to see how it's how it changes over code OK so
let's begin OK so here is
the graph of as of various checkers you probably are you and you probably know all of them or nearly all all all of that there was talk about a random areas yesterday yes so this represents how a how they the how these checkers or a containing you need other meaning that a check about contains other is checking what this this smaller Jackson yes so and we see that we have 1 big joke and small this smaller ones I will talk about all of of them have OK so let's start that
right who doesn't know but ate rice your hands what last but but probably on a programmers make it and yet so that they the said about point standards for a focal groups so it's just about how cold more or less of looking and using proper just the semantics and so the ladies is suggested that in most cases you can you can you can afford confirming this goal all these rules there are no rules that you will find it difficult to uh to to use and yes those so that's a spiral triggered that's them must have of all the uh in in in most cases yeah so the next 1 is by flakes by flakes it's it's a small tracker this universe more with pop at the plate but it takes many and many a you might say the things that you would who usually you find to but by flexes foster it checking for unused variables unused imports so if you have a guy that's the when he's creating a new mobile he's copying the world imports from another file that you can you can check it with flakes and actually and give him by flakes and state hi removed this imports OK next is the and this is a very very small pool is just checking the complexity of functions and what you see here on the on the screen shot of the challenge of the a IID there in
the data complexity for for for functions a and C you just assume which level which level of food of complexity is OK for you and for example here we have 18 their level of complexity so that's very very bad to OK
and the random rather leads to like
on this on this graph a bit off of the whole of the ecosystem because of this problem is more like a metrics tools so tool for monitors and still to
see the big picture of the project and so if we are going to look if all the Raleigh project is doing good ordering that we will use random but I think it's no use is indeed a every day yeah but it also uh accounts and demarcate a score and and so on and and other metrics OK I told
amount by patent flakes and here's flaking which incorporates the by flakes and some and and make a so this is a tool that in most cases it's it's it's enough to use it if you don't if you would have better things in your code base of the condensate and I think it is also like a page is a tool that in most cases it will it will be OK to follow these rules and and here's combining here comes by and who doesn't know buying OK so by this tool for a analyzing bike and called for a bit too more in in a bit more in the dark room many more in a violations checked just another not just the patent for something like this there are lots of lots of things that finding checks by and is very powerful front and that's it's a blessing and a curse because if you are a for example creating a class and later important you buy us some important the magic or something like that will not like it if you have a class that did that the user generated field it's the it's fields binding to a lot like it will say will say that the field is is not it defined in the class where are you using it and you are using it because you know it because you know this
field is who is there so point is that the center the tool that you can't just as you just use without configuration you will always see some configuration there there are many models to ignore some they call it some common things that happen in jungle and flask it was but finally it's also very a very useful because it also points some they have places where you need to refactor something where the function is too long or the a class testimony public methods which just or or has no clear public meadow matters with which in fact should not be allowed to class needs to In presents an interface and binding the spiking encounter it sometimes these reviews relevant something smaller but always give something to they do something to to think about so
I recommend violence and
here's my lemma by lemma it out as it was shown on the
shown on the graph it just get all the checkers the probe up I was talking about and throws them and say yeah
and by of violence it's easy to think that while we'll just installed by and it will do it all but it you want to go into Europe it all all the tools if you want to install some extensions to them and the he wants so we want to have some specific settings so it's difficult to have wildly the configuration file which for someone for some people would be good but for some people would be of help to and to edit it and search for some things I personally like smallest society I can I can actually have have with the example placate because by flakes is not as began to to to to to be to the best as fully support tool and that they can fly over the by flakes are integrated very tightly no
OK so there are also other tools what's the torso won't work something clearly area where a classic tools tools for static analysis of Python called but here are some other terms again if you can enjoy the bad
245 7 8 it's like like like the documents but 2 0 5 7 is checking if you follow the for your dog thinks the value so it's a very is very far off you can see it's going to essay that you don't have point to the sorry a full stop on the end of the sentence and and many and many other and and to enforce that uh the summary line should be 1 in fact 1 line and so and many other things so find only only tells about the ducks and is missing but if you want to be and oxygen as the and that 2 points the 2 0 5 2 7 is something for you OK if a villager distal checks for that called for code that is not used and that it and as I said this well aware and I was talking about violent by it can always fall trap also for class that is defined but used it by some magic or some party was the 1st set with the with much methods as so with structure you need to be extra careful because it doesn't have many configuration options so you just can't be ignored it all
the things you don't uh you you you know will fail it is just of between between art and science checking which which functions are really not use and which are used but it's not obvious and so I recommend about a unique to you you can't followed blindly because it will eat will uh it will not and well and last of the additional closest I sort I sort in the in it's the default remote areas sorts that imports in all of the files he can find uh but he got but it can also check for imports ejected the imports our our was sort of a yeah that's not very meaningful but if you want more meaningful and the results you can install a plugin for Flickr gate which make some real the hints how do have to sort imports OK the and tools solve
this goes again like extensions inflected his own it's OK it's also is it's usually it's an it's an extension the matter check for stinks for imports in to it's bit usually something that makes some it projects especially the specific changes like for jungle flask and so on and so on and the by an American company checkers uh and so the when that when writing an extension you can't use it either to and rights it to the online all abstract syntax tree who doesn't know what our abstract syntax trees OK so when a when you have a Python program uh and this program is parsed and the the water the special wards program are changing the
Balkans and stop and from the stock you form of an abstract syntax tree like abstract syntax to it even under under this notice that that means and the logic value that the command for them and so so we just had a is is that program it's it's your program in the in the purest in the purest form and you can see here as an example is the code for that that the most relevant part of code for the McCabe accession to placate so we can see that in just the retrieves the graph and it goes goes on this i is the graph uh by by every node checking some things it is in fact here or here it's simple because group and that is above the graph AST visitor gives the complexity uh function so it's here it
just counts comes the marks
complexity OK so next next thing for mothers so if you don't if you're lazy and what you want your code to look beautiful and you don't go right because I now by them requires you to what with all these white spaces and so if you're not respecting it you're not coding by can in fact so yeah but there are some some tools that are to help but they are not but they won't do all the job the and that you should do that
1st of them is how the path out of about I don't recommend because how you can see there and it's a it fixes it fixes the peptide violations not all of them but it it's a very ugly it line breaks so I'm not it's it's it's not about unless you want to add you to check and see the and repair after it
yup yup so rather new projects from from Google and in in in the in the box again you can read that Jefferson and so this also means to go all job for you but we it's there it's meant to unifying day style it among the whole company a for example the they told that they did the wrote in fact that you can they are the proposed a hook that will format your code with young so that the format and the master branch is always much the same way even if you have your personal preferences yep will do its way and I thought I was going to looking about it it's starts imports OK next next to
think the best best coverage and who doesn't know what is this coverage OK this coverage it's about that you will run all the tests and then in the meantime you check which the lines in your code where they executed so that you would you can be sure that all the all the all your code is executed an 12 register model that you can use also in other in other cases of for for example uh if you are should the if you are in the running gear application just to see that the code is used but its most common use cases just for testing and so they a the colonies case for using coverage is that you edit checks coverage on your branch if you're working on branches and each other for example and a you compare this today today
coverage on the master branch so that you don't you don't do worse than it was before 1 thing to
remember about coverage is that it there more than extensions to no status or by guests with coverage a sometimes don't so you don't have that good results and the in near the end of of of the presentation will be shown a better way of running coverage it it it should be just right before data that the actual test our just around the Sun inside the coloration of the other a OK
and other items that you can use that discover and the
quality of their tools upon a running this
you give discover and the coverage XML file and the it checks the if there are some interesting guidelines on your brand but on the on your branch and city of quality works and it's a bit to the same you give it check out a and the text a but shows the violations on only on branch a diff quality supports only a limited subset of Turkers but you can opt new that they're not it's not in notes of possible by extensions of our common compare configuration but maybe it would be in the future OK get it is also a small tool like discover but smaller because it just it just announced by using and on your on your branch converts to the master and if you have a colleague about a lease they orthographical mistakes in problem and habits those the stories for you you can check you can check if your if there are any errors in your account like what we have here the absolute absolute if instead of absolute yeah so you can you can catch catch to this things OK so as a
couple forcible confirmation who doesn't know talks OK so if you don't allow books you want to know because stocks stocks a marvelous tool for a running running tests and it handles its own in the trial and so you just don't need to bother about anything you just can't out and run it and the and it's and down there you can also enjoy some patterns to that strict binding and what I recommend and what I using my product we have a we can we are coding from the top and Jenkins has uploading is to tool build at every people request in our case it means that this plugin for every pull requests he's running the test that buying flake 8 and the if the results of tests if the coverage is lower or if the binding faces
is there a bit better than the put request can't be matched so I recommend however however
you may not want to run jinkies because it's it's jostle for its beak and it's consuming all the around the season it is given so maybe you can use Travis or another is
CAD tools OK and it's
it's an example of integration of talks you just uh you just to give what what by conversions you really need to check against and you write comments here we see just it clearly that coverage around the minus and Knowles and so this so it's surrounds knows in cycle right in the generated XML fetches the latest must the uh and France discovered if quality is an example from the discovery project you can find it on the top
OK so a couple of words about why you and I probably have
1 minute OK but as 1 of the most of these cases and he just wants a uniform style you just want to be just 1 that and when you go to some model but nobody worked for a month and a man who were funded on that leave the company you want when you when you go there you want to the being the site there environment that you will not uh and the I don't know that no 1 minute thank you and intense code coverage and and other tools give you that also coverage is the best coverage you have high this coverage like 90 per cent or by the it it gives you refine a confidence to refactor of them because if you reflect the and you and you break something then you will know about it because all that that's weird and they will say a what's wrong with that OK if you want to if you don't have
time to do this you can go to managers with this buzzwords soul mind than the maintainability readability extendibility it it's always better predictability also yes so a through other account take your account uh around coverage all you will find only things will go terribly wrong
and irony questions we time 2 questions 1 from the litter the back of great so OK 1st of all thanks for showing great but the 1 point I'm
missing from your presentation is a solid and it's that plugin for Python well let's be silent about taking rules of users because it's it it's here own custom Java implementation of analyzing AST trees uh but the cool thing about this is that it soon maintains a list all the issues in your code yes that's that's helpful helpful boxes selected is running low on only by and so and so on and a couple of custom tracks but uh that's not enough uh at least for me yeah you can use it and the if you have enough room to run as some argue the apple go go with it as the ice is even nicer creates it creates issues if you actually want to have every violations of separate issue that's the that's the other thing OK by me the same way as it was from a question yet so I would like to ask you if you know any other tools for a line of utilizing core maintaining a list of issues that come from by alarm other tools you mentioned because you said you alive but used confused aggression so long soul when my current projects we just had and muster must the job of a 1 on Jenkins we checked the master with all the with all the rules we were really wants to be faulty enabled and if someone has had some free time in the end of the spring uh he just he he just was was taking some of these rules and fixing them as some of them also being required sums usury factor so you can you can for fix all the all the piling that so what about all that but I can't I think relations for example in my hope in in in in 1 day if it's not that they're going to eat project uh but a for the for the more this year a factors you will need to really uh think of how to what needs to be done and that a and the block for this 1 to be just Higgs violations here and here because it might be a bit of a bit harder thank thank you there were 1 more question you yeah my question so you have some good tips for enforcing a cone of rules maintenance team of 5 or more people without being too rigid about about for example about animals and stuff like that we don't we don't need for what without being too rigid without having them In political Richard refuses so that Bush and if you have some some other because in my experience that's like a big problem you that you you have rules but always have people in circumstances and other problems which when you break the rules so the images and the difficulty with that obtained my my approach was to a enabled the rules of projects a and not not not not all all of them at once but the ones that can be can be enabled and the union of who we we want to use it we weren't using combined than thinking from the very beginning of the project we we just started using heat from the core but with the corporate plate and later we expand it would it would consecutive rules from the gate from fighting against the I think that's that's the part that was my path worked people wearing a word and angry about this because we live in general if the people are most angry when you will make them fixed someone else's mistakes and we if you have dif quality discover they would just be due to the need to fix the of their own mistakes so if you don't if you will if you will talk with them and tell that you are going this way and they will agree so it's it's it's going to be OK thanks thank you very much Aaron that you
Portscanner
Maschinencode
Computeranimation
Portscanner
Theorem
Bit
Funktion <Mathematik>
Eigentliche Abbildung
Mathematikerin
Partielle Differentiation
Wort <Informatik>
Normalvektor
Computeranimation
Unendlichkeit
Theorem
Eigentliche Abbildung
Web-Applikation
Optimierung
Computeranimation
Portscanner
Task
Randwert
Programmiergerät
Gewichtete Summe
Stichprobe
NP-hartes Problem
Optimierung
Computeranimation
Mittelwert
Autorisierung
Maschinencode
Bit
Maschinencode
Gruppenkeim
NP-hartes Problem
Data Envelopment Analysis
Optimierung
Computeranimation
Graph
Softwareentwickler
Maschinencode
Task
Datenmanagement
Perspektive
Maschinencode
Physikalisches System
Tropfen
Softwareentwickler
Computeranimation
Lineares Funktional
Programmiergerät
Punkt
Pauli-Prinzip
Graph
Benutzerfreundlichkeit
Gruppenkeim
Schlussregel
Elektronische Publikation
Komplex <Algebra>
Computeranimation
Eins
Arithmetisches Mittel
Metropolitan area network
Variable
Flächeninhalt
Spirale
Randomisierung
Grundraum
Aggregatzustand
Touchscreen
Standardabweichung
Lucas-Zahlenreihe
Metropolitan area network
Lineares Funktional
Last
Multiplikation
Pauli-Prinzip
Datenmodell
Komplex <Algebra>
Große Vereinheitlichung
Ext-Funktor
Computeranimation
Übergang
Metropolitan area network
Multiplikation
Pauli-Prinzip
Graph
Linienelement
Projektive Ebene
Modelltheorie
Extrempunkt
Computeranimation
Unterring
Bit
Maschinencode
Punkt
Pauli-Prinzip
Kontrollstruktur
Klasse <Mathematik>
Regulärer Ausdruck
Kombinatorische Gruppentheorie
Nichtlinearer Operator
Computeranimation
Homepage
Metropolitan area network
Informationsmodellierung
Modul <Datentyp>
Typentheorie
Konstante
Lambda-Kalkül
Konfigurationsraum
Meta-Tag
Leistung <Physik>
Modul
Lineares Funktional
Binärcode
Elektronische Publikation
Kondensation <Mathematik>
Analytische Fortsetzung
Übergang
Visuelles System
Gerade
Zeichenkette
Programmfehler
Uniforme Struktur
Datenfeld
Parametersystem
Client
Restklasse
p-Block
Unterring
Pauli-Prinzip
Graph
Seidel
Logarithmus
Elektronische Publikation
Gerade
Computeranimation
Zeichenkette
Metropolitan area network
Menge
Total <Mathematik>
Konstante
Lemma <Logik>
Parametersystem
Restklasse
Maßerweiterung
Konfigurationsraum
Hilfesystem
Modul
Meta-Tag
Sichtbarkeitsverfahren
Maschinencode
Punkt
Konfiguration <Informatik>
Klasse <Mathematik>
Term
Computeranimation
Hydrostatik
Datenstruktur
Konfigurationsraum
Gerade
Analysis
Modul
Inklusion <Mathematik>
Caching
Klassische Physik
Frequenz
Variable
Konfiguration <Informatik>
Endogene Variable
Flächeninhalt
Funktion <Mathematik>
Datenerfassung
Attributierte Grammatik
Restklasse
Umwandlungsenthalpie
Resultante
Lineares Funktional
Bit
Wasserdampftafel
Mathematisierung
Plug in
Maßerweiterung
Extrempunkt
Flickr
Elektronische Publikation
Quick-Sort
Computeranimation
Metropolitan area network
Task
Verknüpfungsglied
RPC
Flächeninhalt
Rechter Winkel
Maschinencode
Abstrakter Syntaxbaum
Maßerweiterung
Optimierung
Default
Information Retrieval
Lineares Funktional
Maschinencode
Graph
Gruppenkeim
Abstrakte Syntax
Maßerweiterung
Mathematische Logik
Komplex <Algebra>
Computeranimation
Graph
Metropolitan area network
Bildschirmmaske
Knotenmenge
Abstrakter Syntaxbaum
Mereologie
Optimierung
Spezialrechner
Metropolitan area network
Maschinencode
Prozess <Informatik>
Kontrollstruktur
Komplex <Algebra>
Gerade
Raum-Zeit
Computeranimation
Gammafunktion
Mittelwert
Softwaretest
Maschinencode
Quader
Verzweigendes Programm
Kartesische Koordinaten
Computeranimation
Metropolitan area network
Bildschirmmaske
Informationsmodellierung
Softwaretest
Prozess <Informatik>
Hook <Programmierung>
Dateiformat
Projektive Ebene
Gerade
Modul
Gammafunktion
Mittelwert
Softwaretest
Resultante
Softwaretest
Verzweigendes Programm
Kantenfärbung
Kombinatorische Gruppentheorie
Maßerweiterung
Computeranimation
Modul
Bit
Explosion <Stochastik>
Verzweigendes Programm
Überlagerung <Mathematik>
Elektronische Publikation
Gerade
Computeranimation
Teilmenge
Metropolitan area network
Bildschirmmaske
Total <Mathematik>
Inverser Limes
Maßerweiterung
Konfigurationsraum
Fehlermeldung
Resultante
Softwaretest
Metropolitan area network
Mustersprache
Gebäude <Mathematik>
Plug in
Überlagerung <Mathematik>
E-Mail
Biprodukt
Innerer Punkt
Metropolitan area network
Umsetzung <Informatik>
Softwaretest
Rechter Winkel
Dreiecksfreier Graph
Projektive Ebene
Bildschirmsymbol
Patch <Software>
Überlagerung <Mathematik>
Computeranimation
Integral
Informationsmodellierung
Maschinencode
Web Site
Bereichsschätzung
Wort <Informatik>
Programmierumgebung
Metropolitan area network
Softwarewartung
Punkt
Prognoseverfahren
Datenmanagement
Maßerweiterung
Computeranimation
Quelle <Physik>
Maschinencode
Bit
Gewichtete Summe
Quader
Applet
Implementierung
Kombinatorische Gruppentheorie
Eins
Netzwerktopologie
Weg <Topologie>
Prozess <Informatik>
Gerade
Bildgebendes Verfahren
Hilfesystem
Drucksondierung
Trennungsaxiom
Relativitätstheorie
Mailing-Liste
Schlussregel
p-Block
Teilbarkeit
Softwarewartung
Verknüpfungsglied
Mereologie
Projektive Ebene
Speicherabzug

Metadaten

Formale Metadaten

Titel Code Quality in Python - tools and reasons
Serientitel EuroPython 2015
Teil 57
Anzahl der Teile 173
Autor Ganczarek, Radosław Jan
Lizenz CC-Namensnennung - keine kommerzielle Nutzung - 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/20188
Herausgeber EuroPython
Erscheinungsjahr 2015
Sprache Englisch
Produktionsort Bilbao, Euskadi, Spain

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract Radosław Jan Ganczarek - Code Quality in Python - tools and reasons Beginner's guide to Python code quality. I'll talk about the tools for code analysis, differences between them, extending them with new features and ways to running them automatically. In the end, I'll talk about reasons behind all of these tools and try to convince you to using them in your projects (but if you are against it - I'll gladly listen to your arguments).
Schlagwörter EuroPython Conference
EP 2015
EuroPython 2015

Ähnliche Filme

Loading...