Bug Reports: A Story
Tags: android
Published: 2019-02-22 03:14:24

---
title: Bug Reports: A Story
published: true
tags: android
canonical_url: https://zdominguez.com/2019/02/20/bug-reports.html
---

> “This tool sucks :facepunch::rage::rage::rage::rage:”

> “Ugh WTF this is so stupid :poop::fire::fire::fire:”

These are just some of the things I have heard developers say over the years whilst working on Android. Sometimes they are trying to figure something out and there is not enough documentation, other times they are trying to make their tools do something and it just won’t work. Oftentimes, it is because they are expecting something to happen and it does not.

I know it can be frustrating, I have been a dev for more than a 12 years now after all. But then again, no matter how much or how loudly you curse the Android gods, where does that get you? Does it fix the issue? Does it improve the situation? I do not think so.

So what should we do then?

#### My answer has, and always will be, “have you filed a bug for it?”

Android has its own dedicated issue tracker organised into several components. [This page](https://source.android.com/setup/contribute/report-bugs) enumerates those components and have some very good tips on how and when to file a bug.

It is important to select the correct component because (1) it makes the relevant team aware of your issue, and (2) each component may have a template for reporting issues.

[![](https://zdominguez.com/assets/bug_reports/components_filter.png)](/assets/bug_reports/components_filter.png)  
<center><small>Android Studio component with template</small></center>

When writing up a bug report, think of what you, as a developer, would find useful if it were _you_ receiving the issue. _“This app sucks”_ is way less helpful than _“I have trouble logging in with my credentials that work on my computer”_.

I try to be as helpful to the developer as much as I can because we both have the same end-goal: **to fix a verified issue**.

It might be time-consuming, but when the bug you reported gets fixed and other devs start to notice and benefit from it, it is very rewarding. :green\_heart:

{% twitter 1097832566512644096 %}
<center><small>I might be totally wrong but I’d like to think [my bug report](https://issuetracker.google.com/issues/62685775) helped nudge this along :sweat_smile:</small></center>


{% twitter 969138357338038272 %}
<center><small>Sometimes, [my feature requests](https://issuetracker.google.com/issues/37136823) actually get built too! :dancer:</center></small>

#### Do you want to get _your_ issues fixed too?

The trick is to make the bug report as great as possible. Let’s take [this bug for example](https://issuetracker.google.com/issues/38213600). I encountered an issue whilst running “Remove Unused Resources” from Android Studio and wanted to report it.

To gather the relevant information about my machine, I opened Android Studio and then chose “About Android Studio”. I then clicked on the copy icon in the dialogue box that appeared; that copies into my clipboard almost all the information asked for by the template!

[![](https://zdominguez.com/assets/bug_reports/copy_info.png)](/assets/bug_reports/copy_info.png)  
<center><small>Click that!</small></center>

I then provided a short overview of the reproduction steps; I try to follow the given-when-then pattern. Set the scene first to give the developers some context of what we are trying to achieve. In this case, I have provided a zip file of sample project that reproduces the error.

Next, I reported what I was trying to do and what happened as a result. If there are multiple steps that need to happen first, I enumerate them all in order. In this bug, I have also provided a screenshot so that the team can quickly verify that they have reproduced my error exactly as I see it.

And finally, I tried to provide as much as detail as possible. Were there scenarios where this does not happen?

> It looks like Studio detects layouts inflated through the generated binding file’s `.inflate()` method as unused. Views inflated using DataBindingUtil are not removed. ([From here](https://issuetracker.google.com/issues/38213600#comment1))

If it is a feature request, what would I like to see as the end result? What are the benefits of fixing this issue?

> If I am beginning data binding, “user defined types” might be unfamiliar. ([From here](https://issuetracker.google.com/issues/62685775#comment1))

Are there any workarounds that I am aware of?

> Found another way to fix it. Remove the spaces before and after the arrow, as such:`android:onClick="@{()->handlers.onSendNotificationClick()}"` ([From here](https://issuetracker.google.com/issues/37136809#comment2))

When I found a use case that was missed by the initial fix, I provided another sample project.

Really, a sample project is like a picture. It paints a thousand words.

**EDIT (20190221):** I cannot believe I need to say this but I will say it anyway: **_BE NICE_**. No one wants to talk to a jerk.

#### A good bug report is like a good story.

It presents the characters, introduces conflict, and finally, a denouement.

Be a good storyteller and hold your audience captive. After all, it’s the stories that make this world much more fun and interesting. :relaxed: