Get to Know one of The Best Testing Libraries for Kotlin!

Video Statistics and Information

Video
Captions Word Cloud
Reddit Comments
Captions
Salam Alum friends and welcome back to the channel always with you shaeri in this video we are going to explore one of the best apis or libraries about testing in cotl let's get started so the library we going to use is called codest this is one of the best libraries about testing in C Lane like you already know junit 5 or four but this one has massive flexibility in term of the things you can do and also expressiveness in a cish way all right so this Library actually Encompass three different things it has testing framework assertion library and also property based testing this kind of different way or different Paradigm to do testing when it comes to testing right we are only going to explore this test framework if you want me to do a video specific video about property based testing let me know Below in the comments we shall explain this strategy and also have to implement it via something like this Cod test all right so first let's proceed with the setup I already did the setup in my case so in the setup I'm using a brand new Android project you can use it in cot by the way this is a cotl multiplatform library okay so we can use it here in our case so what I do have I do have two examples I want to share with you first I have a library example like this is a sample thing there's a burrower there is book b and Library service like this pretty simple thing and also a shopping cart in which you can add stuff calculate prices do checkout and similar stuff so here in the lips I'm adding the dependencies right so you can notice that the dependencies here you only need this one one actually only need the runner as I said the assertion and the property are extra thing all right and also you can use this assertion library with jit for example you can do that also all right so I'm adding this libraries like that in The Following also I noticed that we need this library in order to run one test by the other uh I had this problem I added the C reflect Library all right so make sure if you have this issue I will point the issue later on but this is one of the things I added and also I made everything as bundle okay so at the end of the day it will be used like the following it will be used here you can use it for test implementation for Android test implementation like using it as part of your instrumental test there is an actual extension are going to tell you about extension later on because it isn't straightforward how to add this one with the instrumented test for the moment you are going to use it for local test like you can see here in this example all right so this is the beauty of BS next you need to add this one for the tasks because under who the code test we use the junit gdle plugin so we need to make sure for for this also all right let's write our first test I'm going to write simple test here so just get started so this is a simple test so this is the first thing to understand Code test come with something called Styles okay we don't have any annotations for the moment like we don't have annotation to run tests okay we have different styles and each style allow you to write test in a given manner okay let's start with the simple one which is function test or fun test okay this is function test okay so always we need to extend from this one we need to extend from there is something called fun speec all right and here you would do the following and the following all right so you write the test inside this Constructor Lum because this one will run in the in it okay you can do it like that or for example you can remove it from here make it the simple thing and then in the init you shall start writing your test your test are simple you shall call the method called test here give it a simple string sorry and you can run your test okay this is for example one test I think the AI is given me I don't know you can start doing this test for example but the beauty what I'm telling you is that you only need to run this test function give it here for example first test and then we need to run it now for the running part I will show you because this button won't be shown by default okay so let's run the test here let's check actually this testing anything okay so you can see the test is passive like I just want you to see how you can write the test okay we can do it like that as following but most of the time lot of people doing it the other way around they write their test here inside this one I don't know like because this is new side maybe you wouldn't like it but what will happen under the hood is that the function body you pass it will be part of the init all right so that's pretty much it all right so this is the way on how to start writing test but actually this is only one style for writing tests okay there are many ways to write test so this will depend on you for example if you go here and you go to the framework and go to something called testing style you will see there are many many testing style the beauty about this codes is that they try to learn about all the other framework of testing in all other uh languages for for example they would grab some good thing from PHP unit for example from Ruby testing from JavaScript testing like they wanted to kind of accumulate all the extensive knowledge of the community and the experience about building good library for testing and they wanted to reuse the good parts okay so this resulted in this kind of Li okay so there are many things for example there are string spec for example with this string spec you can do the following let me change it you only need to change it here string spec and then the way to write test simply by writing test first for example like following and you do it like that okay this will be dependent on you because you need to choose a style and you work with and this also will need to be a team decision all right so this is train spec for example one of the good spec there is there is something related to behavior G development which is BTD test so you can do Behavior spec like following and guess what you can write something called given something the beauty what is really really cool is that you can start nesting things in right so what do I mean by that you can say given I have Library what you can do is that you can in the given you can put two tests right so it will be executed as part of the given given I have a library I can do the when this one of course the when problem is that this is reserve keyword you have to do it with this practic when I add a book for example then this function will be executed I can Nest other than inside the same one like that and I can Nest other WS inside the same given I can do this one like following I remove a book I don't know this is just an example guys I'm just exploring this library for you so you can notice that there is this kind of scoping thing right you can give something inside certain scope and this is a cool thing actually when it comes to testing I'm going to add just one thing I'm not not sure about whether this will pass or not but this will run it I'm running it as part of this one actually as I told you like here is the thing there is this given this one and there is two things here of course here I made a problem I wrote same test name okay the B library is intelligent to add certain stuff here all right so that's pretty much it on how to start using the library now we are going to understand certain stuff first thing you won't see this icon by default here all right this problematic but in order to do that you need to install the plugin that comes with this Library go to your settings and then go to your plugins and here in the plugins just search for codest okay there's this big plugin of codest this is the the main one this will add several stuff one of those you can start running test by one okay so using this plugin you can actually run the tests easily from this buttons here now there is one ual problem with the API itself it's still it's still an open issue on GitHub when you run certain class Ned class listed uh tests I mean and there is an object that is used from the outside for example this Library service is used from this one the test won't pass problem is that for this kind of test it is running it with Gradle but with this test it's running it with Code test this is little bit problematic so this is isn't mature enough to use it for this one but you can run all test and that would be fine all right we will show you a way on how to perform one single test for example here uh in in a second all right so uh this is one thing about the cool thing about the plugin the other thing about the plugin is that when you click here on the code test you can notice all the tests you have okay this is a beautiful thing but as I told you you can't simply uh run them from here the beauty you can run it with coverage also this is cool thing directly from here and you can perform other stuff with expanding filtering and doing other stuff with this plugin so this is regarding the plugin now let's create another file for the tests I'm going to test Library service feuture test and you are going to use another type of testing called feuture spec all right so with the feature spec you can do something like the following you can create a feature and you can give it scenarios okay this is one of the cool things also about testing like some people prefer this kind of test right so you can create a context or bigger scope here and then you can add scenarios to that feature so you can create multiple feature this is another cool spec as I said there are many specs here there is fun spec the normal spec there is word spec Simple Text there is describe spec this is same as previously as we do it JavaScript I think yeah JavaScript there is free spec there is shoot spec there is other specs try to explore them you are not going to explore everything now I want to talk about something called Properties or configurations right so for this feature I can disabled and enable via certain stuff for almost all spec there is this kind of config okay here in the config you can enable many first thing you can use the enabled and this enabled you can enable it the test or not you can enable the test for example like following or you can disable it okay so this by consequence it will disable everything so if I want to enable only this test for example I can copy this one and make the enabling here okay so I don't want to run this one so when I run everything are going to run this one and you are going to ignore this one okay but as I said if you try to run one single test it will crash because it will tell you like I couldn't find this class yeah Library spec wait a minute Library spec I think it will tell w't able to locate the library service exactly there is this problem of no class definition it has problem with reflection because as I said it's using the code test it's still open issue if you want to decide you can omitted for that issue until they fix it all right so you can of course run everything so you notice that we can eliminate or ignore this test okay this is an actual cool thing you can do for every specific test for the config isn't for the enabling only there are many things you can determine the number of invocation I want to run this test for example invocations for seven times okay if it fails in one only it will consider it as failure okay so it will run it seven times so this is kind of a way to tell like I only want this to pass seven times so I can make sure I I'm confident enough this is passing especially if there is something dependent on random stuff maybe on deterministic test of course okay uh there isn't only that there is Timeout this also good thing timeout I don't want this test to take more than 100 milliseconds the beauty is that they are using cutlan duration API so I can make something like that milliseconds and this will time out in 100 milliseconds if it doesn't pass in 100 milliseconds for example how much taking taking 15 milliseconds right let me do it okay let me enable it first and I can make it in 10 milliseconds so we can run it in 10 milliseconds let me run everything okay I can run it from here okay it is passing that's pretty weird is two milliseconds you can't do less than that but I hope this shows you how you can uh do that okay there is Timeout for this one and I think there is big timeout okay this is one cool thing there is kind of specification or configuration stuff dependent on the spec itself so if you do the this there is for example timeout here this timeout is for the whole for the whole test okay so if I want this to pass in 10 milliseconds literally okay the problem is that this one is duration so I want it to pass in less than 100 milliseconds for the moment it is passing the whole 23 milliseconds okay let's do 10 milliseconds run everything it Should Crash it shouldn't pass exactly initialization error timeout waiting for 10 res okay but as you far as you understand this one is coming for the spec okay this configuration is for the spec so you can notice there is configuration for the spec and configuration for the individual test and you can go here to the parameters and notice there is threats number of threats there is enabled if like this is a Lambda you can enable tests based on something you can extract it and put logic in all your test Suite to enable and disable it the beauty about this one is that you get the test as parameter so the name the certain stuff you can basically disable enabled based on certain condition invocation timeout okay so there is this invocation timeout and there is this timeout right so for this invocation for if you remember we did seven I can do invocation timeout so for each one of those it's going to take 10 milliseconds for each one of the seven currently the whole seven is taking less than this timeout but if I want to be specific about each timeout each invocation how much time should take I can do that with the invocation time out there is ctin scope if you want to use ctin scope by default as you can see we are using ctin scope there is something called here test uh schedule test security scheduler and you can do normal stuff advance until idle the normal stuff uh you use of course this every time you have to optain for certain stuff let me check this one why this one isn't working okay it accept something of course but this wouldn't work immediately you need to add that you are using the C scope here okay otherwise it will crash okay so as you can see there is this config for the the whole spec all right now let's pretend you want to do config for the whole test you have in this module for example for that reason there is something we call configuration for the whole project you simply do it by creating an object let's call it config like following and here okay this can be an object you need to extract for something called abstract project config all right and here you will find many many properties if you do command o and try to put everything okay there will be many many many things all right so for example like it's too much for the moment for example let's let me just do that there is Timeout for example you saw the timeout right this timeout is for the whole project so you can set the timeout like I want my duration of the test for the whole stuff to be 10 minutes for example all right so this one we make sure that the whole test in my test Suite would be just 10 minutes so you can see that this is one of the things I like about this Library it enable you to do many things pretty much easily okay but for this to run you need to do the following create a resource folder in your project and add this properties because we need to scale it this one will have many configuration stuff and one of the things you can add is this config object right so you need to add this so it can uses this object at the start it will scan this one and use it all right there's many things regarding these properties as I said you can specify them here also you can specify them here so if you check here in the library you can go to configuration and then go to Project level setting here you can notice that you can do the following right priorism for example three this is also cool thing property assertion mode error if there is problematic uh assertion mode for the build fa to build all right and there is this good thing also fail on ignore test when you ignore certain tests you can make it fail this is cool thing and there is system properties these are the system properties I showed you earlier there's many properties here I invite you to go and check them by your hand okay because many timeout parm same thing you specified here you can specify almost here but not everything all right so let's pretend let's try this one let's do 5 milliseconds for the whole test and let's run our tests shouldn't pass exactly waiting for 10 milliseconds okay but what about this one for 5 milliseconds which we defined here the whole the whole thing and you can specify many many other stuff so this is for the configuration now let's get back to the testing part uh one of the things they do have about this one something called XI out I can do x given what does this mean as you can notice is that I'm ignoring it okay so you can do it in the config because this one doesn't have a config right but you can do it with this x you can X the given X the then and X the one the one is problematic you have to do it like that but right now we don't have to use it because X1 isn't the thing all right this is related to the scope it's not problematic if I do X here everything will be X out right even though I'm not Xing I'm not putting this out the whole thing will be exing this thing but if I put the X here and remove it it will be for only this test if I do X here it will be for both tests right let me delete this one okay it's not showing exactly you can notice it here other thing in this specific behavior spec you can use given with big G so you don't have problem with the we okay same thing for the then this is also fine and then you can do extend almost all of them have this thing if you go to the feature spec feature you can do X feature so it will drop this x feature X scenario and same thing right so this is one feature they do have in this Library which is X and out for the test that doesn't have I don't have a simple test right let me pretend I'm having a fun spec right so let me just comment on this code okay I just removed it let's let's use this fun spec here you can notice that with this fun spec I have only test I can't Nest things into things right but if you want to do so you can create a custom object called context and here in that context you can add certain stuff so you can include execution of course I have to name it something hello suit for example so I can test like I have things related together like uh we saw with the describe like we saw sorry with the behavior G development for example or feature spec okay and the same thing you can do X context X test for example and you would be fine there is another way to kind of this they call it band tests right so you can do the following if you put it like the following this one it will ignore everything so if I try to run this one nothing will pass but nothing will run uh sorry but if I remove it and put it here I will ignore so this is another way to ignore test as compared to what's that actually okay okay let me just remove this one because this is weird 10 minutes sorry like following let me run everything for the simple test exactly test two isn't passing can notice that test two isn't passing because I'm using this one as I said this is called Banning if you want to spe to run specific tests but this is actually to the top level stuff like if you have the following right let's add another test three for example like that and I want to run only this one you can do F2 points like that and if you try to run it this is kind of called Focus right so if you focus you will run only this and by default all of those will be ignored so sometimes you want to run specific test to make sure that it is passing this is actually one way to solve the problem you have about not able to run this test only so you can run everything and make sure to only focus on it okay you can use as I said the X for ignoring certain stuff and this focus and ban to ban certain test so I want to run everything except this one so this combination of the methods and the tools you have like this is one of the things I like about this Library enable you to do many certain stuff all right so this is regarding Banning uh one of the things many people ask about how can I do before tests like previous way before test by the way there is one annotation you can do it's called annotation spec people love annotation spec right so with this annotation spec you can do it like following the normal and guess what let me delete this thing I can do the normal test guys test but make sure you are getting this from The annotation spec exactly and you can run your test the usual way and you can add the test and the test will be passed normally like they said they try to Encompass all of the methods all of the good ways that the community are using for running the tests okay this annotation spec and here you can use before each for example I think it's before each and here make sure you are getting it from uh the code test okay so you can perform this before each and after each I think after test now after each here The annotation spec you can see there is before before all okay after all before all like you can notice there is ignore you can ignore certain stuff so you can use this one also but for the other test there is this function called after test so it will be sample Lambda you can do it after test the Bea Bey about this thing here you get T of two things you get the test case if you do put the it there is a which is the test case this test case will give you many things the name the parent the type for example for this one the parent will be this one like you can perform conditional stuff for certain test also you will get the test result whether it has passed as an error the duration success reason maybe so this is up to you on how to perform this kind of test all right so this is after test you can run before test of course before test you'll have only the test case so you can have the spec what is the spec what is the test name what is scriptor many what is the test type okay that's awesome like you can get many call backs in here in this features spec all right another thing let me just show you for this config right for this config as I said previously you can pass enabled you can pass lot of stuff you can create actually an object for this configuration so you can do test config if you want to share it across many many things so you can do test config like following test config and here you will have everything for example the enabled part which is true for example you can have invocation like you want to share the same config across many so you can pass the test config like the following and pass it also here instead of repeating it 2,000 times okay so this is one way to share configuration another feature they have which is cool thing also there is something called tag exactly here each test can have certain tags right you can create a tag I think it's called name tag okay let's pretend I'm having tag called I don't know C routines for example I can do the following I can add tags to certain configuration for example for this scenario for example this scenario specifically I want to add a config in this config I want to add TXS the beauty is that it accept set of TXS I can do set off and pass this tag or let's call it Q routine okay so this tag I'm having here right for example in another test completely different place in the simple test here for example let me just remove that let's add another example let's add same thing on the same class for example I can in this configuration this is simple string uh example by running the string here you can add configuration I can put text here and the same thing set off and I can pass ctin tag okay Beauty with the library right now if you have many scattered ctin test and you want to make sure that the Curtin tests are passing correctly you can simply tell the library to run only the tests that have curity fortunately you can't do this by hand you have to do it by grade all right so for this one on the tax part okay it need to show that what Tags I'm having so the tag here isn't shown for some manner but you can run into the gr as I said here if you go to the library go to the framework and go to grouping test this is a feature for grouping test is for example what they are doing they're creating Linux and windows base test so you can run them separately or you can create it like that the same thing we did all right then you can do the following you can run Gradle test and part of this one I want to run Linux and not database test okay so this is kind of quing which test you want to do this is an awesome feature we really needed previously so grouping the test based on certain criteria like database Linux for example for my side I don't know I can run only view model tests or some kind can run only coutin based tests I want to check that coutin flow stuff is working fine so this is pretty awesome of course that way we can do many many things with this thing okay as I said you can put here but if you want to put a tag for everything I think you can use TX like that exactly and here you can pass creting TX you can pass stuff normally same way you did here but this will be enabled for everything all right other parts I think you can tar it like following you can tag it like that and he shall give it the name of the tag actually like that okay so with this thing in mind you can run this based on this tag okay so this is different way on how to group your tests and also some people ask how to test exception this is part of the assertion itself stuff so you can do should throw something should throw throw or should not throw but this is part of the assertions okay uh that's why it isn't here so for example should throw this one and can put a legal format exception I can put the code here that should throw this one then I will have the result here this will give me a result I can also make assertion the message the calls like everything okay this is an actual legal format exception itself okay so this is one way to check exceptions in this library but this is part of the assertion for the assertion you can do all should and you can notice the number of matches you have okay should not should not be should not have like many things should throw should be in this collection stuff exactly this should be an instance should be null should be a type of I advise you to go and see about that but if you want specific videos about like social Library there's a lot of Truth this one there assert k for example like many assertion libraries so this will dependent on the team and the style uh you like but if you want to use only codest that would be fine also because you have many many options let me show you here something related to instances okay instance mode I'm going to delete that for the moment and I'm going to create a context big context like following and inside it I'm going to have two other tests okay so let's pretend we have the following all right there is something called isolation mode okay so how we are triggering this test we are trigging this one right and then we are trigging this one okay in this test should I rerun it without running this one for example I can do simple as hello okay and run the test what do you expect for this hello it will run two times or only one time okay something is not working okay it didn't work I need needed to change it with the word spec which require this Sho thing here so everything is running so for this one it will be hello you can notice that there is three hellos right there is three hos why is that because first time it will run like this one will run it will run it then for this to run it will have to run it again for for this one to run it will rerun it again okay so you can make it you can make it obvious with what we call U ID this one let me just try to generate random strin of course let's run it how many uid you expect I'm going to have I'm going to have three okay three different uids okay this one this one this one because there is three execution when this execute this is one path when this execute it has to execute this so this is second path when this execute it will be third path but let's say you don't want this Behavior you can change it via something called isolation mode currently I'm doing the isolation mode instance per test right I can change it for this test specifically I can go here to isolation mode and use isolation mode and this for example I can use single instance so what will happen if you run it right now let me run it with single instance you can notice what I'm having here you will have only this one will execute once here that's all we are not going to execute it for this one and we are not going to execute it for this one and this sometimes can cause trouble because let's pretend I'm using this uid here okay I'm generating U ID here and then or database for example and I'm altering the database here hello U ID the problem with this approach is that when I change for example I add things to the database at this level this test will see it so this will be a problematic this one will run perfectly because it doesn't depend on anything related to our class as you can see it's working even though I run it from here so you can notice that hello this is the same thing okay it's executing as part of this test of course so but you can see they are sharing the same thing a lot of the times you don't want this one actually good characteristic of unit test they should be kind of separate this is the actual meaning of unit inside unit test every unit should be separate for this one right so usually after each test we remove things from database we reset at the database so this one because sometimes test this one tests unless there is things into the database so if this add things to the database it will make this test pass so this is a side effect okay so this sometimes you need it so this will be dependent on you okay you notice that there is single instance there is instance per test as you saw so if you run it again instance per test so for each one we will have it and this is considered as another test so for that reason you are going to execute it three times so this one we'll have different instance for this one okay let me I add to show it here so we will have three different UI IDs here in this case so there's okay four we have one two three four five all right all right all right all right all right so for this one you are going to see this one for this one are going to see this one that's fine now for this one to execute it has to create another one and pass it okay it's not another one actually the same one is used so this is the one for here and this is the one for here and this is actually running it without running any other test so you can notice it you create an EXO thing the last one which is per Lea so you can actually map what are the UN test are having are going to have something with test one again and something with test two again so there are two leaves at the end so this will execute only two times we are not going to execute the first one here so it will be only two still this uid and this uid will be different okay so this one will be different than this one and we won't have any other execution because this one doesn't execute on its own it need to be part of a leaf okay you can set it here for this test or you can set it as part for this isolation mode you can set it here or you can set it as I'm doing it here instance per test okay so sometimes you need that feature as I said this capabilities of such a library allowing us to do certain stuff on our own this is what driving me to make this video and share this library because a lot of people sometimes need this kind of flexibility to run certain tests all right so this is regarding isolation mode another thing A lot of people do is which is called parameterized test parameterized test we needed parameterized test usually to run one test several times with different parameters beauty is that since you already cin you can simply do the following can do like for example let's pretend I want to run this test many times but here's one thing you can do this off and you can you can have for example this one and for each one I'm going to run this test this time for example let me remove this one so it will be simply that string okay I can do the following for example to make it clear test it or test name for example and then I can use this parameter of course inside this one and create my test you'll see I have three different tests this is beauty since you already C in okay what's this one let's new new sign test with interpret name cannot be Reus the plugin okay that's exactly because we are changing the name because you can't guess it here in plug in you can see right okay so you notice we can do it like the following there is an actual better way this is they call it something called Data driven testing something like that it's actually just parameterized test but here you would need this framework it's called Data Center so what you can do you can do something called with data like following this is the beauty so you can create with data let's pass our list like that and this it will have a simple string and for this one I can do directly this thing guys so it's testing so I can remove everything I don't have to do it by hand now I can run it and it will execute it three different times now it is up to you on how to specify how you are going to name the test by default you are going to see the default version of the test would name okay A B and C here there is an parameter that's called exactly named FN so you can do the following name FN okay so this will be an actual Lambda so it will give you the string that you are going to pass which is this one and you can return a string so I will take hello testing it so this it will be that a that is being passed so if I run it right now you will notice that I can name it like that hello testing AB or I think there's another way that is called map instead of passing it like that you can pass map off and here you can pass the test name to the test data you like a for example then you can specify this one two3 let's call this a and this BB and this CCC so canot C and B let me remove this one so here it will be the it will be the second one if I change this one to end for example five it will be that an can notice here now that's a beauty so you have many options as I said this is one of the cool things as you can see this is thing as I said this is one of the cool thing that allow you to customize certain thing and they are much much flexible this is called in their terms dat G testing but actually it's just parameterized testing we want to run one function with multiple parameter or one you are testing one thing with multiple parameters right another thing another feature they do have which is awesome thing which is fa fast let's say we have three tests here right and if this fails this one won't be executed so you can enable it by fail fast like that true and then I think this one need to be part of context need to be part of cont okay so we need to put fonts back here and let me just put context test context like that so once everything is here okay you can also do it from config here there is fade fast right you can give it true okay let me just delete it because I don't need it I already did it here you can basically put it for each uh for each context you have and then if you run it this wouldn't pass right so this will be ignored completely this is very fast sometimes you need it maybe you don't have to run this test because you know if this is failing I need to deal with this one this is an awesome or another thing here in the library there are many many many things I suggest you to check liaries there is non-deterministic testing okay that's awesome another feature there is for example this eventually this will try to run this thing for example 5 Seconds it will try to rerun it in 10 milliseconds on 100 monds you can specify it like that also the interval and if it pass only one time it will consider it as passing eventually it will pass okay there is continually which is the reverse it means this code should Shall Pass every 5 Seconds during that 60 seconds because uh this one will be triggered retriggered by the API you can specify 60 seconds here and I think it will run it every 10 milliseconds exactly this block will be executed every 10 milliseconds so I need this to always pass if it only fail one time it will crash for you the test will fail okay there is until ret try there is many here in the integration part you can integrate mocking and Jau mocking is simple it's just simple you add the mocking here you need just to pay attention to single to isolation mode and there is factories this is simply as what we call it it's name contract test yeah contract test so let's pretend you have an interface that has many implementations right and you want we all sometimes do it for let's say we have fake implementation and correct implementation for something in memory database and or repository or certain stuff and you want to write one test but it will apply to all of those instances or the implementations you can do this with contractors so here the example we are implementing this with list and you are implementing this with a vector for example you can write a test for the list but you have to rewrite copy and paste this test for all s theic what you can do you can write it only once and create this is kind of contract test you used to implement it by hand or with this Library it's pretty fast actually you include something like that it's called word practice Factory and you tell it which test you of course you have here to accept the abstract type and test it and then in term of testing you can use your word spec and use the include at it this is simply will be just a simple function okay you pass it the test names because you have to pass some names of course and then the implementation here the implementation it will be a vector and a list okay so that's pretty much it like this is great pattern you can use for this thing and there are many many things as I said this is an awesome Library you can try to use there is resources temporary files you can close you can use temporary files you can close things with autoc close when you have things that you need to autoc close it by each test completion this is fine this we need to implement the autoc closable yeah autoc closable library or aut closable interface so there are many things finally for the extension part there are many many extension for us Android developer there's another extension here that is Android exactly here this guy implemented codest for Android have Runners assertions and extension to run Android instrumented tests okay you can try this one so you can use the CEST in your Android project it has many things not just uh instrumented runner but specific assertions for Android also and there are many things test containers you can use it for cator for coin for example there are specific things to I saw HTTP cutless right there is codling fixture like many extension you can use and you can copy and use them in your project it has many many features it has many stuff just check them and see what works for you so you can add to make writing good test and creating Suite of test Pleasant because quality of our codebase will be dependent on the quality of our test and the easy refactoring of the test the easy usage extension and running of those test will make sure that our code base will stay healthy that's pretty much it for this video if you want me as I said do video to cover assertion and property based testing let me know in the comments below thank you very much for watching this long video I hope you enjoyed it thank you again don't forget to subscribe Channel and always see you in the next videos Salam
Info
Channel: Charfaoui Younes
Views: 625
Rating: undefined out of 5
Keywords: android tutorial, android clean code, android model view view model, android mvvm, android, studio, development, dev, app, data, views, jetpack, library, explained, explain, how to, guide, tutorial, kotlin, java, mobile, splash, screen, fetch data, network, animate, animation, compose, api 31, api, android 12, api 21, splash screen, android splash screen, splash screen android studio
Id: at7ZU0MkJak
Channel Id: undefined
Length: 42min 18sec (2538 seconds)
Published: Tue Jun 11 2024
Related Videos
Note
Please note that this website is currently a work in progress! Lots of interesting data and statistics to come.