Monkey Business

By Peng Xie

Let the monkeys out!



Of course we’re talking about monkey tests here… There are actually two types of monkeys — the smart monkeys and the dumb monkeys.

A smart monkey, knows the application it is testing, and follows a certain set of rules when it comes to doing its job. A dumb monkey, like its name suggests, knows pretty much nothing and behaves more randomly. One can think that a monkey in real life is probably somewhere between our smart monkey and dumb monkey.

There are advantages and disadvantages for both types of monkeys. A smart monkey, while being more effective to find bugs, does require more effort to “train”. The developer needs to create the said knowledges and rules for the smart monkey before it can start the tests. A dumb monkey is more likely to find random, out-of-the-box bugs. But thanks to its unpredictability, the bugs found by a dumb monkey may be harder to reproduce. Some would even question the value of monkey tests since it may take a long time before they can find any bugs.

“But why?” 

I think monkeys are important friends of developers. Here’s a story:

Xuanzang finished his app. He used test-driven development procedures and wrote all the unit tests for all components of his app, including “comprehensive” UI tests. (At least that was what he thought.) His app passed all tests with flying colors. He were happy and released it to the public. A day later, weird UI related crash reports started to show up in his inbox. People had given his app negative reviews. And he were no longer happy.

“Why? The app passed all tests!” exclaimed Xuanzang.

His monkey friend came and touched a part of the UI that “a normal user would not think of touching.”

The app crashed.

The monkey friend relaunched the app and long pressed a button that “a normal user would just tap.”

The app crashed again.

You see, the monkey is not a “normal user.” As developers, it’s easy (and absolutely normal) to assume a certain user behavior when making test cases. Because we designed the app to function in a set boundaries, we may be blind to some behaviors outside of the box. A wise man once told me, when it comes to test cases, if you think you are already crazy enough, the real life will always out-crazy you. To save our sanity (and time), we need to ask our monkey friends for help.

“Where can we make friends with the monkeys then?” 

A lot of places actually. Not in the zoos though…

If you are an Android developer, your monkey friends are actually living right in your Android Studio! They run on your emulator or devices to produce random streams of user events.

For iOS developers, Apple has yet to introduce us any monkey friends. But we do have SwiftMonkey that lives in GitHub. It even has a framework called SwiftMokeyPaws to let you see where your monkey friends have touched in real time in your app’s UI.

Those are only a few examples. If you search, you can always find a monkey friend with a very particular set of skills…


Ethical Dilemmas of Technology: Privacy

By Xinye Ji

“Arguing that you don’t care about the right to privacy because you have nothing to hide is no different than saying you don’t care about free speech because you have nothing to say.”

-Edward Snowden

It’s difficult to overstate how much privacy we give up to have access to services such as Facebook, Twitter, Instagram, Google, or even Amazon. With every click, whim, or action, we tell the services we interact with a little about ourselves bit by bit. As time goes on a clearer profile of each person is created, and interesting conclusions can be drawn from these profiles.

The movie Yes Man satirizes the worst case scenario when Carl, Jim Carrey’s character, is arrested on charges of potential terrorism due taking flying lessons, studying Korean, approving a loan to a fertilizer company, meeting an Iranian woman, and buying plane tickets at the last minute. While the situation was comically exaggerated, the film brings up an interesting social commentary of the state of our privacy. We run the risk of pushing ourselves further into a surveillance state.

Speculatively, one could argue that applying this data aggregation comes from a place of good will. In fact, terrorism prevention is a frequent argument that the US government makes to continue the activities of the NSA. Aside from crime prevention, there are many different applications to utilize aggregate data. For example, aggregated data now informs us about real-time traffic. Our aggregated profiles can tell us about possible car repair. Are these conveniences worth giving away your information? What about if Target could tell you if you were possibly pregnant based off of your purchases? Or what if Facebook could tell if someone was about to commit suicide? Or what if Microsoft could tell you that you have pancreatic cancer a month before you knew it yourself? Are these advancements in technology worth the loss of our privacy?

This blog post might seem a bit eclectic and contrarian to itself. I don’t intend to draw any conclusions of this topic as we could go on forever about it. However, I do believe this ethical dilemma is something that we, as a society, have to decide on in the near future. For the time being, however, I hope that the average citizen considers and understand how to protect one’s liberties in the digital age.

Would I give HomePod a home?

By Peng Xie


Apple’s highly anticipated speaker is finally released after a few months of delay. I happen to be in the market for some new speakers. Would I give HomePod a home then?

The good

