Last month in the Sinergija conference, I was presenting a topic on Windows Runtime applications. The presentation was about providing the users with quality applications. I wanted to put it to words and create a post. So here are some pointers from my presentation.
What makes an application “good”?
All of us, developers, indie or corporate, are after creating “good” applications either to prove ourselves, or to satisfy our clients needs with quality. We cannot deny that the common denominator for both purposes are the users of the applications and what they think about our applications.
According to most surveys with mobile users the most common reasons why a user complains about an application goes as follows:
- App Freezes
- Slow Responsiveness
- Heavy Battery Usage
As one can see, we can easily put these complaints in well-defined categories. App freezes and crashes can be defined as stability issues. Slow responsiveness goes with the fast and fluid ideology of windows platform. And finally heavy battery usage can be categorized as an efficiency issue. These categories we defined, more or less tell us what we have to be after while developing our applications.
However, as a windows platform developer, I feel quite lucky. Since visual studio and other tools that are provided for us to use in the pipeline are at my disposal.
Visual Studio Tooling
The foremost helpful tool comes from the visual studio. The visual studio analysis tools are designed to address these pillars we defined.
|XAML UI Responsiveness||:||Fast & Fluid|
|CPU Sampling||:||Fast & fluid|
UI Responsiveness Analysis creates a very in-depth analysis dashboard, completely related to the UI elements in the current view of your application. Each element in the XAML page is analyzed separately, together with the UI thread utilization in the background which gives the developer solid quantified results on the UI of their application. The thread utilization is categorized on Parsing, Layout, App Code and other XAML activities.
For the general CPU utilization, we can use the CPU usage analysis reports. On this report, the functional stack is charted against the CPU utilization during user defined execution scenarios. By this way, one can easily pinpoint problematic for-loops or blocking async calls.
However, none of these analyses help us directly identify stability issues. You have to employ different methodologies to solve stability problems.
Store telemetry can always be your pal identifying forgotten exception handling blocks or possible transient errors. Windows does collect usage information on windows store applications and each published application does have an exception stack reported to the store. I am not saying the reports can tell you exactly where the problem is but they can point you to the right direction. These crash reports are available in the store dashboard and can give either very generic error messages or more helpful stacks depending on the scenario.
Analysis dashboards and the store are generally the final steps of developing and publishing a store application. Until we reach those steps we have quite a number of lines of defense against bugs produced which counts for the stability pillar of windows platform development.
Unit testing has always been a disturbance in the creative way the developer’s mind works. (?) However, as a developer, in some scenarios, I do think the unit testing and TDD (Test Driven Development) can really make the things go faster. The code written in unit tests can slowly be moved to the actual application implementation and refactored to fit with the pattern that is used throughout the app. When you come short with the testing platforms, you can always make use of the mocking frameworks available for windows runtime applications.
On top of the developer friendly unit tests, XAML developers can make use of the Coded UI tests. Coded UI tests can easily act as integration tests and can make up another line of defense in our development pipeline.
Finally, the windows platform applications have to be put through the ack validation. The certification kit testing just makes sure that the application is ready to be submitted to the store. If you are not a fan of executing these tests through the command line or with additional tooling, you can easily create a build step or a target activity on TFS builds. This can really effect the efficiency of your development pipeline.
The last part of the presentation was about various logging scenarios. But this topic is a bit broad and deserves a whole another blog post.
Hope it helps anyone out there,
Happy coding everyone,