MVVM 및 Jetpack 라이브러리를 사용하여 Android에서 Duolingo 리팩터링
컬렉션을 사용해 정리하기
내 환경설정을 기준으로 콘텐츠를 저장하고 분류하세요.
듀오링고는 세계에서 가장 인기 있는 언어 학습 앱입니다. 과거에는 어려웠던 것을 쉽고 재미있게 들을 수 있게 해주는 Duolingo입니다. 이 경쾌한 언어 환경을 위해서는 끊임없이 새로운 기능과 실험을 지원하며, 이러한 모든 기능을 제공할 수 있는 원활하게 실행되는 앱이 필요합니다. Duolingo 입장에서, 전 세계 어디에서든 기기에서 앱이 반응하지 않으면 학습자의 의욕을 상실할 수도 있습니다. 이를 통해 우수한 앱 역량을 갖추게 되었고, 특히 초급자용 휴대전화에서 앱을 추적하는 CEO를 포함해 수강생의 60%가 사용하는 Android 기기에서 더욱 그렇습니다. 그래서 Duolingo의 Android 개발팀은 '앱이 응답하지 않음' 오류가 증가하고, 프레임이 떨어지고, 심지어 손으로 작성한 불만사항이 접수되자 즉시 조치를 취했습니다.
그 결과, 앱 성능 문제의 원인을 곧 밝혀냈습니다. 기존 소프트웨어 아키텍처가 팀 성장에 맞춰 제대로 확장되지 못했다는 것입니다. 필수적인 업데이트로 인해 앱의 성능 저하가 발생하고 있었습니다. 개발자들은 버그 수정에 더 많은 시간을 투입하고 새로운 수익 창출 기능을 출시하는 데 할애하지 않았습니다. 오래된 소프트웨어 아키텍처는 회사와 팀의 속도, 무엇보다도 사용자 경험에 부정적인 영향을 미치기 시작했습니다. 코드베이스를 처음부터 다시 빌드해야 했습니다.
진행 방법
초반에 팀은 좌절했습니다. 지금 이 사안이 최우선순위에 맞을까요? 한 그룹은 계속해서 새로운 기능을 출시하고 수익을 창출하는 것이 더 중요하다고 생각했으며, 다른 그룹은 Android 재부팅에 모든 관심을 집중하는 것이 미래에 도움이 될 것이라고 생각했습니다. 결국 그들은 회귀에 맞서기 위한 노력이 증가하면 로드맵이 완전히 탈선될 위험이 있다는 합의에 도달했습니다. 온 힘을 다해야 했습니다.
팀에서는 점점 인기 있는 솔루션을 채택했습니다. 그들은 Model-View-ViewModel을 사용하여 앱을 다시 작성하기로 결정했습니다. Model-View-ViewModel은 개발자가 관심사를 명확하게 구분하여 앱의 아키텍처를 간소화할 수 있도록 Google에서 지원하는 소프트웨어 패턴입니다. MVVM을 사용하면 그래픽 사용자 인터페이스 (뷰) 개발을 비즈니스 로직 (모델) 개발에서 분리할 수 있습니다. 명확하고 합의된 패턴을 수립하여 새로운 기능에 대한 접근 방식을 조정하고 신입 개발자 온보딩을 보다 수월하게 만들 수 있습니다.
각 기능을 별도의 모듈식으로 분할한 덕분에 팀의 생산성을 빠르게 회복할 수 있었습니다. 팀은 소규모 그룹을 배정하여 각 기능을 동시에 작업할 수 있게 함으로써 속도를 높이면서 오류를 줄일 수 있었습니다.
팀은 Android 버전과 기기에서 일관되게 작동하는 코드를 작성할 수 있도록 Dagger와 Hilt를 비롯한 Android Jetpack의 라이브러리로 이 새로운 아키텍처를 구현했습니다. 이러한 두 가지 추가 기능으로 더 나은 캡슐화된 기능을 만들고 Android의 내장 모듈을 더 효율적으로 활용할 수 있었습니다.
결과
이러한 성과는 Android, 특히 엔트리 레벨 기기에서 학습자의 경험을 크게 개선합니다. 또한 플래그십 기기에서 더 매끄러운 애니메이션으로 반응성이 향상된 앱을 만들 수 있었습니다. 일일 '앱이 응답하지 않음' 또는 ANR 발생률이 41% 감소했습니다. 앱이 타겟 프레임 속도 아래로 떨어진 시간의 비율이 28% 감소했습니다. 가장 중요한 점은 사용자가 주요 화면을 스크롤할 때 속도가 40% 증가했다는 것입니다.
손을 들고 메모를 하는 것으로 ANR 발생률이 41% 감소하고 프레임 속도가 28% 향상되었으며 사용자 환경이 40% 빨라졌습니다.
전체 재부팅에 8주가 걸렸으며 앱은 모든 Duolingo 학습자에게 훨씬 더 매력적이고 즐거워졌습니다. 이후 6개월 동안 팀은 새로운 중대한 성능 저하를 기록하지 않아 배송 수익 창출 기능에 다시 집중할 수 있게 되었습니다. 품질에 집중하기로 한 결정은 효과가 있었습니다.
이러한 사명을 완수한 Duolingo는 세계 최고의 언어 학습 앱이 되었습니다. 접근성을 저해하지 않으면서 최첨단 교육 환경을 조성하는 등 우수한 앱 성능을 갖추기 위한 노력 덕분에 이러한 목표를 달성할 수 있었습니다.
시작하기
Duolingo가 어떻게 Jetpack의 라이브러리를 통합했는지, 그리고 Model-View-ViewModel이 앱을 어떻게 개선했는지 자세히 알아보려면 Google의 개발자용 기술 우수사례를 읽어 보세요.
이 페이지에 나와 있는 콘텐츠와 코드 샘플에는 콘텐츠 라이선스에서 설명하는 라이선스가 적용됩니다. 자바 및 OpenJDK는 Oracle 및 Oracle 계열사의 상표 또는 등록 상표입니다.
최종 업데이트: 2021-08-19(UTC)
[[["이해하기 쉬움","easyToUnderstand","thumb-up"],["문제가 해결됨","solvedMyProblem","thumb-up"],["기타","otherUp","thumb-up"]],[["필요한 정보가 없음","missingTheInformationINeed","thumb-down"],["너무 복잡함/단계 수가 너무 많음","tooComplicatedTooManySteps","thumb-down"],["오래됨","outOfDate","thumb-down"],["번역 문제","translationIssue","thumb-down"],["샘플/코드 문제","samplesCodeIssue","thumb-down"],["기타","otherDown","thumb-down"]],["최종 업데이트: 2021-08-19(UTC)"],[],[],null,["# Duolingo refactors on Android with MVVM and Jetpack libraries\n\nDuolingo is the world's most popular language learning app because it's managed to make something people have found daunting in the past feel easy and fun. This breezy language experience requires a constant stream of new features and experiments --- and a smooth-running app that can deliver all of them. To Duolingo, an unresponsive app on a device anywhere in the world could mean a potentially discouraged learner. This commits them to app excellence, particularly on the Android devices used by sixty percent of their learners, including their CEO, who keeps track of the app from an entry-level phone. And so, when Duolingo's Android development team noticed an increase in \"App not Responding\" errors, dropped frames --- and even received hand-written complaints --- they took action immediately.\n\nThey soon uncovered the source of the app's performance issues: the existing software architecture wasn't scaling well with the growth of their team. Necessary updates were causing painful performance regressions on the app. Their developers were devoting more time to fixing bugs, and less to shipping new revenue-generating features. Their outdated software architecture was starting to become an unacceptable drag --- on them, their team velocity, and, above all, on their users' experience. They needed to rebuild their codebase from the ground up.\n\nHow they did it\n---------------\n\nAt the beginning, the team was torn. Should this be their sole priority now? One group felt that it was more important to continue shipping new features and driving revenue, while the other believed that focusing all their attention on an Android reboot was the way forward. Eventually, they reached the consensus that the increasing effort of fighting regressions risked derailing their road map entirely. They had to go all-in.\n\nThe team settled on an increasingly popular solution. They decided to rewrite their app\nusing [Model-View-ViewModel](https://developer.android.com/jetpack/guide?gclid=Cj0KCQjw6s2IBhCnARIsAP8RfAj6I4mhRRdSqjYfPlvGET9S6mmRGJrc8Inkc-cCe1IVdTDEvlE3hFEaApHkEALw_wcB&gclsrc=aw.ds), a software pattern supported by Google that allows developers to streamline an app's architecture by creating clear separation of concerns. With MVVM, they could separate the development of the graphical user interface (the view) from the development of the business logic (the model). They could establish clear and agreed upon patterns, making it easier to both align their approach to new features and onboard incoming developers.\n\nBreaking each feature into its own modular piece allowed the team to quickly regain productivity, as they could assign small groups to work on each feature in parallel, increasing velocity while reducing errors.\n\nThey implemented this new architecture with libraries from Android's [Jetpack](https://developer.android.com/jetpack), including [Dagger](https://developer.android.com/training/dependency-injection/dagger-basics) and [Hilt](https://developer.android.com/training/dependency-injection/hilt-android), to help them write code that works consistently across Android versions and devices. These two additions enabled them to create better encapsulated features and [utilize Android's built-in modules more efficiently](https://developer.android.com/training/dependency-injection).\n\nResults\n-------\n\nThese performance gains significantly improved learners' experience on Android and in particular on entry-level devices. They also led to a more responsive app with smoother animations on flagship devices. The daily \"App Not Responding\" or ANR rate dropped 41%. The percentage of time that the app fell below its target frame rate decreased by 28%. Most importantly, their users experienced a 40% increase in speed when scrolling through key screens.\n\n\n*Hands holding notes reading 41% less ANRs, 28% improved frame rate and 40% faster experience.*\n\n\u003cbr /\u003e\n\nThe whole reboot took eight weeks and made the app considerably more engaging and delightful for all Duolingo learners. In the six months since, the team has recorded no significant new performance regressions, allowing them to focus again on shipping revenue-generating features. The decision to focus the team's efforts on quality had paid off.\n\nDuolingo's dedication to their mission made them the world's top app in the language learning space. Their commitment to app excellence --- creating cutting edge educational experiences without compromising accessibility --- is what kept them there.\n\nGet started\n-----------\n\nIf you feel like diving into the nitty-gritty of how Duolingo integrated Jetpack's libraries, and how Model-View-ViewModel improved their app, read our [technical case study](https://android-developers.googleblog.com/2021/08/android-app-excellence-duolingo.html) for developers."]]