When it comes to speaker shopping, sound and build qualities are two most important aspects I care about. Being an Apple product, HomePod obviously inherited the same beautiful, high quality design from the family. And as a speaker, HomePod does not disappoint either. After some complicated measurements, a Reddit user on r/audiophile claimed that HomePod is “100% an Audiophile grade speaker.” The review has been picked up by multiple publishers as well as Apple’s Senior VP, Phil Schiller. Although later on the measurements were regarded as inconclusive after being examined by other Reddit users, HomePod did receive overwhelmingly positive comments on sound quality from reviewers. Personally, I’d like to see some scientific measurements and comparisons on HomePod against other high end speakers. Even if I decide to buy one, I still want to give it a listen myself if possible since sound quality can be subjective after all.

The bad

Now let’s put aside the Apple-colored glasses and check the HomePod from a “different” perspective. First, anyone who is considering getting a HomePod should know you’re buying into Apple’s ecosystem if you’re not already in it. Though it may simplify the setup procedures, keep in mind HomePod would only stream from your own iTunes library via AirPlay or Apple Music which is a paid subscription. No Spotify, Amazon Music or Audible.

What is more (worse?), HomePod doesn’t support Bluetooth either. So if you don’t have any device that supports AirPlay, HomePod is pretty much unusable. And a big NO-NO for me is that HomePod doesn’t have any wired audio inputs for more traditional devices like a turntable.

The least of my concerns on HomePod is the aspect of being a smart speaker. But this may very well be as important as sound quality to me to other potential buyers. If you have any experience with Amazon Echo’s Alexa or Google Home, you may find Siri on HomePod pretty basic. It can’t learn new skills and some features won’t be available if the paired iPhone is not nearby. So, don’t get your hope up.

And the ugly

Warning: HomePod ruins furnitures!

This is literally “ugly”. Multiple sources have reported that HomePod will leave a white ring on certain wood surfaces. Apple acknowledges this situation and suggests that the ring will fade or can be cleaned using “manufacturer’s suggested oiling method.”

Okay, whatever you say Apple.


You may already be able to guess that I won’t be getting the HomePod. Well, at least not now. I have a first generation Amazon Echo at home and recently bought a Echo Dot to use in a different room. None of them are particularly smart and Alexa still has problem differentiating my Philip Hue lights and scenes if they have similar names. For sound quality and usability I think traditional speakers and amp setup can still run rings around HomePod for same amount of money. Apple made some pretty impressive speakers and headphones before, so I have confidence in the future of HomePod. It’s just not for most people at the moment.

Kotlin: A Learning Process

By Xinye Ji

For those who aren’t in Android development circles, Kotlin has been on the rise since its beta release in 2011. At Google I/O 2017, Kotlin was announced to be officially support and adaptation of the language has soared in the last year. I recently decided pick up the language and hope to implement the upcoming features in our products with Kotlin.

Obviously, switching to a new language always has its hurdles. Syntactically, things always take a while before you get into a groove, but that’s always a part of the expected learning curve.

One of the main benefits of Kotlin over Java is that Kotlin seems to value making code a little more condensed. For developers who aren’t particularly fond of Java’s particularly verbose nature, I think this is a welcome change. There aren’t any massive paradigm shifts, but many smaller changes add up to a more streamlined development experience.

But aside from these mostly aesthetic changes, Kotlin takes many design cues from Joshua Bloch’s Effective Java. For me, this had some mixed results. Some of my lazier programming practices cropped up, resulting in me rethinking and revisiting my thought process when implementing some features in my sandbox app.

Thankfully because Kotlin is developed by the same company that produces Android Studio, a lot of these things are pointed out by the IDE itself. For example, my biggest lazy habit was not considering mutability. In Kotlin, one has to declare their variables as mutable or immutable with var or val respectively. If Android Studio, (or rather Intellij) detects that something you have declared is not changed after you’ve created it, it’ll flag that line and suggest you change the it to immutable. If I had to encapsulate a lot of Kotlin’s language design decisions, I’d say that it almost forces you to make better architectural decisions by employing an opt-out mentality, rather than an opt-in mentality.

Overall, I think this makes the learning curve more difficult, as it can produce unexpected behaviors if you haven’t read all the documentation surrounding certain features in Kotlin. But in the long run, I think this will lead to higher levels of productivity.

On a more personal note, I don’t think I have any particular preference towards Java or Kotlin yet. However, I’ve been working with mostly Java for the past few years, so there are still many things I’m still learning about Kotlin as I play around with it more. So one should consider that my familiarity with both languages are definitely not equal. In general, I’d say that (at the very least) trying Kotlin is a worthwhile endeavor for any native Android developer.

Apple Special Event 2017

Apple Special Event 2017: A New Hope?

By Peng Xie


(Originally written on Sep 19, 2017)

