How senior iOS devs test & refactor legacy code with Massive View Controllers | Live Dev Mentoring

  Рет қаралды 20,228

Essential Developer

Essential Developer

Жыл бұрын

Want to learn how to refactor Massive View Controllers and catch/fix bugs in legacy iOS codebases? 👇
Watch this FREE mentoring session now and learn what techniques senior iOS devs use to test and refactor legacy iOS code, including network requests. 🧑‍💻
Get the source code at: github.com/amirtutunchi/Sampl...
Join the iOS Lead Essentials program iosleadessentials.com
Like and share this content with someone that you believe will benefit from it.
---
Subscribe to our channel ↴
kzfaq.info...
You can also find us on ↴
Twitter ☛ / essentialdevcom
Facebook ☛ / essentialdeveloper
Instagram ☛ / essentialdeveloper
LinkedIn ☛ / essentialdeveloper
Telegram ☛ t.me/essentialdeveloper
Caio ↴
Twitter ☛ / caiozullo
LinkedIn ☛ / caiozullo
Mike ↴
Twitter ☛ / mrmichael
LinkedIn ☛ / mapostolakis
Visit our website ↴
essentialdeveloper.com
How to Build iOS Apps with Swift, TDD & Clean Architecture series ↴
www.essentialdeveloper.com/pr...
Caio & Mike's Book Suggestions ↴
www.essentialdeveloper.com/bo...

Пікірлер: 20
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
Sign up to gain FREE access to exclusive iOS dev courses, workshops, and mentoring sessions: www.essentialdeveloper.com/community?
@munzrs
@munzrs 4 ай бұрын
Mark my words. When I become a lead dev this will be required material for my team. Such high quality content that the iOS community sorely needs. Thank you, ED!
@hagarkassem
@hagarkassem Жыл бұрын
Thank you Caio & all ED instructors
@TungNguyen-qr4rn
@TungNguyen-qr4rn Жыл бұрын
Thank for your content. I have a question: If my public method is too complex to test like they have 100 lines long and call several private methods, and each private method call some functions from dependencies. What should I do? How can I test this public method? And if i have new changes in some private methods so How can i test them through public method?
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
Hello. It seems like this method is doing too much. Consider breaking it down. And if you want to make changes to private methods because of requirement changes, you should first add a failing test through the public interface, then make a change to the private method to make the test pass. This way, the new behavior will be covered by tests through the public interface. Finally, if the change in private method doesn't change the behavior (aka refactoring), you don't need to change tests because the behavior is already covered.
@TungNguyen-qr4rn
@TungNguyen-qr4rn Жыл бұрын
@@EssentialDeveloper Thank for reply. I have one more question. For example: If the private methods are complex, to test public method i need to mocking dependencies of private methods so much. Should i extract these private methods to another class with an abstraction? Or any better approach? Thank you!
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
Consider breaking down complex components into simple components that can be composed to achieve the complex behavior.
@kalpeshjethva598
@kalpeshjethva598 Жыл бұрын
Is it possible to clean the table view cell from memory once the view controller is de initialize? The table view cell is empty still it showing me in graph memory.
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
Hello! Yes, it's done automatically for you as long as you don't have any other objects referencing them.
@kalpeshjethva598
@kalpeshjethva598 Жыл бұрын
@@EssentialDeveloper there is no code inside the cell. still, it shows me in the graph. Also, the view controller is de initialize successfully.
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
It could be code *outside* the cell holding it in memory.
@kalpeshjethva598
@kalpeshjethva598 Жыл бұрын
@@EssentialDeveloper ok let me try to check and try to clear. thanks for your reply.
@tringuyen623
@tringuyen623 Жыл бұрын
HI, should we test the functions of extensions (like String extension, Collection extension, and Date extension) that we wrote?
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
Hello. We recommend you write automated tests for all behavior in your apps.
@tringuyen623
@tringuyen623 Жыл бұрын
@@EssentialDeveloper thank you for your answer. But, I still concern about this. For example: I write Date extension with func toString() -> String. Then I use it function in my view model to convert Date -> String. I do not write unit test for that view model yet. So now I start to write test for that view model. The question is Should I write more test for just extension function? Not include in test case of view model.
@EssentialDeveloper
@EssentialDeveloper Жыл бұрын
If you test it through the ViewModel behavior, you don't need to test the extension directly. In fact, the extension can be considered an implementation detail and even be private/internal.
@tringuyen623
@tringuyen623 Жыл бұрын
@@EssentialDeveloperunderstood. Thank you
@tringuyen623
@tringuyen623 Жыл бұрын
One more question. Should we use 3rd libs for testing (like Quick & Nimble)? My collagues and some experienced iOS developers in my city suggest to use Quick & Nimble instead of XCTest because that lib provide a quick way to write test quick, readble and effective than XCTest. I dont know that is true or not and why we should use and why not.
@pravinnashte9514
@pravinnashte9514 Жыл бұрын
hi
MISS CIRCLE STUDENTS BULLY ME!
00:12
Andreas Eskander
Рет қаралды 20 МЛН
Sigma Kid Hair #funny #sigma #comedy
00:33
CRAZY GREAPA
Рет қаралды 40 МЛН
Clown takes blame for missing candy 🍬🤣 #shorts
00:49
Yoeslan
Рет қаралды 48 МЛН
From Legacy Code To STATE OF THE ART DEVELOPMENT
20:04
Continuous Delivery
Рет қаралды 22 М.
Getting started with iOS modularization by Luka Terzić
23:48
Senior Angular Developer Interview (theory)
41:57
WeCoded
Рет қаралды 14 М.