Refactoring PayPay’s Android App
Adrian came to Japan to join PayPay as an Android Engineer. As the app has grown in scope, refactoring the codebase to ensure development can continue at a rapid pace has been a big part of his job.
Adrian, originally from Sri Lanka, was five years into his career as a software developer, when his country was hit by a serious terrorist attack. Tourism had been a major sector for the economy, but the attack disrupted it. He said, “From that point onwards, the economy started spiralling downwards. The cost of living increased, while my salary remained the same. So I thought that this is the time I should migrate to another country to improve my economic outlook.”
One option was moving to Japan. When he first started researching about working here, he was apprehensive about the working culture. He said, “I read a lot about working culture in Japan, and I realized how demanding traditional Japanese companies can be. I also heard about how people did a lot of overtime here.”
However, he also learned not all Japanese companies were like that. He said, “When I searched about PayPay, I got good information, like they’re not a traditional Japanese company where it is very hierarchical. That was reassuring, and considering the situation I was in back home, I thought I would take this challenge rather than stay back there.”
From the moment I got the first interview until I got the offer letter, the processing was very fast.
Applying to PayPay, he was impressed with how fast they responded to him. He said, “From the moment I got the first interview until I got the offer letter, the processing was very fast. There were a total of three interviews, with about one week between each one.”
Once he was hired, getting settled in Japan was made easy due to the support PayPay offers their international employees. He said, “The entire hiring process couldn’t have gone smoother. All I had to do was go to the airport and land in Japan. The rest of the stuff was taken care of by the company, from arranging the accommodations here to taking care of the bureaucratic work with registering at the local ward office. They assign a person for you, and if I receive a letter that is entirely in Japanese, for instance, from the ward office, I send it to the HR, and they translate it for me, and let me know what I need to do in a very clear manner. The support has been phenomenal.”
To help new engineers get up to speed, PayPay assigns a mentor, who helps teach both how to contribute to the codebase on a technical level, and also how to navigate all the other processes around communication and bureaucracy that are involved in working with a company.
If I have a question, I’ll just drop a chat to my mentor, and he’ll direct me to the correct resource, or help me through a Zoom call.
While this was initially the mentoring was done face-to-face, just three weeks after Adrian joined PayPay, Japan went into a state of emergency due to the COVID-19 pandemic, and everyone moved to working from home. He was still able to get support from his mentor though. He said, “If I have a question, I’ll just drop a chat to my mentor, and he’ll direct me to the correct resource, or help me through a Zoom call.”
Adrian is a member of the Android feature team, which as its name implies is responsible for adding new functionality to PayPay’s Android application. While PayPay started as a payment service, they’re in the process of transforming it into a “super app” that builds a lot of things on top of this basic platform.
As part of this transition, refactoring the codebase has been a big part of Adrian’s job. This is made easier by the automated testing. He said, “We use kotest to write unit tests and use tools such as danger and ktlint to ensure no broken code gets merged to the master branch. The CI checks we have in place also ensures that the code quality is kept up to the standard.”
In addition to the tests the engineers write themselves, PayPay also has a dedicated QA team. He said, “The QA team does manual testing, as well as automated testing for the UI, I think every day, and reports back to us. We get reports from the manual QA, the automated QA, and of course our unit tests as well. That ensures we don’t ship a bad product at the end of each release cycle.”
Adrian talked about a particular challenging refactoring. He said, “We are using a navigation library that is not maintained any more, and that is holding us back in terms of implementing features that has complex navigations, which is otherwise easier if we use the native components from Android. In order to avoid that, we’ve been trying to move away from this library. That involves some refactoring work as well, to extract away the code that directly interfaces with this particular library. That’s one of the challenging aspects of working with the Android consumer app.”
Getting an organization to allocate resources for a big refactoring project is always challenging. Initially, the Android team suggested taking a break from feature development, and focus instead on getting the codebase in a state where it is easy for them to add new features. Eventually though, they settled on creating a dedicated platform team, whose responsibility is to take care of this kind of architectural and refactoring work, while the feature team can continue to focus on delivering value to the end users.
As a member of the Android feature team, this isn’t to say Adrian does no refactoring. He said, “I spend most of my time doing feature development, but while I’m doing feature development, I also make it a point if I see something that can be refactored, I take it.”
If you want to move away from a more traditional Japanese company, to a more modern one, PayPay would be a good choice for you.
Adrian recommends joining PayPay because it is so international. He said, “If you take the Android feature team for example, there are currently eight people, and the members are from six different countries including Japan. PayPay is not a purely Japanese company, but an international one. If you want to move away from a more traditional Japanese company, to a more modern one, PayPay would be a good choice for you.”
As a new company that’s brought in many experienced developers, he also thinks it’s a great place to learn from your peers. He said, “Since it’s not just a payment service, it’s a great opportunity to learn different business domains. Currently we have a team where most of the people are from different business domains, and they have a wealth of knowledge coming from their respective domains, and they’re trying to apply it here. There’s always a new thing to learn everyday, so it’s a good opportunity in terms of growth.”