Last week, the Cupertino company opened the door of its new campus to guests with a special event led by a touching and inspiring tribute to Steve Jobs in the theater named after him. During the 2-hour keynote, CEO Tim Cook along with other familiar faces presented the world a fleet of next-gen Apple devices that immediately captured headlines of all major tech websites and publications regardless the leaks and speculations happened before the event. So, what does this special event mean for Apple and tech industry? And more importantly, what does it mean for us, the consumers?

In my opinion, this special event is the most important events for Apple in years. When Steve Jobs introduced the original iPhone and App Store, Apple virtually changed the whole smartphone industry and turned itself from a computer and music player manufacture into a leader in mobile devices, software and retail industries. Since then, even though there were still good yearly updates and new(ish) product releases from Apple, I felt a trend of slowing down…. until this year’s special event.

(I’ll be discussing the new products from the special event in the order of how I remembered them and how important I think they are, so pardon me if it is different from the order of how they were introduced.)

Apple Watch Series 3

Starting with Apple Watch Series 3, while mostly left unchanged in term of design, more powerful internals and the addition of LTE are definitely welcoming improvements. This is nothing new since there are already other Android Wear devices that have LTE capability. And given that the new Apple Watch’s LTE will only work in the country where it is purchased, I think Apple will continue to try to win over customers with the refinement of the Apple Watches instead of features. The thing that interests me most in the LTE Apple Watches is actually the internal SIM card. Apple is an active player in pushing new SIM card standard and has used similar technology in previous iPad models. I’d like to see Apple put this technology in future devices and make it another industrial standard just like what Apple did with micro and nano SIM cards in previous iPhone models. Telecom companies would welcome this feature since it can reduce cost of making SIM cards while give better control on devices activated on their networks. However, for consumers, an internal SIM card may not be preferred by some. Using a local SIM card while traveling will no longer be as easy as swap out SIM cards. To utilize the full benefit of an internal SIM card, phone manufactures and service providers should really come up with ways to streamline the activation experience for customers.

Apple TV 4K

Next one is Apple TV 4K. While the device itself is more like a catching up with other streaming devices to some people (Personally, I love tvOS and I think Apple TV has huge potentials.), the real exciting news is that Apple is making quality 4K contents more accessible than ever. Years ago, a format war between Blu-ray and HD-DVD backed by multiple big companies and studios like Sony and Warner Bros. made HD contents widely available to general publics. But today, even with the popularity of 4K TVs and YouTube videos, we rarely see 4K movies sold online or in stores. With Apple upgrading the movies in iTunes Store to 4K without raising the price, I believe other retailers and content providers will soon step up their games in 4K, which will in turn benefit consumers greatly with not only increased availability but (hopefully) also reduced cost of contents and devices.

iPhone 8 and iPhone X

Last but not the least are the iPhones. The same “magic” formula used in iPhone 6 is still being used in iPhone 8/8 Plus while Apple “revolutionized” the smartphone design with iPhone X. Funny enough the stunning glass back design on both iPhone 8 and the 10-year anniversary iPhone X is actually a throwback to iPhone 4 instead of the original iPhone. But this I think it is mostly due to the newly added wireless charging feature. The iPhones are using an older Qi standard so I don’t think there’s much to discuss on that. What’s most important to me is the heart of the new iPhones, the A11 Bionic chip. In an interview after the event, Apple’s marketing chief Phil Schiller said Apple started development of A11 chip 3 years ago when A8 chip was shipped with iPhone 6. The focus on graphics and neural networks processing in the design of A11 Bionic chip can give us a glimpse into Apple’s ambitions. Along with the introduction of ARKit and Core ML in iOS 11, Apple is obviously venturing into a future of augment reality and machine learning.

This is more or less a trend in the industry, but not all companies have the expertise across design, manufacturing and software development like Apple does. The Verge reported that the “notch” on iPhone X is as complex as a Microsoft Kinect. Packing all those components in an area that small is simply amazing. Paired with the powerful A11 chip, it will surely give iPhone X the ability to raise the bar for facial recognition technology. In addition, FaceID, AR and other processes will be great help in training Apple’s machine learning algorithm. A more intelligent device can significantly improve user experience with the help of Core ML framework.

Aside from all the praises, there are concerns over the brand new iPhone X. The “notch” design is not loved by all. The security of FaceID is yet to be tested by the public. And unsurprisingly there are privacy concerns regarding to the FaceID feature. To me, those are all valid concerns and healthy discussions. Not only Apple, but all manufactures and consumers should know what they’re dealing with and getting into. I’d like to see the big players like Apple, Google and Samsung work together to come up with an industrial standard to ensure the devices meet minimum security and privacy requirements.

Still a leader?

