Merken

TDD of Python microservices

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Beta
Erkannte Entitäten
Sprachtranskript
so we report the last of decision as the shall those who lives with this with the development of the micro-services proved to be if you need from when he you hear in their late so I will be talking fast because I have a lot of stuff to say so if I start mumble doesn't want me OK does this and I know that I need to go slower so I'm not about micro service talk but from a slightly different perspective yet so I'm hoping to and will I would only to be telling you about my story with my this interview and yet they will be the rest micro-services they are fine in some cases there are bad and and others you know like everything and I'm going to it's not that we don't know much about how to do TDD is going to be more about to you need for it the of like this is this and services in general so we could
have a well as a professional my whole life there was an Intel I did some of stuff with a distributed testing in the shop windows and the components in all and so it and limits written in Java there and I went on to a project with lost lost cold for uh hardware backed secure channels but finally I managed to get myself to micro-services project and micro-services based on the platform as a service actually funding and its goal was to the extent that it's open source like that I can stick it out but you know all the good things come to an end and I've decided that it was time for me to be wrong so I I am out of independent by Python researchers so yeah I am unemployed for some time now so if you have a few bags of gold right lying around and you have offices in some nice places all over the world you know like FIL me whatever and I'm trying to get of block together but know it's not there yet but I just made it up most of my stuff is so micro-services
what they if you somehow you know miss is that with through those stocks this year and last year and on for all other conferences and blocks from all over the world where they are so this is what is what services they live on the map of the network and most in the back in the middle word sometimes the front and stuff can we don't pretend to be micro-services but it it's mostly using front and then tends to be bigger than the and micro and this is the hard to defined but generally they should do 1 thing well like you know all good Unix problems they act independently of 1 another they they are only interested in what comes in what they then good out and on the data sources and pole rest of the world doesn't interest them but for them to actually be able to do something no real need to work together
and there are guidelines for treating like programs and that actually died good guidelines for any web applications I think I thought that they that this 12th factor at thing feeding heroic but suppose Martin Fowler came up with that like many many years ago whatever definitely take into account those rules are I think the most important things are that you know so this going to be big so if you want something included in the database and data Teflon-coated basal no branches for deployment to other environments no 1 branch 1 code for a this if you want to you know configured to some other environment configure through environment variables they don't work so I would advise you
know what the coffin uh don't go into my services and in the beginning when you start a project just start with the good old aware that no I'm always just decide not to write it in a city where but code it would be fine probably and just start you know starting out bits and pieces when you get to know what's the project is actually doing because if you start with my this is this you'll spend way too many too much time just thinking about you know what we will be doing in the future and you know what is bound to the she should we defined it's it was so we had
my adventure with the amazing project was finite value I finally went into doing back and stuff so I dream about for some time sadly I need to do a lot of Java EE at both extremes good and now we can know about it and I hated it but I was actually able to create my own life and and this and I think that it was doing rather well on my other the job that once and you know the project is drawing from like 6 people we went to 70 and sometimes so pretty interesting again library of all new kinds of interesting uh tasks to do not and more people more tasks I don't have enough time to to look over my little that service and sometimes known pretty embarrassing bottle that we would get through my uh no review my even my own called you know it was a single small changes to it shouldn't do anything bad about and they wouldn't start production the code so if you have a few embarrassing moments and that even some of the things gendered new to do college of my code and I didn't have time to review them thoroughly because I had stuff to do and then we had it they will would break the service and I would have flat less time to do my stuff because they need to do but my service and it was not clear how to no 1 but couldn't do not this of course of course just like the solution to everything you have problems with software probably you don't have but I've had those and
that's about 85 % coverage which was at that time group among our services but you know it was a proof of concept of but yet they were getting pretty complicated wholeheartedly hard to maintain a lot of moxie on the marks for everything and the find stuff for us with all the all all the all the marks of being lines of code for test they don't actually check if the service with the surrounding if you do by summing up by by the detector that applied and tested supposed you that well those who unit and unit test don't check if if your hold block what's the only check if bits of love of the blood work on them so so you know I needed something new why don't look like
you know like start whole process like it formed the clusters back in production and social call like it would be normally called why not do that you know that compute in a way that the act of editions doesn't know that that it isn't in production you know know some of so ugly local classes except for a really ElasticSearch collections for example you know and the better if I could try and those tests locally known before submitting a pull request actually know for the other people if they could run the best locally before they submit the request notably to define then you go with that I would have a treaty high degree of confidence that this code that was committed would actually running when it goes to production but yeah it's kind of hard been you see you have this thing that know you have service and has database let's say but your service depends on another service and this is the kind of analysis and stuff like that and stuff like that so how do you test that locally in being part of kind of part the class so yeah about external services you can deal with that in that you have applications that out for stops uh services they actually you know you have stuff like why Mark unfolds Java veterans which is a process that you can start and you can be configure it through HTTP calls for it to start serving on other part so basically to start pretending to other services but there's also a thing called pretenders in Python uh it can be easily used from normal looking at best but I didn't use it a lot I don't think that it's it's really beautiful but you know your mileage may vary and there's also a something called development about which this but this is the wire marked but better and with more features and it is interesting in John actually nodes but you can just download the whole binary package for your system and not install any independent so that stuff
2nd thing database you know my ElasticSearch that I could just tell everyone to install it before they run test but you know we have other services so that they would need to install like readies for another service and know whatever the for some other service of junk would pile up on our systems and it was because fire some you know what why why do you need to do a lot of stuff just to get to work on the projects of yes it is it would make the test on a test and fun I know their fun for me and so yeah there there's a thing called about not many people do that it's some things like that imagine that you're creating a database and you already the wisdom of the you distribute out this double for people to test against your database and you best that your test bubble actually behaves like your database this is a thing called verified fake and I don't actually know of any people who do them but they're really previously in in in in some cases but yet and nobody does it's it is as to site but you have to go to another about awards bucket because you know you us full rate rather that's it and the only dependency that's your tests have is not the and nothing else the fact that you know just supposed only Linux now it's as I've heard that it's own Windows and on a section of an old multiplatform so now it doesn't work as well as everywhere so uh yeah using
and again uh and now we have the basics for all for our TDD tools so let's not drug broader context and so far magical those best for the whole application are actually know component component that according to modern following I stole the flight from as the length of the bottom uh yeah but there's also names for those kind of tests in building micro-services from O'Reilly are grade book and they are called service tests and I tend to use this name but you know component as service for or a Harry Percival's books of physical development with Python and I think those these are called functional functional tests for and all those things mean about the same thing
are and this is the this only did want i won't go deeper into it there's a the no idea is that you write a function that or service that then you see final then you write a unit knows as involved in that and that's why some go then you have there for functional test passing you have 1 feature and do it again again again again again little so this is the uh to double TBD I think it's called or outside entities and sometimes it involved a thing called wishful coding and so we have really good but we don't have time to go
into the cell I noticed that to the was exactly what I needed do saving in the project I it gave confidence in face of change you know I wouldn't to push this this staging environment to see if everything is actually working you know like this from the best of the robots does everything for me uh you know I could take someone's branch from book request and even if I didn't trust them to run the best I could do it myself is really quickly so yeah I I would like to and I drove for something like that 1 of good think about it's now intends to water that that design down we need to get a good design now but you know when you need to test of you tend to write them in a way that is less of noxious to call yes this but TV has 1 1 critical flaw it requires discipline you know it's you need to practice the need to think about the to live in the TDT where you know like you don't become the Schelling model by just no reading up on Council on the internet you need to go to a certainly there for a while and stuff and others anything else but the case the problem I have another thing but this isn't as big of an issue as the discipline that requirement you to do TDD and this will give you so you know like as for the
implementation of those tools
I created our cities it's called PyBossa Python rewrite all the last 2 years and it's not german it's data acquisition service micro-services they usually they are all open source by the way uh yes so it was it was all that was 1 of the 1st you see and it kept trying a case can be getting back bottom the interface was well defined so I thought that you know this can be mined will deviate I could test all my testing stuff then and I we're all this basically using the so it wasn't strategy s the general 1 actually was rather good about you know from the perspective of today it isn't great but you know it was educating for me if you look at it and it's that you know when it have checked out it can be educated for you because everything that you will see implemented on the slides so things like this implemented in there of also decided to use patterns in my class because by this rate is concise and has amazing thing called fixtures and you can composed of both fixtures by lose by pursues the thesis all I know maybe there's something of that's great but I don't know so yeah harvesting the best so would
you she this code here yeah it's a this is how your service that you're functions that can look like an extraordinary among other things like that you think it's a hazardous that center the city of few yeah this is by the 1st so if you want the what is the structure of the fixed so as you can see it here this our service extends the different to this and because they depend on other fixes within and we will get to that but this test can be pretty simple in terms of necessary but some something in the database then just do I see request on the URL of the service yes and it is because we know we are also testing authorization because we were going through the whole applications that we're going to everything and then do some sort of social so we that the look nice things about the fixed I was a trick here you
see there the B fixture and it doesn't do much that is itself a skull uh functions called fixes so you know if it will get created on the stairs and only you suffer from pure and then it does lastly B which is this is this the baby section is already client which selects for the whole session and this might be controversial because I'm not we retreating various on it so this test you know I'm using it because I felt that the most of you know registrable maybe did their job right so I'll just cleaned up there is fast and save a lot of time you know not having to create an entire adopting with the database in also the of course the recession requires already support and where it where does the response time from our from I just something about the but the client downloads the image if it's missing uh wait for the container to start because you know you you need it to be able to start accepting connections the light you report back to the test and when tests are done so after hold tests I removed it from the doctor something so we yeah not in no chance of the best and if you're interested in the the variance of because just check out by as
OK architecture you or this lecture will represent the are synthesis process the whole process and if the same trick probably with the session version of our pictures it will be that but you know long long lived and we also have an external service in Boston and this simple is the thing that pretends to be on other service and what do we need to implement those 2 things seemed mind to think of course
that thing I've told about earlier but we also need to management by the in Python that so I created out library golden onto by and I think that it's rather nice I use it in my final tests and hopefully somewhere else in the future I inside with the kid no you can get going to give up a fossil stars and other thing is around it and what does it do it start amount it starts motorbike process it downloads motorbike if you don't have it if you have it it will use this is the mountain bike if you don't have it it will just download of the binary package it only works on Linux now but you know if you if you want to work on Mac OS or whatever it is but an issue or even you better the traitor Apple request and you know what I heard when I in this or that it it manages momentum and process but I also notice that I can use it to manage other prostitutes for example this this 1 of my service so that it also manages to responses so anything that you can start on on command line and surface uh you managed if it with meant by OK this
is a big chunk of code but they would need so alright so that's what the does it take to do because the commands you know in the start of standards the opening of basins of array of same and by doing weights this year I I've been using weights as 3 know with the server like gonna on or micro is the or you will be as someone who would college and engineers no following multiply this country that service is supply the command then you supply environment variables because you configure your answers through environment variables the and you made note is this for things here there is a notation that using amount by if you don't want to fill the port for itself you can just put this in and multiply will if you of the from so that from your computer so here you start a service you attend object at best and then after the 1st use of the service of its own of motor traffic that's right
and the simplest what is well we use mountebank created pulses of modern like this you hear nothing and it is interesting to ignore the bank started yielded stop it at but with underlying preconfigured those impostors and I decided for them to be functional so they are mocks they remember what requests went into that so you probably want to kingdom out tween tests so this can be useful in all this is not simple the crew declaration of an so I just you know some boards In some cases in the past and this you will will we just you know we returned to 100 for posts on this path as even configure signals more precisely and it's the same thing that trick with this language to itself OK we have everything
right in that we have everything to
create are legendary Service does that that that will save our lives but you know it's it's more than 1 task and it starts 1 clusters another process and it's fascinating pyruvate database in but the container so when they take longer saying now this is seeing anything setting at 3 seconds so maybe if you have does not last that long people will
actually run your past the profits the we found when it's when it has to I don't know that the dark image it will take longer take longer and there's also this thing that when I run them on the 1st try after my the machine puts up it's like 3 times longer I think I didn't exactly went into why that is but yet it was all and all this is just like this we will get to that later became
a few warnings these your service Desk screws up the fighters will give you all the standard output and you have output from like a few processes that so you'll get out of fuel and that know what went wrong that's gonna the wall text so be aware of that and the breaking of fixture for example you know I might be of service fictional also yields crazy the glass you know I break fixes of because they tend to reflect the arts and with that you can refer factored to and you should also factor and sometimes they it happens it should happen is good for you and then we know even with those very technology of those masterful dust the you won't save you from human stupidity for example I convey my pride as I wanted to check if it if I can actually switch out of the old service for my Brighton signed by someone and you know I've so in staging environment and it just kept crashing on request and why was that well I have hard-coded local holds in red is on my machine that would run because the best of your those tests of local host and has announces that so you know they won't save you every time
OK so we have to be we have over wonderful test
of the whole application so what can go wrong how well other people because it's never really you we are perfect of course there are other people can just don't give a shit about TDD In this node trapped of college put it in local regression if not that with 152 spectral lines where Java variable names and that so what can think what do we do with it well we have a few weapons against them we have the best coverage of we have static analysis and we have a contract with beautiful I've almost joined myself with a bit of water no problem OK we have contract tests and know let's go over the over each of those yeah this my coverage of short version of my current i r C from Paris if you don't know what this is is called we look up coverage library for
Python and I have this thing and this might be controversial because I think that the test fails if you don't have 100 per cent coverage and you know why would you not have on this encourage you to the right and is this 1 piece of code you know not worth testing you don't want it working social if you don't want to work in maybe just deleted but you know what argument that I hear from people is that know all that if I want to have fun at the center of a it's I need to do those in you know brain 1st that only those remarks and certified call 5 marks in a sequence because this is the group wrote you know what you don't have to do this because you have this we have this kind of stuff 1 of the most amazing things in Python that I find in a while and this the option of the coverage of the library to allow you to get coverage from other process so you can actually get
coverage uh from your service process that serves are related the request and it can be added to coverage state and if you want to check it out how to do that taken by doesn't account for this the prediction link with status analysis yeah and
just put it into box if you don't know talks is a great interest from afar Python use it on the use of the link is on as you know my desk check my coverage and then just find out about 5 times if found finds anything is gonna give non-zero written down the test are going to fail so if you have some that stuff in your code that yeah I know Parliament isn't perfect but if you're absolutely Tolley server that you're not doing anything about and most times when balance so that you know 7 the method arguments are too much it is too much but if you're actually absolutely sure that you have to that you can just add a comment in Python in our area so that any that all in the normal traffic fell before reviews of more time for me more time for you to do actually work
contracts this year will react anaerobic things they keep your interface flow in life and
had this wonderful thing uh Colts and of a language to describe the rest the see that this past as the government said parameters they have names they have fights for their responses for example felt 200 they have no this time for the response of the sum of the weights to see you here I have those little apostrophes or what whatever are they called yeah you could just do 200 as an integer insight about Python Seattle possible complain about it yet but to what this what you last week can the contract for services context is the thing keeping you know our whole micro-services platform running because you know people have expectations of other services and you have expectations about the other services so we need to keep the contract fight and with that you can keep the contact separate from the coat because at times you can't just you know somewhere around 2 levels deep 3 levels of the in some models we're just you know your accent optional things actually you've you've just change your contract and normal testing may pick that up but it isn't something to be done lightly so we watch out
for that when I going to do to do something with slugger we're going to use dropout which is a client from the Alps thanks from uh and it creates it dynamically creates clients for your swagger service and it's also very finds a lot of stuff so you know parameters that go in things that the the paraffin from the service so you don't need to check the type let's say of the big object that the objects that it passed it is done at the moment the ultimate before you buy bravado and straight at all so you to do something like you know I returned from I was supposed to 2 thousand 200 bucks whatever yet brother will to VG for that but it's configurable uh it doesn't have to be as far as marginal but we
want to use it yet so in our service that we can just walk bravado yeah clients from for the plan for request and also this this now also double as contact analyze demise what we shouldn't cover the whole API with service does it it doesn't work that way you should just you know you service like in the integrated test for a few critical path let's say you have other like equity stopped on in your API and you should use unit tests for that but it would be sweet if if we could also verify them with swagger so I did a little library because bravado is accessible been on HTTP client that actually use this file contest framework and you know for all web frameworks like flat or whatever you have those best framework track writing unit tests of against and I had a little library can also donated with it and you can look at it that it's used for integration of bravado and found that you can look at the code and it's it's it's it's not that match and you can do with with class or whatever so now you know and now all our tests that but the are also contract so produce which is
how the tests can include is the some imports into clients in this fact sectors of the IMO file here you know insert the ACP clients the fokker Mr. kind that needs to be uh no filled up with a API object is the same as Apple objective last for example is you know your request you don't need to worry about what's the path because the client will know that as you know you specify the parameters for example the body heat and work and work it could be something like that past parameters and brother will check all that is you need to do our result because the interface is also recommending a synchronous request of you know this is thing and just a sense of In the 1st as we know is the if you
don't look much different normally you wouldn't do that in the double the same path and services and in but the the thing that's the difference here is that you to have his back but you don't know use of special at basically clients here I'm just using this standard synchronization time but I need to give all your all you are all right now because this is not real so responses that here but in doing so can also specify some reconstructions efficiently yeah and so you know like those in the
context of so now we should be fine you know on services is taking care of it is it's it's working perfectly is 100 % per cent coverage and the tests actually check if the service rounds you know we won't mess of the contract by accident so great so odds of is that we can go home right you know this
is just to do I 1 microservices and know in theory all these things should run because you're you know contract you abide by context everything's fine but the world isn't as simple there are things you won't see individual so we end to end that and exploded tests for a whole might service system and then home to do and I don't have time to talk about in the news and so yeah here are a few sources of energy fj
the going to of nothing seriously because there is that the beaches along with the other but I can I think good thoughts that relate to my
talk this year I think for the talk was that I was just seeing
the if you tried instead of using just this delicate by by using an don't have composed in the unique death so he just was not the infrastructure and you can run your application inside a container I saw I mean you may have even seen last name and the same with the environment and yet I could do that but actually I didn't come to tonight on application of the neurons in in containers so that they just didn't like 1 or 2 containers for you know in the example of 1 container it's easier to just the that and and the fixes can do stuff like the only thing that the composed can also downloaded this year but it worked it worked well in fixes and if I would to do you want to use the composed and I need to Iraq's Dr. composed of thinks of it because I didn't want people to have to do anything you just get close to in locker in some parts and thus run up and is everything that you need to do to run those tests because we don't install the back of book to install anything else well you need the they of have 3 sort your work anyone else I because that's the thing himself in the equivalence few
thank
Web Services
Perspektive
Dämon <Informatik>
Vorlesung/Konferenz
Softwareentwickler
Entscheidungstheorie
Systemplattform
Computeranimation
Intel
Web Services
Bildschirmfenster
Inverser Limes
Zusammenhängender Graph
Maßerweiterung
Stochastische Abhängigkeit
Signifikanztest
Web Services
Videospiel
Hardware
Datennetz
Güte der Anpassung
Systemplattform
p-Block
Quellcode
Office-Paket
Web log
Mapping <Computergraphik>
Polstelle
Rechter Winkel
Projektive Ebene
Wort <Informatik>
Bit
Web-Applikation
Datenmanagement
Code
Ähnlichkeitsgeometrie
Computeranimation
Variable
Task
Maßstab
Ereignishorizont
Konfigurationsraum
Fehlertoleranz
Kontrolltheorie
Web Services
Prozess <Physik>
Teilbarkeit
Prozess <Informatik>
Datenhaltung
Verzweigendes Programm
Datenmodell
Schlussregel
Programmierumgebung
Teilbarkeit
Web log
Zwölf
Schnelltaste
Projektive Ebene
Versionsverwaltung
Programmierumgebung
Signifikanztest
Bit
Komponententest
Prozess <Physik>
Güte der Anpassung
Mathematisierung
Applet
Gruppenkeim
p-Block
Biprodukt
Signifikanztest
Abenteuerspiel
Code
Computeranimation
Task
Einheit <Mathematik>
Web Services
Einheit <Mathematik>
Software
Beweistheorie
Programmbibliothek
Projektive Ebene
Gerade
Hoax
Web Site
Prozess <Physik>
Klasse <Mathematik>
Applet
Kartesische Koordinaten
Signifikanztest
Code
Computeranimation
Systemprogrammierung
Web Services
Bereichsschätzung
Statistischer Test
Softwareentwickler
Cluster <Rechnernetz>
Analysis
Web Services
Signifikanztest
Prozess <Informatik>
Datenhaltung
Systemaufruf
Ausnahmebehandlung
Physikalisches System
Biprodukt
Bitrate
Portabilität
Minimalgrad
Ganze Funktion
Mereologie
Garbentheorie
Projektive Ebene
Signifikanztest
Lineares Funktional
Dicke
Physikalismus
Gebäude <Mathematik>
Kartesische Koordinaten
Kontextbezogenes System
Signifikanztest
Computeranimation
Gradient
Einheit <Mathematik>
Web Services
Einheit <Mathematik>
Statistischer Test
Code
Refactoring
Disk-Array
Zusammenhängender Graph
Softwareentwickler
Signifikanztest
Wasserdampftafel
Mathematisierung
Güte der Anpassung
Bereichsschätzung
Verzweigendes Programm
Implementierung
Zellularer Automat
Computeranimation
Roboter
Internetworking
Informationsmodellierung
Bereichsschätzung
Projektive Ebene
Programmierumgebung
Implementierung
Autorisierung
Signifikanztest
Lineares Funktional
Fehlermeldung
Datenhaltung
Open Source
Applet
Kartesische Koordinaten
Bitrate
Code
Statistische Hypothese
Computeranimation
Endogene Variable
Rechenschieber
Modallogik
Web Services
Perspektive
Mustersprache
Strategisches Spiel
Datenerfassung
URL
Datenstruktur
Kontrolltheorie
Schnittstelle
Einfach zusammenhängender Raum
Signifikanztest
Lineares Funktional
Prozess <Physik>
Logiksynthese
Datenhaltung
Versionsverwaltung
Computeranimation
Client
Web Services
Statistischer Test
Garbentheorie
Computerarchitektur
Response-Zeit
Bildgebendes Verfahren
Varianz
Impuls
Prozess <Physik>
Gewicht <Mathematik>
Prozess <Physik>
Instantiierung
Code
Computeranimation
Algorithmische Zahlentheorie
Objekt <Kategorie>
Zahlensystem
Variable
Datenmanagement
Web Services
Offene Menge
Flächentheorie
Statistischer Test
Rechter Winkel
Endogene Variable
Server
Programmierumgebung
Standardabweichung
Informationsmanagement
Web Services
Statistischer Test
Deklarative Programmiersprache
Formale Sprache
Signifikanztest
Whiteboard
Computeranimation
Task
Virtuelle Maschine
Statistischer Test
Prozess <Physik>
Einheit <Mathematik>
Datenhaltung
Zwei
Systemplattform
Cluster <Rechnernetz>
Signifikanztest
Bildgebendes Verfahren
Computeranimation
Signifikanztest
Fehlermeldung
Prozess <Physik>
Stellenring
Computeranimation
Web log
Virtuelle Maschine
Statistischer Test
Web Services
Statistischer Test
Kontrollstruktur
Programmierumgebung
Funktion <Mathematik>
Signifikanztest
Parametersystem
Folge <Mathematik>
Bit
Prozess <Physik>
Wasserdampftafel
Applet
Gruppenkeim
Versionsverwaltung
Systemaufruf
Kartesische Koordinaten
Code
Computeranimation
Konfiguration <Informatik>
Design by Contract
Open Source
Knotenmenge
Variable
Rechter Winkel
Statistischer Test
Lineare Regression
Programmbibliothek
Parallele Schnittstelle
Analysis
Signifikanztest
Parametersystem
Prozess <Physik>
Quader
Binder <Informatik>
Analysis
Computeranimation
Statistischer Test
Prognoseverfahren
Web Services
Server
Analysis
Aggregatzustand
Schnittstelle
Gewichtete Summe
Gewicht <Mathematik>
Formale Sprache
Information
Systemplattform
Computeranimation
Übergang
Erwartungswert
Informationsmodellierung
Statistischer Test
Web Services
Design by Contract
Endogene Variable
Schnittstelle
Trennungsaxiom
Signifikanztest
Parametersystem
Videospiel
Boolesche Algebra
Kontextbezogenes System
Dateiformat
Datenfluss
Endogene Variable
Design by Contract
Konfiguration <Informatik>
Zeichenkette
Ganze Zahl
Normalvektor
Versionsverwaltung
Decodierung
Komponententest
Momentenproblem
Browser
Klasse <Mathematik>
Programmverifikation
Familie <Mathematik>
Automatische Handlungsplanung
Framework <Informatik>
Code
Computeranimation
Statistischer Test
Client
Weg <Topologie>
Benutzerbeteiligung
Web Services
Statistischer Test
Design by Contract
Datentyp
Programmbibliothek
Signifikanztest
Parametersystem
Matching <Graphentheorie>
Krümmung
Elektronische Publikation
Design by Contract
Integral
Objekt <Kategorie>
Einheit <Mathematik>
Parametersystem
Client
Resultante
Parametersystem
Familie <Mathematik>
Elektronische Publikation
E-Mail
Computeranimation
Objekt <Kategorie>
Client
Statistischer Test
Statistischer Test
Autorisierung
Client
Schnittstelle
Subtraktion
Unrundheit
E-Mail
Kontextbezogenes System
Synchronisierung
Computeranimation
Design by Contract
Client
Web Services
Statistischer Test
Autorisierung
Endogene Variable
Client
Brennen <Datenverarbeitung>
Standardabweichung
Energiedichte
Statistischer Test
Physikalisches System
Quellcode
Kontextbezogenes System
Physikalische Theorie
Computeranimation
Design by Contract
Physikalisches System
Statistischer Test
Statistischer Test
Mereologie
Kartesische Koordinaten
Programmierumgebung
Signifikanztest
Quick-Sort
Computeranimation
Dämon <Informatik>

Metadaten

Formale Metadaten

Titel TDD of Python microservices
Serientitel EuroPython 2016
Teil 151
Anzahl der Teile 169
Autor Bultrowicz, Michał
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/21185
Herausgeber EuroPython
Erscheinungsjahr 2016
Sprache Englisch

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract Michał Bultrowicz - TDD of Python microservices A framework-agnostic approach to creating Python microservices with a tests-first approach. I'll show how to utilize Docker and Swagger to create service and contract tests that run your service as an independent process, as if it was running in production, giving you and your team a higher degree of confidence when introducing changes. A little bit of a broader microservice, TDD and work management context will also be given. ----- These will be my ideas on how to help a microservice-based (HTTP) project by integrating testing into the development process (TDD). I'll approach the testing pyramid presented in Martin Fowler's "Microservice Testing" as well as the test variants in "Building Microservices" (O'Reilly) and I'll show a way of how they can be translated to real-life Python. The main focus will be on "service tests" (aka. out-of-process component tests) and contract tests. They both can be run relatively fast on a development machine and can give fast feedback to the developer, preventing many kinds of problems. Service tests run the whole application process without any internal modifications, but have to present the service with a fake "outside world". I'll show how to fake external HTTP services with Mountebank (similar to WireMock). Instead of faking other systems (like databases) we can quickly spin up the real deal as a Docker container from within the tests. Contract tests check if the contract (interface) of your service with the outside world is kept, so no external services should be broken by the changes you are introducing. It can also work the other way around, proving that your collaborators are keeping their part of the deal. In both cases, Swagger (a RESTful API description scheme) and a few clever tricks can be used for significant advantage.

Ähnliche Filme

Loading...