Trifork Blog

Category ‘Mobile’

Measure the Adequacy of Android Unit Tests with Mutation Testing

September 7th, 2016 by
(http://blog.trifork.com/2016/09/07/adequacy-of-android-unit-tests/)

Unit tests are an essential tool in a trustworthy test suite for an Android application or any other software system for that matter. But unit tests themselves doesn’t guarantee that the right features or requirements are tested, even if you did a thorough effort to cover as much code as possible in your entire code base with them. It only proves that the system is actually tested, but says nothing about the quality of the tests. Mutation tests can help with this issue, by measuring the quality of your unit tests by manipulating your code under test. Mutation tests can be seen as the tests of your unit tests.

So, what Exactly is Mutation Testing?

In a nutshell mutation testing is a mechanism to inject different kinds of errors (mutants) into your code base while running your tests. A mutant could be changing a simple conditional in your Java code from == to !=. Generally, mutants try to simulate common programming errors like accidentally inverting an if statement, returning null instead of a real object, etc.
If your test covering the piece of code where this mutant was injected still passes, then the mutant survived. If on the other hand the test fails, then the mutant was killed. As you might already have guessed, the terminology in mutation testing is somehow opposite of normal test results, as killed mutants is a good thing, while surviving mutants is a bad thing, since they indicate, that we didn’t write our test well enough.

Read the rest of this entry »

Recognizing commercials using the Alphonso API

September 21st, 2015 by
(http://blog.trifork.com/2015/09/21/recognizing-commercials-using-the-alphonso-api-2/)

Liberty Global organized the Hack & Play Appathon in Ziggo dome on September 15th and 16th. More than 20 teams of hackers, designers and programmers were invited to create an app or a game for the Liberty Global product Horizon set-top box. Team Trifork joined with Dennis de Goede (Design & Frontend), Tony Abidi (Devops) and myself (Front & Backend).

Alphonso added another challenge to the appathon: Create the best integration with the Alphonso platform. Integration challenge? Sounds like a Trifork challenge to me.

FirstPrice

 

Read the rest of this entry »

WWDC 2015: Auto Layout improvements

June 22nd, 2015 by
(http://blog.trifork.com/2015/06/22/wwdc-2015-auto-layout-improvements/)

mysteries-of-auto-layout
Last weekend I arrived home safe and sound, already missing San Francisco. I had a wonderful time there and I have lots to talk about, but there was one topic in particular I think was not highlighted enough. That’s why I want to discuss it here. It was discussed in the following talks during WWDC:

Mysteries of Auto Layout – part 1
Mysteries of Auto Layout – part 2

I am a big fan of auto layout since it was introduced in iOS 6 and especially by using it directly in code, not by using Storyboard. But when using it in code it can get really verbose. I wrote some classes around that to make the resulting code much more compact. I wasn’t happy with my solution. So I was planning to go to a Lab during WWDC, to ask an actual Apple auto-layout engineer for his opinion about this matter. But it turned out I didn’t have to! Apple solved most of the problems I was having with Auto Layout with new API’s in iOS 9! In this blog I want to highlight those new API’s which make it easier to work with Auto Layout both in code and in Storyboard!
Read the rest of this entry »

WWDC Day 1 continued

June 11th, 2015 by
(http://blog.trifork.com/2015/06/11/wwdc-day-1-continued/)

IMG_1832
Hello again from San Francisco! I just came back from the conference after attending it for the third day in a row! I have seen many interesting talks so far ranging from Swift to WatchKit and UI design. There is so much to talk about, but in my previous blog entry I could only cover the keynote of the first day. Otherwise it would have been way longer! So let’s continue where I left off …
Read the rest of this entry »

iOS perspective on mobile development with Xamarin

June 4th, 2015 by
(http://blog.trifork.com/2015/06/04/ios-perspective-on-mobile-development-with-xamarin/)

One of the fundamental mantras of software development is DRY – “Don’t repeat yourself”. It’s an important rule, because it allows us to save both space and time. Instead of rewriting a non-trivial algorithm, we use a method call, instead of correcting bugs in multiple places, we do it only in one. Would you ever not follow DRY? Well… yes, when you need to develop a mobile app. If your plan is to get as many customers as possible, releasing an iOS and Android version is a must. This means maintaining two very similar codebases. Can we do better? The answer is yes and it’s called Xamarin. It’s the platform we’re using for some of our newest projects here at Trifork, and we would like to share with you our experiences, likes and dislikes. Read on if you’re not afraid to abandon Xcode and Objective C.

Read the rest of this entry »

RUNNING CUSTOM “LINT” CHECKS ON YOUR ANDROID BUILDS

April 13th, 2015 by
(http://blog.trifork.com/2015/04/13/running-custom-lint-checks-on-your-android-builds/)

In this post, I’ll share a very simple tip on how to add very simple custom checks of your Android source code to your Jenkins build server, but the tip should be very easily ported to other build servers too.

What?
Most developers know of Lint checks as something which perform some kind of static analysis of their code and which complain heavily about stuff if you are enabling this check for the first time on an old project. Unfortunately, chances are rather high that you choose to disable the check due to time constraints not allowing you to fix all issues right now. Or maybe you actually enable running the checks as part of your build but choose not to make lint errors break it. Those two solutions are equally bad since none of them prevent you from adding bad code to the codebase.

Why?
I won’t go to great lengths to explain why you should perform lint checks, but I’ll say that there are many, many simple checks which can be checked at compile-time and which you (or your colleagues) might not have noticed when implementing a given feature. And why not let the lint tool weed out the stupid errors since it is so much better at detecting these things than you? For example, lint checks can prevent you from publishing an app which crashes on some devices due to code calling APIs, which are not available on devices with too low versions of Android running on them. Lint will compare the minimum API version supported by your app and the API version of every call performed in your app so you can ensure that you have carefully guarded these calls correctly and therefore won’t crash your app at run-time.

Read the rest of this entry »

Basic Android UI performance

February 23rd, 2015 by
(http://blog.trifork.com/2015/02/23/basic-android-ui-performance/)

The base of every good app is performance. No user is willing to use an app with subpar performance, especially not with the amount of apps on the Play Store and thereby possible alternatives. In this post, we will take a look at some of the basics of Android UI performance and some of the pitfalls.

Layout Hierarchies

All Android UI are based on XML files describing the desired design. Developers are easily carried away by nesting several instances of different elements like <LinearLayout> or <RelativeLayout> to solve a layout puzzle. This can be a potential performance problem, since each elements require initialization, layout and drawing. We are talking milliseconds here, but with several layouts on-screen using, for example a <ListView>, these milliseconds get multiplied and noticeable delay could occur. Read the rest of this entry »

Trifork NewsBites – July 2014

July 25th, 2014 by
(http://blog.trifork.com/2014/07/25/trifork-newsbites-july-2014/)

Trifork Logo

Dear reader,

The international software development conference GOTO, designed for software developers, IT architects and project managers was back on June 18th-20th at the Beurs van Berlage, Amsterdam. Trifork, GOTO Academy and Axon had each a stand there. 

On June 26th-27th Allard Buijze gave a training on the Axon framework. On July 10th we held a Docker MeetUp in our Trifork office in Amsterdam. Below we relate these events and provide further information about upcoming trainings and more.

Read the rest of this entry »

Linking apps together with App Links

June 3rd, 2014 by
(http://blog.trifork.com/2014/06/03/linking-apps-together-with-app-links/)

When developing apps for mobile phones you want to offer your users the best user experience. Sometimes this includes showing information outside of your app, in another app. Up until recently, there was no real good way to do this. Luckily, now there is a new initiative App Links that provides an open source and cross-platform solution for app-to-app linking. The initiative is supported by many mobile app developers, like Dropbox, Facebook, Spotify and Pinterest. In this post I will show you an example how to link between two Android applications using the open source implementation for Android Bolts. However, the same principles apply when you want to link between two iOS applications.

Read the rest of this entry »

Brightcenter, the multi-user classroom solution for educative app(lication)s

May 15th, 2014 by
(http://blog.trifork.com/2014/05/15/brightcenter-the-multi-user-classroom-solution-for-educative-applications/)

Tablets inside the classroom

brightcenter_logo_xl

For years now, PC/Desktops have been present in the classroom providing children and students digital learning environments. These learning environments are helping the teachers by providing interactive learning aids where children and students can independently work and learn. In primary schools, classrooms are filled with just a couple of PCs in order to allow children to learn how to use a computer. Many of these PCs include special software written specifically for kids, where they can learn to practice basic mathematics, writing, language, etc. Most of the time these PCs are not even connected to the Internet, because of the nature of the applications and run on local machines. Read the rest of this entry »