Skip to main content

Working with Android legacy code

In this blog, I would like to share my experience of working with Android legacy code which work well for me so far.

First of all, when I get into an Android project which contains legacy code. I will ask about the current situation of the application:

  • Current features
  • Current know issues
  • Current patterns are being used in the projects
  • Current overall structures
  • Current way of working of the team
  • Current parts in which contain legacy code
  • Current UI tests
  • Current Unit tests

Then I spent some times to get familiar with the current features by getting a phone and try out the current features and the known issues and take notes of those things. In my experience, the applications can be complicated that even the ones who develop it don't know all the features and known issues of it. Therefore, taking note and comparing with the transferred knowledge is a good way to start understanding the application. Now, hopefully, I have a good idea of what I am dealing with. Then I run the tests if there are any.

Next, I write UI tests to cover all the features by clicking through the applications and checking the visibility of elements of individual screens. These type of screen tests save the developers a lot of typing time on the mobile phones.

Finally, I will add unit tests gradually to the code base whenever touching a feature which didn't have enough tests.

Some useful commands and files I used: code reviews tools to read through all PRs, string resource files, icon drawable filesgit grep and git blame/Android Studio's annotate.

Please feel free to left me some comments or questions.

- ninjahoahong

Comments

Popular posts from this blog

The first taste of Rust - A simple you tube downloader

Recently, I just learnt Rust and using it to write a simple youtube downloader with reference from node-ytdl . In this blog, I would like to share the code and how did I make it. You can find the full source code here . Install development environment I am using Windows 10 and scoop package manager. Therefore, I use the following commands. Run scoop install rustup-msvc to install rustup . Run setx "%path%;%USERPROFILE%\\scoop\\persist\\rustup\\.cargo\\bin" to add rustup to the path. Restart termial (git-bash in my case) and check the installation with rustup --version; rustc --version; cargo --version Export custom RUST_HOME : export RUSTUP_HOME=$HOME/scoop/persist/rustup/.cargo/bin/rustup Install a toolchain for rustup : rustup toolchain install stable-x86_64-pc-windows-msvc Setup project Run cargo new simple_rust_youtube_downloader --bin && cd simple_rust_youtube_downloader to create and navigate to the project. Add these dependencies to ...

My books review: Money for the rest of us

Overview: The "Money for the rest of us" book is a list of 10 questions serve as a guideline to invest. It is light book with not many pages and can be read during commute time. The book does not require audiences to have any special knowledge. My impression: The author, Mr. David, is very friendly and patient to answer my questions. The 10 questions are greatly explained by the author, and I think they provide a good starting point. However, I think anyone who wants to invest should build their own checklist and a general guideline for different situations. When a general guideline is in place, the decisions need to respect the guideline in order to make consistent decision. Consistency , in my opinion, is the most important in the long run as it provide information for constant feedback and improvements. Overall, I think this is a good book that helps improving my decision making process. - ninjahoahong

Team Fight Tactics Zero to Master: My 501-Game Journey to Reach the Highest Static Rank in TFT

Introduction Hi, I'm ninjahoahong , a casual gamer with a fondness for strategy games. After achieving Queen rank in Autochess three months ago, I sought a new challenge and turned to Team Fight Tactics (TFT). Despite my experience in the auto-battler genre, I soon realized that mastering TFT would entail a significant amount of learning and trial-and-error. In TFT, players aim for two types of ranks: static and dynamic. Static ranks, like Iron, Bronze, and so on, reflect overall performance and skill level in the game, achieved through consistent play and improvement. As a casual player, my aim is to reach the highest static rank, Master. Additionally, TFT features dynamic ranks that change based on recent performance, such as Grandmaster and Challenger. These ranks are more temporary and competitive, requiring steady performance to achieve and maintain. While they're admirable, I'll likely aim for those dynamic ranks next, but as a casual player, my focus is to start ...