Bestand wählen
Merken

Easy-Bake Testing

Zitierlink des Filmsegments
Embed Code

Automatisierte Medienanalyse

Beta
Erkannte Entitäten
Sprachtranskript
and
great of so many lives and I'm here to talk to you about testing I hope you're ready so last year I have many of you were here last year but
I I give a lightning talk with 24 hours of notice after much peer pressure from layer on the topic of testing a number of at the time I had 3 months of experience as a professional developer and I had freshly graduated from the fire in school I didn't really know that much about testing at all and I found that there were not many great resources also hence I felt much like our friend chemistry dog here I had no idea what I was doing so I give this talk like you know you tell theories society I wish I had so this time I'm back now and I'm here to share with you of all the things that I wish that I had known last year so basically when going back in time so travel with me I'm going to talk to my past self i because now I
have some idea of what I'm doing at this so 1st of all all what do I wish I
knew a year ago of 1st of all I have access to and the right of the box without even thinking about it when my getting how I use embers built test help us that Amber gives us right the box of with the difference between the unit acceptance and integration tests at the time I think that number gets kind of conflated acceptance and integration that was very confusing for me I think it's since then ready but also with the deal with all these other frameworks or libraries I kept hearing people there are going to like you know testing rumor whatever will be like Jasmine tag unifying methods of itself and that would do any that's also some born I have no idea what the what Marx stubs and spies do I need them how can market now responses obviously only be hitting your API alive all the time and you're testing environment that's terrible I so how can I markers API responses for my tests had I do they sink behavior and finally worst and best practices when it comes to testing the so what I get without
even trying I can roll out of bed and there's still get ready for me so gene is a JavaScript testing framework is not specific to Emma it's just testing framework you can use with any JavaScript project and but ever gives it to you where the box and it's a default testing framework and it includes so soma when you have it on a rap includes everything making it has so the go the key documentation you'll see all the assertions they give you and all the cool helpers and all that stuff and and you have all that I am a test of these are both and methods to automate common tasks in acceptance tests like visiting a page clicking a button the all that fun stuff the test on very simply test render render tests the so the and
the acceptance of solvers of there's 3 groups of the 1st is facing these are a helpers there are aware of any weak for your eating behavior they are run in order and they are click FIL in key events trigger events and visit other fairly self-explanatory but if you want like somebody tell you can look in Member guts the those of us think test suffers the same test solvers are performed immediately when triggered of so of those are current path Kurt rout current URL that's fine and finally the way helpers which is really just 1 helper up and then the so and then I wait for all the preceding asynch helpers to finish before executing the code wrapped within so here is
an example of this is a test that is where this saying that if I visitors certain your on a click on a certain selected then I'm not going be redirected again I'm going see this a warning message so you see on-line to how many assertions are expected you see on line for and insane helper action that is that of Mory's sink on 6 clicked so that those happen in order and then wait for those guys to finish up and we have our own gene assertions were asserting that the current euro is not equal to settings sludge buildings and that of the we know warning message selector tax is an account already exists for shared @ example . com so that's of some examples of those helpers in action
so was the difference between the different kinds of tests are we have unit tests integration tests and accepted sets unit integration acceptance like the stages of grief of this nailed comes with it and so unit test 1st of all self-contained test of your only testing in the code itself with unit tests all you're not system-user interaction your testing only a particular function order the unit code this is not cooking visiting whatever of so to give you an
example we have this super basic computer property full name just takes 1st name last name concat is them with an nice space in the middle of super basic so we're just going will unit test for that other full images 1st name last name so were just making a user saying the 1st and last name properties about Smith and then were asserting that when we call user get full name that we get Smith as expected so as an example of unit test of
integration or component tests on component tests are integration test but integration test might not be component tests on when you generate a component the using embassy all of it comes with a little component has of the box which is an integration test basically you're testing how 1 layer the application interacts with another I mean it is a component is usually how components interact with each other or with other templates so
so we have this little component of and this is a list of dudes Joe but Jojo body Joseph Robert for some reason these guys really important you we what their names all over actually made this little component I call this display and then
we just testing that when it renders that they are there so on it's pretty simple you know this is not render in was display and then you see the assertion that when the term all the text that we get what we expect the of
acceptance tests so acceptance as an integration testing be tricky to sample part of but acceptance as the wherever it is that I accept that that my app has actually users who will actually interact with so I had better well well-tested ahead out they're going to click that 1 that you want click and you have theory for that I so again we have Joe Bob
Bob Joe Bobby etc. and this is just a plain template and so we have to accept a sense that the 1st is that when we visit the homepage it results in a career although homepage so we see again a sink of helper visit and then waiting an assert equal current URL that's 1 of arresting covers is equal to such such simple enough on and that the correct number of user display so again we visit the homepage and we check that the number of users that we expect from the yeah of
Marxists bias in stubs not spies and so that's all they help you write unit tests in isolation but they probably will come up very often a number of other good to be aware of I was only made aware of that because I was working like a plane JavaScript project and last and then they had all these things so that's how I became aware of them alone but they're really more unit tests and uh you should mostly be ready acceptance tests and you test is readily serve so it's that much so GS is a great library that provides marks stubs spies and were alone there are also 2 highly rated Emerson Adams called inverse remember to unit that you can look into you wanna use these things and then there's also a link to a blog post that I found about using sign on in Member projects the so marks are also known as
festivals these are fake methods with pre-programmed behavior and pre-programmed expectations OK the spies a spike is a function that records arguments and returns the value as well as the value of this and any exceptions that might be thrown for calls are it's interesting how many times a particular function was called or how functions handling a specific call back
and steps of stubs are spies so you get everything that you get was 5 steps of a kind of help you force your code on a specific path so like if you wanna throw area you have a specific sort of like have you wanna go down there good for that it is a assigned as others or to explore stubs you know I guess it had the folders for the falls by the API so you're argumentation you can find tons of information on the my thing
API responses so this is pretty boring because you won't be hitting you're alive API obviously what you your test severely in isolation of a great solution that I love for every forgot people of is mirage of mirages often super popular solution and not just for testing and they can be used in development as well as test environments at they offer factories that you can use for tests so you can see your test database ahead of time you can mark 1 of responses in individual tests the assignment also offers pair sponsors but mirages suffer so much more that it's definitely worth looking into the acidic use development so like if you don't have if you have any event it's ready yet and you just 1 like a mock API work within development you use it for that as well it's also so here's an example of
where you might use mirage so were just testing that someone who's entering the changing the password may enter an incorrect passive and we want to make sure that this error is going to get thrown but we need to get that response from the BIO password is not correct to conceal from lines 40 I you how Mirage works there just like server that patching say what you want and then you throw whatever you know the responses the a framework
from so if anything like mean last year a year ago I you might be saying everyone talk about all these different testing frameworks and libraries and stuff in your thinking like do I need this I like How do I know which 1 should be using so I looked into a couple of the ones that I heard a lot about some a kind compiled a bunch of the different it whatever I could tell was slightly different about them so Jasmine is the first one I answered behavior-driven testing framework of doesn't require dumb doesn't depend on any other frameworks of it's similar syntax that which I think is the biggest selling point if you're a developer coming from Rails background I've heard that judgment is a little easier to pick up but I also the vowels background so I really find the it difficult all to pick up so to each their own of Chinese insertion library not a framework of the people seem to really like having a ton of different assertions it's all about you know it's a personal choice I find it to you to be more than enough but if you really wanna have that and try to be a good solution for you I've heard that it's difficult to and implement a number with 2 unit of and there's a few hours out there but I couldn't find 1 that seemed to be like a distinct solution all however there's smoker which is another testing framework so you you'd probably use this in place of 2 unit so you can use any assertion libraries if you really like try you can always just use smoke is a unit of I read that you can use that Unisys virus syntax so I don't know if that's true but it seems weird apparently the reason for this is that the lexical binding of the this value makes them unable access the local context so those statements like this start time out 1 thousand on it won't work inside an neural functions I don't know what the sensorium and another 1 i've never use but I've heard a lot about its of mostly for and testing of new clicking all that it drives your brother and your application environment rather than test environment I've heard it's difficult to look up to her and it's much slower than using to so what's the
verdict as far as I'm concerned about unit is great but I have yet to come upon a situation in which I felt like to new two-year was lacking so I think every comes out of box is often except for you should add more of such
so again TDD so if you're a beginner or like I was a year ago you might hear this term from around what's TDT on TDT is test-driven development it means that you basically 1st run a failing test for something that doesn't exist yet and then you build the thing to make the test pass out you write another test for another thing that doesn't exist yet and you rinse repeat the but this is a great way to ensure as complete test coverage as possible but but a lot of beginners find it very difficult but with if you're trying to do this without any guidance because also known as the years you'll find that you're just hacking something together and you don't really know what is going to be when you're done and and so it's impossible to know what it's going to be ahead of time to test for it so it's OK if you try to do TDD in your beginner and you have a hard time you know there's nothing wrong with the whole her home page objects of that and so you i changes to make a test liberal if they're frequently dependent on specifically named selectors are you might find that you make a lot of changes to which a class is enormous and yellow is tested on because you're depending on all these classes all your acceptance tests so that's annoying but page objects are a solution for that I basically just you encapsulate the structure of the page with the object it so this helps Jaeger it helps to protest try as well as keeping the intention of your tests clear there a well-supported memorandum that was awesome article embassy I page object and there's also this is a famous blog post by Martin Fowler on the topic of page objects if you wanna read more about them in general so here's an example where we might
use page objects we have that same test again our using rise and where we values that there's a ton of selectors Syria get the change phosphorus like your new password input whatever and so let's make up page that for the account settings page and let's just encapsulate all that stuff and so were visiting was just make of visit function was just make a quick change passwords it's very obvious what's going on and then when we go back to the test so you can see it's very obvious the flow of like if you just hired a new developer and they come in look this test they know exactly what's going on all you visit the page you change for you enter incorrect correct current password into the new password update the password and then you know you wanna see the password error texts is equal to that text so it makes a lot easier the and some
best testing practices that I have come upon out keep your test so dry by writing test solvers so if you find yourself repeating your code over over in your test and the allows you to write custom test and there is a lot of information about that are in the amber guys so if you find yourself doing that right starring offers it'll make everything happy of of a projective test for you I changes in keep their intention clear with page objects as I just talked about and keep each test discrete and its functions so you wanna be testing 5 different interactions in 1 test you wanna make sure that you're keeping everything very discrete and isolated as isolated as you can but most has to be accepted and some integration least of all unit this is my opinion I g going where gave a talk a while ago where she had like a pyramid I think I think it was the and it was a little bit of unit at the top in the middle is integration in the bottom was acceptance and since the Invar is a friend framework it makes sense that you wanna mostly test user interaction and clicking around and stuff like that but if you have like a really complex of computer property then obviously my when unit test for that of testing cells like TTD other amount matter of personal preference of not any better or worse than anything else other worth looking into I I think tedious super interesting eyes have it will use a very much missile of the
resources of the emperor guide link to the test offers the AdOX as they give a talk at the global global Amber made up like a few months ago local intruder testing and that's just like a step by step like nitty-gritty how do you actually run your tests was the difference between a test environments so if you're interested in 9 around that can give you more information about that and into more links to all the different things in a P a great blog post I found about the differences between Marx doesn't spies I'll finally I would love to think of my former in the co-workers a simple reassure on the front row on the so they were my effect that you need in a strip Bureau of my coworkers a year ago I came here with most of them a year ago and they were very was very supportive of me as I was trying to learn testing on the job and basically the relay of really testing is that 1 you interesting array all the tested this at so I wanna learn all this stuff without super-rich I'm and also I I just moved here 2 months ago from New York working as operation I work at which is amazing awesome and I would also like to thank my current co-workers and team members and told us that that's
it thank you very much thank you I know I have a question about the coverage tools him love of in trying to integrate pointed for example there was always wise to of a household so hedonism Justin's would be appreciated from I actually didn't we add well less that we I think we did implement embassy I'd like it but I didn't do it this that that that that that I tried I tried it I I just couldn't it was so hard but under a more on this this thing can be a lot with with that this yeah anyone else I for the think of all this thank my
Videokonferenz
Statistischer Test
Statistischer Test
Code
Sichtbarkeitsverfahren
Druckverlauf
Statistischer Test
Peer-to-Peer-Netz
Softwareentwickler
Physikalische Theorie
Subtraktion
Kontrollstruktur
Quader
Desintegration <Mathematik>
Zahlenbereich
Framework <Informatik>
Homepage
Task
Statistischer Test
Einheit <Mathematik>
Statistischer Test
Endogene Variable
Programmbibliothek
Volumenvisualisierung
Skript <Programm>
Default
Signifikanztest
Synchronisierung
Default
Applet
Prozessautomation
Integral
Endogene Variable
Teilmenge
Framework <Informatik>
Rechter Winkel
Einheit <Mathematik>
Projektive Ebene
Programmierumgebung
Schlüsselverwaltung
Signifikanztest
Konfiguration <Informatik>
Große Vereinheitlichung
Synchronisierung
Gruppenoperation
Gebäude <Mathematik>
Gruppenkeim
Strömungsrichtung
Routing
Gleichheitszeichen
Gerichteter Graph
Code
Ereignishorizont
Teilmenge
Message-Passing
Menge
COM
URL
Ordnung <Mathematik>
Schlüsselverwaltung
Gerade
Message-Passing
Signifikanztest
Lineares Funktional
Subtraktion
Komponententest
Kategorie <Mathematik>
Interaktives Fernsehen
Raum-Zeit
Code
Integral
Algorithmische Zahlentheorie
Teilmenge
Statistischer Test
Einheit <Mathematik>
Funktion <Mathematik>
Menge
Einheit <Mathematik>
Statistischer Test
Code
Vererbungshierarchie
Ordnung <Mathematik>
Bildgebendes Verfahren
Signifikanztest
Komponententest
Quader
Desintegration <Mathematik>
Template
Datensichtgerät
Kartesische Koordinaten
Mailing-Liste
Template
Datensichtgerät
Integral
Komponente <Software>
Statistischer Test
Statistischer Test
Zusammenhängender Graph
Normalvektor
Teilmenge
App <Programm>
Statistischer Test
Datensichtgerät
Mereologie
Stichprobenumfang
Term
Integral
Signifikanztest
Ebene
Komponententest
Web log
Datensichtgerät
Schreiben <Datenverarbeitung>
Zahlenbereich
Binder <Informatik>
Gerichteter Graph
Homepage
Überlagerung <Mathematik>
Teilmenge
Statistischer Test
Einheit <Mathematik>
Einheit <Mathematik>
Vorzeichen <Mathematik>
Statistischer Test
Programmbibliothek
Hilfesystem
Projektive Ebene
Programmbibliothek
Lineares Funktional
Parametersystem
Ausnahmebehandlung
Systemaufruf
Kraft
Ausnahmebehandlung
Hoax
Code
Systemaufruf
Datensatz
Erwartungswert
Umwandlungsenthalpie
Funktion <Mathematik>
Flächeninhalt
Code
Information
Hilfesystem
Server
Atomarität <Informatik>
Patch <Software>
Framework <Informatik>
Datenhaltung
CLI
Statistischer Test
Statistischer Test
Endogene Variable
Passwort
Passwort
Softwareentwickler
Gerade
Signifikanztest
Fehlermeldung
Datenhaltung
Vererbungshierarchie
Programmierumgebung
Ereignishorizont
Endogene Variable
Ein-Ausgabe
Server
Faktor <Algebra>
Programmierumgebung
Fehlermeldung
Computervirus
Einfügungsdämpfung
Subtraktion
Punkt
Binäres Entscheidungsdiagramm
Quader
Familie <Mathematik>
Zahlenbereich
Befehl <Informatik>
Kartesische Koordinaten
Kontextbezogenes System
Ähnlichkeitsgeometrie
Framework <Informatik>
Zeitrichtung
Eins
Statistischer Test
Einheit <Mathematik>
Statistischer Test
Programmbibliothek
Softwareentwickler
Auswahlaxiom
Signifikanztest
Lineares Funktional
Befehl <Informatik>
Ähnlichkeitsgeometrie
Programmierumgebung
Kontextbezogenes System
Arithmetisches Mittel
Funktion <Mathematik>
Schnelltaste
Framework <Informatik>
Programmbibliothek
Programmierumgebung
Server
Web log
Klasse <Mathematik>
Mathematisierung
Gebäude <Mathematik>
Patch <Software>
Term
Homepage
Homepage
Statistischer Test
Statistischer Test
Test-First-Ansatz
Passwort
Passwort
Strom <Mathematik>
Datenstruktur
Softwareentwickler
Signifikanztest
Lineares Funktional
Schreiben <Datenverarbeitung>
Fehlermeldung
Vervollständigung <Mathematik>
Ein-Ausgabe
Gleichheitszeichen
Endogene Variable
Teilmenge
Objekt <Kategorie>
Menge
Datenstruktur
Ein-Ausgabe
Geheimnisprinzip
Fehlermeldung
Objekt <Kategorie>
Bit
Subtraktion
Komponententest
Web log
Desintegration <Mathematik>
Mathematisierung
Interaktives Fernsehen
Zellularer Automat
Schreiben <Datenverarbeitung>
Diskrete Gruppe
Signifikanztest
Framework <Informatik>
Homepage
Homepage
Algorithmische Zahlentheorie
Statistischer Test
Datensatz
Einheit <Mathematik>
Prozess <Informatik>
Statistischer Test
Code
Minimum
Elektronischer Programmführer
Soundverarbeitung
Signifikanztest
Nichtlinearer Operator
Lineares Funktional
Kategorie <Mathematik>
Stellenring
Strömungsrichtung
Binder <Informatik>
Web log
Endogene Variable
Integral
Objekt <Kategorie>
Funktion <Mathematik>
Einheit <Mathematik>
Verbandstheorie
Information
Programmierumgebung
Implementierung

Metadaten

Formale Metadaten

Titel Easy-Bake Testing
Serientitel Ember Conf 2016
Autor Baillie, Liz
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/34695
Herausgeber Confreaks, LLC
Erscheinungsjahr 2016
Sprache Englisch

Inhaltliche Metadaten

Fachgebiet Informatik
Abstract Mocha? Chai? Qunit? Jasmine? What's the difference? Which one is best for me? How do I use these new integration tests? What are mocks and stubs and how should I use them? With so many different testing frameworks, libraries, and addons, and so many different styles and approaches to testing your Ember apps, it can be daunting to get started building a test suite to meet your needs. Don't be scared! I'm here with my nonthreatening lightbulb-powered Easy-Bake testing guide to help you out!

Ähnliche Filme

Loading...
Feedback