I believe the answer is positive. With a 50% sales growth, Apple replaced Rolex as the biggest watchmaker in the world. And the tech giant is now championing for a future of 4K contents. Even though iPhone 8/8 Plus mostly remain unchanged and iPhone X’s minimum bezel design is not a first in the industry, Apple will still be able to influence the design language for future smartphones. When we look back in a future of augment reality and devices with outstanding learning capabilities, I think we would all agree that this year’s Apple Special Event is as significant as the one where Steve Jobs introduced us to a legendary device called iPhone.

Here’s to the next 10 years!

WWDC 17: Why am I excited as a developer?

By Peng Xie

WWDC 17: Why am I excited as a developer?

It’s been a week since WWDC and I finally got time to write this blog post to express my excitement as an iOS developer. I won’t be talking about the keynote, since it’s pretty much the same every year. Instead, I’ll be focusing on the real deal, WWDC 2017 Platforms State of the Union.

For the non-iOS-developer readers, Platforms State of the Union is a session in WWDC that gives attendees a more technical overview of what’s coming to Apple’s platforms, as its name suggests. Just like previous years, Apple made some really big announcements to its developer community. Let’s see some of my personal favorites.

Xcode 9 Source Editor

As an iOS developer, I use Xcode everyday, which sometimes can be a pain. Xcode’s performance and features are not that strong comparing to some of the competitors. This year, Apple introduced one of the most welcoming changes to Xcode in my opinion – they have re-written the whole source editor from ground up in Swift! The result? 3x faster file opening seed, 60fps scrolling and up to 50x faster jump-to-line action. On top of that, they also implemented an integrated markdown editor, improved coding issue presentation and tokenized editing. What’s even better? A brand new refactoring engine and workflow that is powered by an open-source transformation engine. IntelliJ users may not be that impressed with these improvements. But to me, the all new source editor will give me a huge boost in productivity. I can’t wait for it to come out of beta… (Rule of thumb, don’t use beta Apple softwares on production development works.)

Swift 4

Not surprisingly Swift 4 will be there with Xcode 9. Apple has vastly improved one of the most widely used classes in Swift, String class. In Swift 4, String is now a range-replaceable bi-directional connection, meaning it behaves and can be used like an array of characters now without any sort of conversions. Thanks to the underlying improvements, String now provides 2.5x-3.5x faster processing depend on the language it’s in. Another welcoming news is the introduction of “codable” type. The new type will be synthesized by compiler and has the ability to perform 100% type-safe JSON encode/decode with only one line of code. Apple also made it easier to adopt Swift 4 in Xcode 9. The compiler now supports both Swift 3.2 and 4.0 and allows developer to mix-and-match 3.2 and 4.0 targets. All these improvements makes Xcode 40% faster building large mix-and-match Swift/Objective-C projects. Moreover, building projects using multiple Whole Module Optimization targets is now 2x faster!

iOS 11

One of the biggest announcements in WWDC 17 is iOS 11. For users, iOS 11 blurs the line between a desktop and a mobile OS, which will finally make iPad Pro a viable productivity tool. For developers, this means new APIs to play with. Starting with the new Drag-and-Drop feature, Apple did a phenomenal job making it easier to integrate in apps. It’s automatic for text and web content, and has delegate protocols for customization similar to other iOS APIs. With its cross-process, system-wide multi-touch support and built-in data security, I’m sure developers will start to provide this new feature in their apps to users as soon as iOS 11 becomes available.

Good news for everyone

Along with Xcode 9, Swift 4 and iOS 11, Apple also introduced CoreML for machine learning, Metal2 graphic engine and ARKit for virtual reality. These are only a few that caught my eyes. I am really excited to learn more about CoreML and hopefully can put it to use in one of our apps someday. I truly think Apple has given us developers really good tools and platforms to provide users best features and experiences. This is good news to developers as well as users. A better Apple will surely push its competitors to step up their game, which is something I really like to see. Whether or not you’re a developer or iOS/macOS user, you should be excited too. As consumers, we will always benefit from the competitions.

It’s the “Spirit of Cogent”!

By Ganpy

I am not sure why it took 9.5 years to publish this on this or any blog, but somehow there was this assumption that this was already shared.

This was written about 9.5 years ago. These words were also set to tune at that time and the song was released during our first Cogent Day celebrations held in Jan, 2008.

This anthem of sorts captures the essence of what defines the Spirit of Cogent.

It outlines how Cogenters strive towards quality in their work and highlights how Cogenters’ main competitors are themselves, as they try to outdo themselves every single time. Overall, this song brings out the 3C Principle that is at the center of Cogent.


Spirit of Cogent

Crackling sounds could distort one’s views
Our simple thoughts will fend off those noises
Instigating our desires
To outperform ourselves

Integrating all together
It’s the Spirit of Cogent!

Traveling borders and beaches
As a lantern for clarity
Working in bonhomie
Blooming creativity

Integrating all together
It’s the Spirit of Cogent!