Writing Our First Unit Tests - Testing on Android - Part 3

Поделиться
HTML-код
  • Опубликовано: 25 янв 2025

Комментарии • 144

  • @crateer
    @crateer 4 года назад +53

    Just started an Android Dev internship, and tomorrow my job will be to start writing Tests for the ongoing project - this Series is the perfect preparation for that!
    You absolutely Rock!

    • @PhilippLackner
      @PhilippLackner  4 года назад +7

      Thanks a lot, always happy to help! :)

    • @santtu6930
      @santtu6930 2 года назад +1

      What was your internship experience like? How much they expect from you and what kind of things you did?
      I'm having the biggest imposter syndrome so I'm a bit nervous about interships.

  • @VasuRana
    @VasuRana 3 года назад +14

    I was trying to learn writing test cases for such a long time brother. And today because of you I finally started it. Really like the way you teach. Huge fan. Subscribed. :)

  • @sergeytarasov5041
    @sergeytarasov5041 2 года назад +1

    One of the best video about testing in Android. Short, simple and All-in-One.

  • @reidosnoobs81
    @reidosnoobs81 2 года назад +2

    I am a fan from Brazil! You helped me a lot during all my evolution!! Congrats for the great role you make in spreading knowledge!

  • @santtu6930
    @santtu6930 2 года назад +1

    It's awesome that these videos are free, you're brilliant at teaching. Thank you!

    • @user-km9qy7co7l
      @user-km9qy7co7l 2 года назад

      Hi, how your journey in android world ? Did you get the job ?

    • @santtu6930
      @santtu6930 2 года назад

      Hi! I'm still studying but I plan to do internships this year. Android development is still one of my favourites

  • @jagat.jeeban
    @jagat.jeeban 2 года назад +1

    Hey Philipp, thank you so much for making testing videos!! We really needed this.

  • @s-w
    @s-w 3 года назад +2

    Awesome, I didn't understand how to implement testing until watching your videos!

  • @dadveloper2326
    @dadveloper2326 2 года назад +3

    One small comment I have is to click the check mark box in the test toolbar to show passed and failed tests if you'd like to see al the test results like yours shows in the video. Mine was set to only show failed by default. Thank you again, Philipp!!

  • @vishakhasharma802
    @vishakhasharma802 3 года назад +4

    Oh wow amazing.. Specially loved your teaching way that you gave homework in between and in end too. This way I could actually evaluate my knowledge. Thanks a lot for such work.

  • @markiianmykush9124
    @markiianmykush9124 4 года назад +4

    Very good idea with homework, go on, very interesting

  • @stocklin9831
    @stocklin9831 3 года назад +5

    I am a Taiwanese. Although we are of different nationalities, I want you to know that your high-quality videos helped me. I am very grateful to you, thank you

  • @jackli1924
    @jackli1924 Год назад +1

    Your videos are always awesome!the way explain some technology is quite concisely and easy to understand. Thanks a lot Philipp!

  • @dadveloper2326
    @dadveloper2326 2 года назад

    So many "A-HA" moments here for me! You're a God of the community.

  • @sushant-chauhan-08
    @sushant-chauhan-08 4 года назад +1

    Waiting for more videos. Thanks for making our concept clear.

  • @Князь-я7щ
    @Князь-я7щ 3 года назад +1

    Brilliant!
    I applied to my project, works well!

  • @AwesomeDevNotes
    @AwesomeDevNotes 4 года назад +20

    Testing yes. More, more more videos on all kinds of testing 🐣

  • @aviksutar
    @aviksutar 2 года назад

    buddy you don't need to ask for click on the subscribe button. Your contents are unique and very very useful. ppl will do it themselves

  • @udaysharma5228
    @udaysharma5228 2 года назад

    Its so easy to understand. You are amazing dude!

  • @str8busta
    @str8busta 2 года назад

    I did the braces the homework but the fibonacci confused the hell outta me. I was sitting for like an hour but eventually gave up lol. Couldn't for my life figure out the definition you provided and what exactly I'm supposed to test:
    * fib(0) = 0
    * fib(1) = 1
    * fib(n) = fib(n-2) + fib(n-1)
    Great video anyway it was so well explained and packed with knowledge.

  • @utkarshkore4076
    @utkarshkore4076 4 года назад +1

    Great video mate💪💪 will surely do the homework 🙌

  • @pradeepkumarreddykondreddy7048
    @pradeepkumarreddykondreddy7048 4 года назад +1

    good start for TDD (Test Driven Development)

  • @majinzeke4977
    @majinzeke4977 Год назад

    I'm watching this thread before an interview. wish me luck!

  • @tejas5331
    @tejas5331 3 года назад

    I started my new job from 28th September. I got the confidence regarding MVVM only because of you :) Thank brother :)

  • @mahatmeprashant1roll
    @mahatmeprashant1roll 3 года назад +1

    Hello Philipp, Thank you for making such awesome videos. :) Please make one playlist for app security as well!

  • @kshitizagnihotri8777
    @kshitizagnihotri8777 3 года назад

    @13:15 empty username returns fails is actually function name , how it can be failed until it implies any condition

  • @omidzakeri5163
    @omidzakeri5163 3 года назад

    Very good Philipp

  • @footballCartoon91
    @footballCartoon91 2 года назад

    @16:18 i dont understand why is that we test the parameters of a function separately for example
    first we need to validate the username whether it can be used or not because if somebody already use that username he cannot use it..
    ok fine but then the second parameter of that function is tested in another function..
    what if in the second function i put different username or maybe the username that already being taken?
    so does this means when we test a function means we want to test the parameters of that function?

    • @footballCartoon91
      @footballCartoon91 2 года назад

      ok now inderstand it
      we must write all possible scenarios in the unit test and handle it correctly without bugs

  • @salmanaziz6810
    @salmanaziz6810 3 года назад

    Man you are simply awesome :)

  • @rickyvonicky4371
    @rickyvonicky4371 3 года назад

    hello , assertthat is depreceated ... new on this , what alternative to use ??? Great tut !!

  • @fatmafakhfakh9997
    @fatmafakhfakh9997 2 месяца назад

    it work for me , all my tanks ; but now i want to implement in alredy existing project
    it do
    No tests found for given includes
    can you give an approche how to fix

  • @dinabandhumondal240
    @dinabandhumondal240 4 года назад

    Awesome!!! Really helpful.

  • @SayantanBasu1993
    @SayantanBasu1993 4 года назад

    This is really helpful as I was searching for kind of this.. Thanks and expecting for more videos on #testing..

  • @amirrezalotfi8919
    @amirrezalotfi8919 3 года назад

    Thank you. The video was fantastic.

  • @mehdiparsaei1867
    @mehdiparsaei1867 4 года назад

    Thanks a lot for Testing course. Good luck Dear Philipp. 100000000 Like

  • @pradeepdeshmukh2023
    @pradeepdeshmukh2023 3 года назад

    Great work good explained 👍

  • @amitray769
    @amitray769 4 года назад

    Thank you,... want more videos on writing test cases

  • @miguelhernandez-pt8cl
    @miguelhernandez-pt8cl 2 года назад

    i started the google lessons two weeks ago and now it tells me to go to these test folders but my diceapp doesnt have it! idk what to do ive looked everywhere

  • @neverStopLearning3
    @neverStopLearning3 3 года назад

    Great explanation, thank you very much for the useful video...

  • @Akash-Bisariya
    @Akash-Bisariya 4 года назад

    Nice explanation bro..thanks for helping us.

  • @fareeshussainsyed232
    @fareeshussainsyed232 4 года назад

    wow!! I really loved this video

  • @ali1998d
    @ali1998d 2 года назад

    Very good, Thank you!

  • @PiyushKumar-ix9jp
    @PiyushKumar-ix9jp 2 года назад

    can i go through this playlist if i know java istead of kotlin

  • @baskarank9364
    @baskarank9364 2 года назад

    It's very helpful, Thanks a lot

  • @codingwithsam4992
    @codingwithsam4992 3 года назад

    I follow you a lot and your content are very good. It would be more better if you could remove the keyboard noises so that we can focus more on the content

    • @PhilippLackner
      @PhilippLackner  3 года назад

      Thanks, that's the case in my latest videos

  • @mrpi230
    @mrpi230 4 года назад

    Great explanation. Thank You.

  • @mehdiparsaei1867
    @mehdiparsaei1867 4 года назад

    fun checkBraces(expression: String): Boolean {
    var openBracesCount = 0
    expression.forEach { char ->
    if (openBracesCount < 0)
    return false
    if (char == '(')
    openBracesCount++
    if (char == ')')
    openBracesCount--
    }
    return openBracesCount == 0
    }

  • @ganeshshetty1124
    @ganeshshetty1124 3 года назад

    I use java for development, can you create a playlist in java also?

  • @akashdeepwadhwa5828
    @akashdeepwadhwa5828 3 года назад

    did i do right ? i used regex for matching password containing number of digits? since you used lamda functin to check if it is digit ..

  • @mahmoudelgamal7320
    @mahmoudelgamal7320 3 года назад

    verrrry good . that help me alot . thank u very much

  • @mehdiparsaei1867
    @mehdiparsaei1867 3 года назад

    I have some issues in JAVA8 for using google truth.

  • @sheebazafer3961
    @sheebazafer3961 4 года назад

    thank you so much phillip.... i just wanna ask you bout google android certification exam?? what are your views on that??

  • @safionweb
    @safionweb 3 года назад

    Great content!

  • @manuelsiebeneicher4426
    @manuelsiebeneicher4426 3 года назад

    Really great series. Also good as a summary if you are familiar with programming and TDD but want to know how to do it well in the Android context.
    But one questions:
    Is it really a good practice to write *all* test cases before you write the function logic?
    My experience is, that it's better to write one test case, try to 'solve' the test case with an implementation as simple as possible.
    Maybe in your example I could hard code the user name of the first test case. In the next step I'm writing the test case that can fail the function also as simple as possible (using another user name, so you couldn't hard code the name in the function logic).
    This approach leads to multiple test cases per equivalent class but also to a better test coverage.
    What's your thoughts about that?

    • @PhilippLackner
      @PhilippLackner  3 года назад +1

      If you strictly follow TDD what I know is that you write unit tests first, so they fail and then you write the logic. That makes you think about all the different scenarios and which things can go wrong. But that is just one approach, it is not the approach. If you find out for yourself that your method works better, there is no law forbidding that 😁

  • @basavarajkeerthana3473
    @basavarajkeerthana3473 2 года назад

    Which tool ur using to write and test ??

  • @tanjimahmed213
    @tanjimahmed213 3 года назад

    Hi Philipp, no android developer talk about backend server how to create API's, etc please make a tutorial about these

    • @PhilippLackner
      @PhilippLackner  3 года назад +1

      Check pl-coding.com/premium-courses, I got 2 courses on ktor :)

    • @tanjimahmed213
      @tanjimahmed213 3 года назад

      ​@@PhilippLackner Thank you so much

  • @mohyddineal-lahham7620
    @mohyddineal-lahham7620 4 года назад

    Amazing job 👍👍👍👍

  • @jamesedwards7966
    @jamesedwards7966 4 года назад

    This is a great video and I haven't seen the other videos yet so I am not sure if this topic is covered but can you show me how you test coroutines from the viewmodel. I have done it in the past but I dont think it was the good. I think there is a better way. Thanks.

  • @ezequielpirola6169
    @ezequielpirola6169 2 года назад

    Hi Philipp, I would like to ask you something, how should I do to test private functions?

    • @PhilippLackner
      @PhilippLackner  2 года назад +1

      You test them indirectly by testing the public functions that use them

  • @hakan.melikoglu
    @hakan.melikoglu 3 года назад

    Great video. Thank you

  • @zohidjonakbarov6648
    @zohidjonakbarov6648 3 года назад

    Good job bro thanks.

  • @MauricioMunoz
    @MauricioMunoz 4 года назад

    Which keyboard do you use? I like how it sounds!

  • @mehdiparsaei1867
    @mehdiparsaei1867 4 года назад

    Do you suggest to use `password confirmedPassword -> falsse` in test fun names?

  • @ManpreetSingh-cs5kp
    @ManpreetSingh-cs5kp 4 года назад

    Ever used hamcrest lib for matchers ? Specially for kotlin

  • @saurabhsingh1608
    @saurabhsingh1608 4 года назад

    Can you write some Mock API call , Repository call testcases in details .?

  • @spacelamaglama
    @spacelamaglama 3 года назад

    is assertThat deprecated? What to use now?
    EDIT: sorry, was using the wrong import, is working and is perfect. Thanks!

  • @JamesBond-mq7pd
    @JamesBond-mq7pd 3 года назад

    thank you for showing truth library, sir.
    also i want to share with you library that i like to testing
    MockK - testing library for kotlin. is way more better than JUNit. but Truth looks very beautiful for asserting.

    • @PhilippLackner
      @PhilippLackner  3 года назад

      yes, I like that one as well. MockK is not a testing library though, it's for creating mocks. It's a replacement for Mockito. JUnit is something else

    • @JamesBond-mq7pd
      @JamesBond-mq7pd 3 года назад

      @@PhilippLackner oh. I did not know. Thank you

  • @gauravthakkar802
    @gauravthakkar802 3 года назад

    I actually came to know about the count extension function and what it can do, I was almost thinking you would write a regex for this case

    • @borispsalman
      @borispsalman 2 года назад

      probably the function already contains regex inside, i guess its just a good practice not to reinvent the wheel and also less prone to errors because i still dont understand regex too much :D i know what it should do but the syntax is way too much so far

  • @bsal5347
    @bsal5347 6 месяцев назад

    Wow this was fun.

  • @ampo2004
    @ampo2004 4 года назад

    My only question to you sir is...for every test we need to create a "Util" class? for example if I have my functionality already created how can I approach testing?

    • @PhilippLackner
      @PhilippLackner  4 года назад +1

      Nono, this was just for demonstration. This Playlist will be big, you will learn what you want to know later here

    • @ampo2004
      @ampo2004 4 года назад +1

      @@PhilippLackner Thank you very much! great and simple explanations waiting for the next videos : )

  • @WarmHug451
    @WarmHug451 2 года назад

    Thank you 🔥🙏

  • @ahmedaboshady9733
    @ahmedaboshady9733 2 года назад

    thank you very much😍

  • @adityabhawsar8532
    @adityabhawsar8532 4 года назад

    how do you create and edit your videos please help me do that create a video or name a software

  • @balajichinnadurai9015
    @balajichinnadurai9015 3 года назад

    loved the video, subsribed

  • @JamesBond-mq7pd
    @JamesBond-mq7pd 3 года назад

    use Option + Command + L to reformat code to follow codestyle

  • @aleksanderaleksandrov520
    @aleksanderaleksandrov520 Год назад

    TestRunner does not find my test.
    The test runner finds and runs the example test, but my - "test events were not received".
    What seems to be the problem?
    > Task :app:testDebugUnitTest FAILED
    FAILURE: Build failed with an exception.
    * What went wrong:
    Execution failed for task ':app:testDebugUnitTest'.

  • @aridwiprayogo
    @aridwiprayogo 4 года назад

    Why do you choose library truth instead AssertJ?? Is there any different benefits??

    • @PhilippLackner
      @PhilippLackner  4 года назад

      Haven't used AssertJ, Google uses Truth everywhere and it's just super readable

  • @mihirshirgaonkar7832
    @mihirshirgaonkar7832 2 года назад

    great explenation

  • @AlaouiMediaVision
    @AlaouiMediaVision 4 года назад

    I can't import the truth library until added the truth extensions
    testImplementation "com.google.truth.extensions:truth-java8-extension:1.1.2"

  • @rishviks8987
    @rishviks8987 4 года назад

    Homework done sir!!

  • @randy4443
    @randy4443 4 года назад

    Will it better to break that function to smaller functions?

    • @PhilippLackner
      @PhilippLackner  4 года назад

      You could do that, but imo not necessary here. You could write the entire function in one line

  • @kelvinclark3474
    @kelvinclark3474 4 года назад

    Perfect and simple

  • @satyavachan9344
    @satyavachan9344 3 года назад

    you are life savior

  • @ShriSitaRam2
    @ShriSitaRam2 3 года назад

    Great tutorial. Helped me learn so quick.Followed you on youtube and insta :D

  • @topcutestanimals6039
    @topcutestanimals6039 4 года назад

    how to make these brackets: `` instead of ''
    I use US keyboard, but in android for writing more words names with spaces, only the first type of brackets works.

    • @garri5108
      @garri5108 3 года назад

      Button above Tab

  • @rushidesai2836
    @rushidesai2836 4 года назад

    I wonder is apps like Netflix and Amazon uses test cases.

    • @PhilippLackner
      @PhilippLackner  4 года назад +3

      For sure, every serious software company uses tests

  • @farooqahmad9310
    @farooqahmad9310 4 года назад

    Thanks, brother.

  • @footballCartoon91
    @footballCartoon91 2 года назад

    man i feel down..
    it seems programming is not as straight forward as i thought..
    like
    you write some code and it will run
    it is not like html

  • @armandoavila4615
    @armandoavila4615 4 года назад +1

    Thank you!

  • @syedtayyabulmazhar6945
    @syedtayyabulmazhar6945 4 года назад

    The difference in video quality and your beard makes this video feels like it's 3-4 years old compared to your latest videos.

  • @zhanyshmasirov4611
    @zhanyshmasirov4611 3 года назад

    You’re British man or American?? , because I’m not good understand english , but I have understood everything what you’ve said .

    • @PhilippLackner
      @PhilippLackner  3 года назад +1

      I'm german

    • @zhanyshmasirov4611
      @zhanyshmasirov4611 3 года назад

      @@PhilippLackner Ach so alles klar !! aber danke! Ich kann auch Deutsch. Du bist wunder developer weiter so!! weil Ich Aus Kazakhstan und Ich sehe die video uber den android development bei Russisce Streamears "Mobile Developer -Russische Android Streamer" z.b und er beginnt nicht seit Anfangs und er erzahlt schon geschriebene code , deswegen z.b Ich Bin Junior und. das ist schwerig verstehen gescriebene code. deswegen ich folge dich und gucke deine video! danke dir!!!! ich hoffe du verstehst mein gebrochene deutsch ))))

  • @JamesBond-mq7pd
    @JamesBond-mq7pd 3 года назад

    thank you!

  • @samdroid37
    @samdroid37 2 года назад

    THANK YOU

  • @keerthireadimades7718
    @keerthireadimades7718 3 года назад

    Thanks 😘

  • @fahmtechnologies3568
    @fahmtechnologies3568 2 года назад

    Thanks bro

  • @mansonluo1119
    @mansonluo1119 3 года назад

    thank you

  • @saumilpatel2480
    @saumilpatel2480 4 года назад

    Thank you.

  • @funnymoment9164
    @funnymoment9164 3 года назад

    Thanks

  • @junecnol79
    @junecnol79 3 года назад

    excellent

  • @ivankvych8182
    @ivankvych8182 3 года назад

    Very Nice))

  • @sushant-chauhan-08
    @sushant-chauhan-08 4 года назад +1

    A question how does these ecommerce apps handles caching for handling huge amount of images data.

    • @cptsakamoto
      @cptsakamoto 4 года назад +1

      Image loading libraries has functionality of handling caches