mark cerqueira well-rounded nerd

QA is a Puzzle

There are many ways to QA your product. Unit tests, automated/integration tests, and manual testing are the big ones. A common misconception is you only need one of these. If you’ve got two you feel like a champion. But QA is puzzle; to get it right you need all the pieces!

Delivering a quality product starts when changes are made and “ends, but never really ends” when your customers have your product happily in hand. Good QA tries to cover every step of this process and each method has its strengths. Unit tests can normally run quickly so they can run before any code is committed. Integration tests take a little longer but can be set up to run periodically and cover your major test cases across various devices. A human touch with manual testing can round out and fill in the gaps that will naturally be uncovered by other test methods.

Don’t settle for having a single plan-of-attack when it comes to QA. Instead, grow your QA strategy so that it helps you deliver a high quality product.

Xenoblade Chronicles 2 Is Coming!

This is the level of faith I have in Monolith Soft and the power of Xenoblade: I picked up a Wii U for Xenoblade Chronicles X and am soon picking up a Switch now that the release date for Xenoblade Chronicles 2 (XC2) has been revealed. December 1st can’t come soon enough!

Unlike Xenoblade Chronicle 2’s release date announcement nearly six months out, I’ll only need to languish for under three months before I can get my hands on this! I’m super excited to be able to play XC2 on-the-go especially since I’ll be flying back east for the holidays. Both Xenoblade Chronicles and Xenoblade Chronicles X were great games, but in somewhat different ways; I’m excited to see where XC2 sits in between the two great gems that preceeded it.

Permissions Validation on Android

I previously wrote about how unwanted permissions can sneak into your APK during manifest merging and how one can undeclare permissions. While undeclaring permissions is an option, validating the permissions in your final APK is a better approach since you can explicitly check for all the permissions you want and fail if there are any unknown permissions.

So how do we this? Fortunately it’s pretty easy to whip up a script that leverages the Android Asset Packaging Tool (AAPT).

AAPT lives in the build-tools directory of your ever-expanding Android SDK folder. The build tools are versioned: my SDK folder contains versions 25.0.2, 25.0.3, and 26.0.1. You can do some technical interview preparation and test yourself on the somewhat mundane exercise of finding the most recent version of AAPT programmatically. For the lazy, just grab the AAPT binary and put it in the same directory as your script.

Once you’ve got AAPT you can run it to get the permissions of your APK: aapt d permissions GGApp.apk:

It’s easy enough now to parse out the permissions and compare them against the set of permissions you are expecting in your final APK!

More Than Sound - Music in Nier: Automata

I wrapped up Nier: Automata recently and the one thing that repeatedly struck me during playing the game was just how awesome the music was. The tracks themselves stand on their own as great pieces of music but how the music interplayed itself in various ways with the game itself is what took things to the next level.

Spoiler alert: this post contains spoilers for some major story points, but does not spoil the overarching theme or conclusion of the game!

Hacking - While playing as 9S you have the ability to hack into enemies and locked things to damage them and unlock them respectively. Hacking transitions you into a 2D bullet hell game mode. Background and battle music tracks each have a chip-tune style track that plays while hacking. For an example, check out A Beautiful Song and its accompanying hacking version.

Note the hacking circle.

This is a nice little touch, but the coolest part is how the game transitions from a track to its hacking version. To begin hacking you have to hold down the Heavy Attack button. While doing this 9S shoots little beams into the target that fills a circle. Once the circle fills completely, hacking begins. Filling this circle normally happens quickly so it’s hard to tell but if you fill the circle a little and stop, you’ll notice the current track starts to “decay” into the chip-tune style analog that is about to play. This is easy to catch while hacking a locked door near the end of the game that takes about 45 seconds to hack into where its easier to notice the shift from Song of the Ancients - Atonement to its hacking version.

Ending theme variations- Nier consists of three playthrough and each playthrough ends with a credits sequence that plays the Weight of the World track. Following the first playthrough the song is sung in English, following the second in Japanese, and following the third in a made-up language Nouveau-FR. Unlocking the true ending plays a medley of all these versions and even includes a chip-tune introduction.

Without significantly diving into what all this means it’s worth mentioning that during the first playthroughs we effectively play through the same story but through two different view points (same song, two different languages). Also the English version’s lyrics are relatively hopeful while the Japanese version is incredibly depressing.

Become As Gods - This was the most “oh wow” moment of Nier’s musical escapades during my playthrough. In early boss battles you get to battle while the epic Birth of a Wish track plays. In the latter part of your first playthrough you travel to a factory to meet a group of machines that end up being a “drink the Kool Aid” type cult that believe killing themselves will bring them closer to God. As machines surround you and chant various cultish dietribes all ending in “become as Gods” the game queues up the Birth of a Wish track but this time with machines chanting Become As Gods alongside the track. Check out the entire sequence leading up the that moment here.

Become as Gods!

What an interesting game but even moreso, what a soundtrack! Hats off to Keiichi Okabe and his team. The soundtrack to Nier (PS3) is one of my favorites and Nier: Automata’s soundtrack brings such a different style to the table and is just as amazing!

Kotlin Kills the Arrow Anti-Pattern

I read a great article on the Arrow Anti-Pattern the other day. Shortly thereafter on the same day I also thought about Kotlin and boom! I realized something I’ve known all along: Kotlin kills the Arrow Anti-Pattern!

Consider this Java method:

The anti-pattern here is the series of if checks (for null) that make this code look like an arrow. With Kotlin’s safe call operator (?) and Elvis operator (?:) we can write that method in a single line!

Boom! The arrow is dead! While checking nullness is not the only case arrows can emerge, null checking is a pervasive painpoint, and common source of the arrow anti-pattern, in Java so these operators make our lives much better.