Bestand wählen
Merken

The Next Generation of Testing

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Beta
Erkannte Entitäten
Sprachtranskript
and and the this and this
this meant that that the fact is
that you and the new hello everyone
so you might be wondering why I'm here and the wild we stop the adults so the scale you see also add a little bit of so the next stop would have been of it actually the star would have been about writing custom test always with the new at the eyes but I'm gonna introduce closing you in the eyes so it makes a lot more sense so this star has a set is about the next generation of testing amber although all right now we already have that generations so it should actually the current generation of testing but also then introduce it it so this will work word us right
so this is me I should not upon must that I'm so if you have any questions about that ask me laughter before but also if you have questions about the actual content of the talk you could ask about you and you can see the end of the the bottom if you wanna contact me I was I work in
Germany for simple apps are consultancy in Munich we do consulting all over Europe basically are just like just go just presented to you I do have some jazz Unix the goes with me so if you want some find AppleTalk but you may also know
me from my work on and was still alive so you can see I have a problem open source problem and I maintain quite a lot of packages these this point and so the 1st thing I wanna talk to you about is the and then our work and it was already mentioned the key this morning and then it is pretty much no longer a thing if you don't know what and then this is this
thing so when you write acceptance tests you use the visit helper to visit Arouch you can use the land and click to interact with that are out you can basically simulate UI actions from a user and at the end you use the and then helper to run assertions on that state so the and how it and then all DOS is basically wait for any asynchronous actions to finish so imagine when you do the click the submit button click that's that will fire or an age expressed now the and then I'll go over it would wait for that razor for that ejects request to finish on silica goes on and then runs the assertions for you but the and then a not exactly standard jobless groups and it was amended actually 5 years ago if you look at the code as it was in 2013 when testing was 1st introduced into amber you can see a promise trains and if you look at them they're not exactly readable it's it's quite more easy and boilerplate and it's it takes to focus away from the actual code that you test but so the and the novel was basically invented to work around the problem that promise chains are essentially variables as a little slides that was 2013 we have 2018 out so 5 years later and the that I'm I think last year or 2 years ago introduced facing functions that makes a lot easier to write asynchronous codes and if you compare the promise chains to facing awaits a looks like this so a lot more obvious what's going on be facing parts of the tests are clearly marked with the weekly what a keyword sorry so basically all you have to do it in front of the function you write the ACE few and in all of in front of all the asynchronous helpers you right weights to wait until that promise has finished and then the control flow will just continue so in summary and then almost 5 years old it makes a synchronous and asynchronous code in a way that is kind to fall and understand and it has a somewhat unintuitive API while facing a awaits is standardized ECMAScript now it is very explicit about what calls are actually asynchronous and its price that's based on promises so another standardized feature of jobs on to the next of topic
J. query you've already out the keynotes
and what doesn't use it anymore so why do we have it while there is 1 caveat through the announcement in the keynote because of all the test service based sole use it's internally so it's kind of art and if we
look at examples of its use in acceptance tests that at the top and integration component integration test of the ball the and just look out where j query could be using those snippets its in some cases this somewhat obvious our cases if not you can see at the bottom there is in this spot dollar which is usually good indicator of the J. queries used there's another 1 but did you know that the click and find was I also using trickery underneath so that's basically the reason why J. query is still somewhat that's but I'll show you how you can work around so if we focus on the top of students you can see the click and the find helper and basically all we need to do would be to write an API that all to write a function that has the same API as the current but uses native on elements in native dominate so thanks cumbersome amounts of thank you I we have emanated Donald was which does exactly that so instead of using the global click and find functions that we include for you you can just importantly and find as examples from emanated Donald what's and use those instead and they will just use native eyes so you no longer rely object variable there was 1 minor caveats though though find help or and the global find help actually returns page inquiry object since we don't use J. query with the native Donald was we can actually do that which means we actually return a native dome elements so there is a slight problem there but it's actually easy to work around because the native or maybe eyes at this point out quite alright and so at the end of last year we started extracting bowls Elbrus into an official at on and that is which has Tilberis as a consi here but there is so it basically those are more or less the same outburst there is 1 minor difference all there and what test cell grows only work with the new testing in the eyes of the native Elbrus work with both which makes it great as a sort of intermediate step toward migrating to linear us where Nextel thickness of
modules I'm actually a big fan of Morgan I've been they opponent of Cunard for quite some time I had quite strong feelings about that but at this point I must say cute is OK I can work with that with the new ideas and it's a let's get into this modules if you have never use God this is
basically what they look like so what it means is you can basically nest test suites in 1 another and the reason for doing this is that each of those tests we can have our set up and talents that is notable for every test in those test suites is a very simplified example but you can see all that will scale basically if you have a lot of tests most and so 1 thing that annoyed me always about you know it was you could not do that a list of luckily last year or so a new Cunard version can also and actually allows us to do those things so if you compare the current longer colors with the cuticle it looks like this it's basically the same there are a few naming changes and build subject is more explicit than mammogram but it's pretty much the same other than that there is another caveat of and this does not work with our current in the ice so we have we usually use module four-module module for component module 4 model module acceptance the tests but bowls don't allow us to as that which we took a stab at solving that and Roth came up with a lot of C a lot I think 2 years ago
called the grants testing unification but it's been around sometimes and it
was 190 and if you look at our see it is a long is actually very long so it had quite a lot of content and nobody actually dared to implement it because the scope was just so big and so 2 years later nobody had still worked on this basically so we started extracting out several smaller parts out of that and the first one is our seed 2
3 2 Edsger new acute testing it got and the TD of this is that we replace the module 4 functions with the native module function that you exports plus a somewhat custom set of test function that basically integrates the module with the test set up there is a sibling at which is 2 6 8 and that basically does the same for acceptance tests so instead of writing what you for acceptance you know use the native module API of units and you set of application test in sort of that I will go into all of this so we basically now I have 4 different ways of writing tests and I will dive into that out so the 1st kind of test you can write as a playing cutest that's basically for cold that is entirely unrelated to so say a utility function that doesn't actually know about services roads components whatever and example code is like this
you have a module on a test function that you import computers notice there's no at all on the slides is just a regular plane Q tests in this case we're testing the relative state function were pressing something in something on the outputs that is just you could basically find this example acute because it's nothing special there's no most of the stuff the next thing you can do and more regular thing you can do is write contain
tests I've put that in quotes because we're all told me some of their their way the thing is though that we both could come up with a better name so far so a store continue using it you can use tests for controllers around services and stuff like that basically everything that we previously use use integration or unit tests I wanna go through quick example by
the way don't be scared about all of the cold I will publish a slides in these sectional after what's so you can just go through it at your own pace later and so the 1st thing we do in this example is we import stuff so you've already seen before we involve the module in the test functions all these are just the regular curated the eyes and the 2nd thing we want is the set of test function dimensions next we set up a test with and we run a set of tests as the 1st thing inside the test we noticed this is not running as part of the book but this is set is set up a set setting up the books so that is why we pass in the Wilkes object into a set up test function this will be a very common patterns so did you say that from now on is basically the same and will cover way where we have produced some like us at this point this set of tests function makes the testing container available inside of test what that means is inside of the test you have access to this don't hold up this sort of has a method called so look up and you can use that to look up basically everything that's on the application so stuff like services control most routs technical even components although components should be tested in another way and finally once you have an instance of say the flesh messages so in this case you can use that to research stuff like properties mother calls and whatever you want to basically so to recap import from Cunard's import from and what you and the specific stuff open a test suite run up test and after that just by tests and you look at use this on look up to about whatever you want test you can also look at other things so in this case were in writing a test for the past residents service but no one's keeping you from looking up other things so if you measure you you using in so for example anyone change the language that and when solids using you can basically look up the until service from a container you said lokale and then that will just work right so next
subtests rendering tests that basically rules previously the component regression tests and you would use that poor testing components and help us and it's like this roughly
similar except in this time in this case we're not importing set of tests for set of rendering test from and what units and we're importing render and click from the tests helpless and now you might be wondering why are we not just importing the file look units and you're right but the thing is that I also want to open so the only specific test framework specific stuff that we do is actually the set up test functions Everything else words where they use God Cunard's maybe some other test for in the future we will see so here what these things the edge appears in borders just the same like we've used before and then he opened a test suite and in this world in this example logical incident-response of rendering test that but everything else is they say is exactly the same essentially and set of rendering test is actually using set of tests on the knee so that means you can still use said this on our blog up for example in the test and everything will just work the same as sort of test if we look at the test on it uses an ace function so no and that any more I don't think and that is in support of this kind these kind of tests anymore but you can use promise change if you wanna hurt yourself but I really would it's recommend to you just use facing functions and it is the default and was like really so as you can see we are calling the render function were passing in a template basically rendering an X counter culture component for for example it's and that we are awaiting the render function results the reason why we're doing this in the keynote today you heard about a and rendering and that is basically incrementally rendering over multiple time slice is more or less and if we would just continue synchronously the template might not actually have finished Reynerie so that is why in this case and the new Reddy eyes we explicitly asynchronously awaiting the result of or an which after that we can just run assertions like we would normally you we can use the click help when this example to click on the counter run assertions again I just more explicitly the 4th kind of test we can write is an
act and Sorkin application test is basically the same as the acceptance as before and you can just use those to verify user stories but the testing called moves
almost the same is in this case said of application test well sort of rendering test we import mostly the same test solvers which is another big advantage of those testing at the eyes because before in integration testing acceptances use entirely different cultures now it's almost the same the only big difference here is that we are not importing there and but we are importing the visit helper and if you look at Peterson College all I mean we use set of education test that's obvious but no if you get the actual test goes it almost looks the same we are visiting are out of your application after them were filling in some stuff OK can submit button were waiting for that to return and then we just one hour sessions as long so actually pretty straightforward so at least we start so you at this point you might be wondering how
can I get this this looks nice 1 and that's how great what do I have to installed units and the good news is you might have already have it because it doesn't actually depend only on the version at all the only thing that matters is your embassy like you need to be on version 4 comma decimal 2 or above and if you have that you can just use the new at the eyes or whether you on 2 0 I think we test all the way down to 2 4 a something so if you're above that you should be fine also you might be wondering well I already have
5 thousand test what about those hole can migrate those because it seems like a lot of work and your rights so I got a high-level migration plan for you the 1st
thing is migrates to using a single weight and stuff and then basing awaits words within the old a the eyes to so that's a good 1st step basically the next thing is use emanate abdominal because as I mentioned before it does work with the old at the eyes and the you the so that's a really good intermediate step but that's still a lot of work is we have a wants or problems it's called a native helpless Kulpmont if you run that it all automatically transition due to the new at the eyes want to do a single weight and the native don't help us disclaimer told what's on never perfect what we really do our best and I've had great success was called modern it's basically code words like 95 % correctly and the 5 per cent is usually something you can do when the next steps is using a set of test functions of the New Testing the eyes and while that's still over we also have a problem for that it's called acute called what there is a similar thing for Moga although it's not entirely finish it sold give me a week of something from the war will hopefully a refrigerator you of that also has a quite high success rates all the projects of migrated so far so pretty you and then of course there is basically just clean up in most cases you could use renamed the emanated native on helpless imports to just use and what has syllables you might have to just some things here and there but also for their physical about so technically you don't have to do anything you just have to run mostly most and hopefully you just done all of that so as good I I other section was of
tricks we have more 11 minutes left the various so I'm just going before that of walking
but there seems to be quite a few misconceptions about how to more properly in amber and member is using this thing called a dependency injection of mobile war less and that is actually remains to be much more or less so you can just registered different things on those of the dependency injection containers and that will automatically mocks stuff for you so I have an example of this
so in this case were registering a mocked cookies service Award of saying if some someone reads copious whatever kid is we just returned ABC of delimited by simple next we just don't look up a save feature service that uses the service and we don't have to override the cookies property in the future service because it just injects the mocked service for you but the only caveat here is you need to register that thing before you look up anything and uses because if you if you look up before the injection will already have happens and if you register the MOT service after that it will not matter because it will be used so keep that in mind if you want something what before or you look up stuff that's important after that you can just use the feature service as you would then do assertions on and do what you will all in all not much code and it works quite well actually
another thing is that loading states and how you can test them I mentioned earlier that say if you use a way to click it will wait for any age x requests for example to finish onto the continuous but what if you actually want test the loading state of replication ceremonies and this is 1 example
so we visited the Commons new neurons we put in a bunch of stuff into a comments field we click the submit button but in this case we're not actually awaiting it but was saving the promise that comes out of the clique function for later next we're using the wage while from the test syllables and waiting until the loading there appears on the so what this goes underneath this it automatically every some Ms with long and checks is that you select available yet or not and if it isn't after a time a lot of things by default it's 2 seconds it will fail the test if it's available it will just continue I forgot something in this slide which is doing assertions actually after that but you can imagine that after Wake Forest returns you can run assertions on of almost all these things once that's finished you can away no original promise from the Kay and then run assertions on the finished state what wait for does underneath is essentially this but we also have a helper called away called wait until and that basically is the thing that's holding and so it will just run the predicate function that you pass through its and ones that function which returns true it will result if that function doesn't return TRUE after 2 seconds it will reject the promise another thing is custom tests
elbows and that is actually the thing agenda will talk about the next talk but if you've used register a sinkerball register helper before that's no longer think so
regicides in W sort of like this but you basically you know actually exporting anything you're actually calling the register easing of a function passing in the name of the function that you defining next at all it's so that we also is using a new the the old helpers which is great what we do now is this we just explored in a sinc function from basically anyway once I would recommend the test helpless polar but you can basically do it where you want and the way inside of that were just using the new elbows and we use an increasing function to be able to wait stuff inside so is actually pretty straightforward as a surgeon we will mention that in a lot more detail later another thing you can
do to write better tests in general is used test selectors Test is the thing you use basically if you look up stuff on the bomb this is
1 example you can see here we have we have an input field and we use these see this class and the tag name to look up those elements from the DOM quality tests but imagine someone would like to make the H 1 and H 2 doesn't really work because in to change all the tests the same policy this because if you change the C this class things will break and that's great so although the Test selectors what you can do instead is you can use data capture this by convention what we usually do is use data dashed test there's something to indicate that this is the element that we wanna run assertions on all that we want to click and then at the bottom you can see we have the square brackets inside of that we put the data attributes and we just use those as selectors it has 1 downside the dorm that you will use looks kind of noisy because it will send all of that to your clients fortunately amber allows us to do our ears to transforms which means we can actually stripped all selectors out if you run production bills and as we use and work that's obviously out on and you can just it's slow and the Test selectors and it will automatically remove all lost data test such abuse from the production wells last pretty good the next
thing I have is readable assertions that's 1 thing that really annoyed me about unit because assertions are a lot more verbose than say of you so
let's say we wanna run this assertion it's not exactly abuse will what as I mean if you to take a 2nd you see were asserting a text content which remain that were running the test herds is this Hello World but but it's not that readable so last year I thought how can we make this better after working a client project and we used units so I can switch over to more well and so I had to use to it and I came up with this so this was the idea I wanted to use because it's very expressive you just pass the selected for the Blum function and then you run for example a half texts assertion on it and it's the year after that is much more readable and so all around the time of of test this year I sit down and spend about a week implementing this and you can now install it as
a result you on ABC this not just has text but you can also assert that something exists and long but it has a set C this class that something is focused has a value and that's ever more several of attribute of assertions that in use and abuses was 2 weeks ago we our see that this is actually become could become the default alliance from now on you don't have to users but I would strongly recommended because this is really great it makes you test a lot more readable to finish off have a look at the rest
of them at the and testing the system there are lots of great at once I've been using quite a few of them and they make a test a lot easier thanks to
everyone that worked on this and things for you to do this for me the and and the in
the you have to this that
that to happened that the and
the new that the few
and you think back to the the Latin but that
Videokonferenz
Signifikanztest
Zentrische Streckung
Generator <Informatik>
Menge
Binder <Informatik>
Wort <Informatik>
Strömungsrichtung
EDV-Beratung
App <Programm>
Minimum
EDV-Beratung
Inhalt <Mathematik>
Gewicht <Mathematik>
Wellenpaket
Gruppenoperation
Gruppenkeim
E-Mail
Code
Zustandsdichte
Intel
CLI
Variable
Prozess <Informatik>
Statistischer Test
Code
Diskrete Simulation
Kontrollstruktur
Signifikanztest
Lineares Funktional
Elektronische Publikation
Synchronisierung
Konvexe Hülle
Open Source
Default
Systemaufruf
Rechenschieber
Teilmenge
Verkettung <Informatik>
Funktion <Mathematik>
Mereologie
Versionsverwaltung
Textbaustein
Schlüsselverwaltung
Standardabweichung
Aggregatzustand
Signifikanztest
Lineares Funktional
Subtraktion
Punkt
Finite-Elemente-Methode
t-Test
Abfrage
Zellularer Automat
Element <Mathematik>
Quick-Sort
Homepage
Integral
Teilmenge
Objekt <Kategorie>
Dienst <Informatik>
Statistischer Test
Minimum
Zusammenhängender Graph
Indexberechnung
Hilfesystem
Viewer
Signifikanztest
Suite <Programmpaket>
Punkt
Gebäude <Mathematik>
Mathematisierung
Versionsverwaltung
Mailing-Liste
Modul
Teilmenge
Informationsmodellierung
Modul <Datentyp>
Funktion <Mathematik>
Einheit <Mathematik>
Fächer <Mathematik>
Statistischer Test
Grundsätze ordnungsmäßiger Datenverarbeitung
Zusammenhängender Graph
Kantenfärbung
Modul
Objekt <Kategorie>
Physikalisches System
Statistischer Test
Synchronisierung
Dezimalsystem
Browser
Booten
Inhalt <Mathematik>
Versionsverwaltung
Signifikanztest
Ebene
Regulärer Graph
Kartesische Koordinaten
Code
Signifikanztest
Algorithmische Zahlentheorie
Statistischer Test
Einheit <Mathematik>
Zustandsgröße
Regulärer Graph
Statistischer Test
Code
Zusammenhängender Graph
Modul
Funktion <Mathematik>
Signifikanztest
Lineares Funktional
Distributionenraum
Relativitätstheorie
Softwarewerkzeug
Migration <Informatik>
Modul
Quick-Sort
Teilmenge
Rechenschieber
Dienst <Informatik>
Menge
Mehrrechnersystem
Stereometrie
Punkt
Komponententest
Hausdorff-Dimension
Formale Sprache
Kartesische Koordinaten
Dienst <Informatik>
Signifikanztest
Eins
Message-Passing
Statistischer Test
Statistischer Test
Gamecontroller
Mustersprache
Zusammenhängender Graph
Speicher <Informatik>
Modul
Signifikanztest
Suite <Programmpaket>
Gerichtete Menge
Distributionenraum
Kategorie <Mathematik>
Modul
Menge
Quick-Sort
Integral
Rechenschieber
Objekt <Kategorie>
Dienst <Informatik>
Puffer <Netzplantechnik>
Menge
Mereologie
Gamecontroller
Message-Passing
Instantiierung
Web log
Element <Mathematik>
Program Slicing
Mathematisierung
Content <Internet>
Mathematische Logik
Ähnlichkeitsgeometrie
Framework <Informatik>
Komponente <Software>
Statistischer Test
Multiplikation
Einheit <Mathematik>
Vier
Statistischer Test
Lineare Regression
Volumenvisualisierung
Zusammenhängender Graph
Default
Hilfesystem
Modul
Umwandlungsenthalpie
Signifikanztest
Suite <Programmpaket>
Lineares Funktional
Distributionenraum
Synchronisierung
Template
Volumenvisualisierung
Schlussregel
Elektronische Publikation
Rendering
Quick-Sort
Funktion <Mathematik>
Menge
Rechter Winkel
Grundsätze ordnungsmäßiger Datenverarbeitung
Wort <Informatik>
Signifikanztest
Subtraktion
Punkt
Synchronisierung
Element <Mathematik>
Programmverifikation
Programmverifikation
Kartesische Koordinaten
Quick-Sort
Ähnlichkeitsgeometrie
Integral
Teilmenge
Statistischer Test
Menge
Signifikanztest
Statistischer Test
Einheit <Mathematik>
Rechter Winkel
Migration <Informatik>
Automatische Handlungsplanung
Versionsverwaltung
Migration <Informatik>
Signifikanztest
Distributionenraum
Gewicht <Mathematik>
Synchronisierung
Gruppenoperation
Güte der Anpassung
Einfache Genauigkeit
Ähnlichkeitsgeometrie
Migration <Informatik>
Bitrate
Funktion <Mathematik>
Menge
Code
Migration <Informatik>
Garbentheorie
Wort <Informatik>
Projektive Ebene
Kälteerzeugung
Hilfesystem
Objekt <Kategorie>
Dienst <Informatik>
Kategorie <Mathematik>
Mobiles Internet
Injektivität
Cookie <Internet>
Dienst <Informatik>
Code
Rechenschieber
Signifikanztest
Prädikat <Logik>
Lineares Funktional
Wald <Graphentheorie>
Datenfeld
Statistischer Test
Zwei
Datenreplikation
Aggregatzustand
Default
Eins
Aggregatzustand
Lineares Funktional
Synchronisierung
Funktion <Mathematik>
Polarisation
Default
sinc-Funktion
Lineares Funktional
Signifikanztest
Quick-Sort
Signifikanztest
Installation <Informatik>
Element <Mathematik>
Klasse <Mathematik>
Element <Gruppentheorie>
Element <Mathematik>
Biprodukt
Ein-Ausgabe
Signifikanztest
Client
Datenfeld
Statistischer Test
Ein-Ausgabe
Minimum
Cross-site scripting
Attributierte Grammatik
Signifikanztest
Lineares Funktional
Client
Einheit <Mathematik>
Element <Mathematik>
Code
Projektive Ebene
Inhalt <Mathematik>
Signifikanztest
Resultante
Existenzsatz
Menge
Installation <Informatik>
Klasse <Mathematik>
Physikalisches System
Default
Signifikanztest
Attributierte Grammatik
Binder <Informatik>
Quadratzahl
Sommerzeit
Datentyp
COM
p-Block

Metadaten

Formale Metadaten

Titel The Next Generation of Testing
Serientitel EmberConf 2018
Autor Bieniek, Tobias
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/35702
Herausgeber Confreaks, LLC
Erscheinungsjahr 2018
Sprache Englisch
Produzent Confreaks, LLC
Produktionsjahr 2018

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract The "Grand Testing Unification" is finally here! In this talk you learn how to use the new QUnit testing APIs and we discuss why they were changed and what steps you need to take to migrate your existing tests to the new APIs. Finally we will look at the Ember ecosystem and introduce addons that can make your tests better than ever before.

Ähnliche Filme

Loading...
Feedback