Tuesday, April 18, 2017

Ask the UXperts: Meaningful Animation – Getting it Right — with Val Head

Animation on the web can be a contentious subject. Some people hate it. Val Head loves it – and she gets it right.

So what exactly does ‘getting it right’ mean? How do you make decisions around when to use animation in your work? How do you narrow down what animations to use, and what are the possible ramifications of getting it wrong?

Val believes that well designed motion can positively impact UX when the animations have both purpose and style. It can help users maintain an accurate mental model of an interface by connecting spatial relationships and different contexts of the content. It can help guide users through a specific task or flow and can give more meaningful feedback and show causality during complex tasks.

In this session, Val will talk about how animation in our work can be meaningful and functional—when we find the right circumstances.

The Details

Meet Val Head

Val HeadVal is a web animation expert and author with a talent for getting designers and developers alike excited about the power of animation. She is the author of Designing Interface Animation on Rosenfeld Media and teaches CSS Animation on lynda.com.

Val curates the UI Animation Newsletter, co-hosts the Motion and Meaning podcast, and leads web animation workshops at companies and conferences around the world.

How to Ask Your Questions

If you can’t make the live session but have questions, we’d love to collect them ahead of time and we’ll ask Val on your behalf. You can ask them in the comments below. We’ll publish the responses (along with the full transcript) in the days following the session.

Here are a few questions to get you started:

  1. What are some ways that well designed motion can positively impact UX?
  2. What are the possible ramifications of getting it wrong?
  3. Can you share some examples of meaningful animation in action?

How does Ask the UXperts work?

These sessions run for approximately an hour and best of all, they don’t cost a cent. We use a dedicated public Slack channel. That means that there is no audio or video, but a full transcript will be posted up on here in the days following the session.

The post Ask the UXperts: Meaningful Animation – Getting it Right — with Val Head appeared first on UX Mastery.


by Sarah Hawk via UX Mastery

6 Insights for Designing Accessible Mobile Apps

Mobile apps are for everyone – and they’re not about the digital world, but the real world around us. In 2017, it’s estimated that around 1 billion people around the world have some form of disability, while 285 million people are visually impaired worldwide.

As societies age, accessibility continues to be an important part of the global conversation about digital inclusiveness. Yet it’s in the everyday work of designers and developers where the true magic happens.

Drawing insights from a new report on Mobile Apps Accessibility, here’s how designers can keep all users in mind when designing mobile apps.

You can’t guess what it’s like to be blind

As designers, we know we shouldn’t make assumptions, guess or think of ourselves as potential users. This is precisely why we need to convince our clients that user testing is vital. In the case of blind users, we have to be fully aware how different their perception of space is, what patterns they use, what’s important for them and how to help them understand the application. There’s no way other than organising workshops, user testing and consulting them directly to find out.

Keep it short

For blind people, every action takes more time. This means they pay more attention to even minor copywriting details if words are too long. As designers, we should remember to keep information architecture as compact and straightforward as possible the enable scanning through the app.

Don’t forget that users have to remember

Understanding the content of an application through sound only can be overwhelming. Blind users have to remember features and information gathered while they listen, or they have to listen again from the beginning.

The simpler and more intuitive the application is, the better. We need to do our best to bring out the core features and avoid information overload. Keeping it all simple and clear makes a big difference.

Stick to the patterns

The perception of a screen that’s just a sequence of words is different from a screen with a visual hierarchy. Sticking to patterns makes the information architecture more legible.

For example, we shouldn’t interfere with the default behaviour of VoiceOver, a popular screen reader. When a user goes deeper into the structure of an app, from one screen to another, the focus should be set to a “Back” or “Close” button. This way they know how to navigate through the app.

Guide blind users as you would guide a blind person in the real world

As in the real world, we have to predict what happens when a blind person is on their own. The good news is that in both Android and iOS, you can control the order in which users gets specific information. By grouping elements or forcing the focus of a screen reader on an error message, for example, we can make sure that the user is aware of some kind of “failure”.

Working on accessibility can enhance the overall user experience

While working on an accessible application, you may suddenly realise that user experience becomes clearer as your reduce and prioritise elements. That only proves that the general rules of information architecture are universal, regardless of the senses we use. Making some UI elements more visible for users suffering from partial visual impairments enhances the overall readability of the app.

Find more tips on designing accessible mobile apps in Polidea’s Accessibility in Mobile Apps Report, which draws on the collective effort of Polidea’s designers and developers.

The post 6 Insights for Designing Accessible Mobile Apps appeared first on UX Mastery.


by Agnieszka Czyżak via UX Mastery

Key Takeaways from the Stack Overflow 2017 Developer Survey

The Usual Caveats Forty million people visit Stack Overflow every month, and an estimated 42% are professional developers or university students. The survey is detailed and was completed by more than 64,000 respondents (51,392 were usable). It’s an impressive sample size, but be wary about making assumptions when demanding your next pay rise! … Worldwide […]

Continue reading %Key Takeaways from the Stack Overflow 2017 Developer Survey%


by Craig Buckler via SitePoint

JavaScript Testing Tool Showdown: Sinon.js vs testdouble.js

When unit testing real-world code, there are many situations that make tests hard to write. How do you check if a function was called? How do you test an Ajax call? Or code using setTimeout? That's when you use test doubles — replacement code that makes hard to test things easy to test.

For many years, Sinon.js has been the de-facto standard in JavaScript tests for creating test doubles. It's a must-have tool for any JavaScript developer writing tests, as without it, writing tests for real applications would be nigh impossible.

Recently, a new library, aptly named testdouble.js, has been making waves. It boasts a similar feature set as Sinon.js, with a few differences here and there.

In this article, we'll look into what both Sinon.js and testdouble.js offer, and compare their respective pros and cons. Will Sinon.js remain the superior choice, or will the challenger take the prize?

Note: If you're unfamiliar with test doubles, I recommend reading my Sinon.js tutorial first. It will help you better understand the concepts we'll be talking about here.

Terminology Used in This Article

To ensure it's easy to understand what is being discussed, here's a quick overview of the terminology used. These are the definitions for Sinon.js, and they can be slightly different elsewhere.

  • A test double is a replacement for a function used during a test. It can refer to any of the three types mentioned below.
  • A spy is a test double which allows the checking of effects without affecting the behavior of the target function.
  • A stub is a test double which replaces the target function's behavior with something else, such as returning a value.
  • A mock is a different approach to stubs. Mocks contain built-in verification and can be used instead of a separate assertion.

It should be noted that one of the goals of testdouble.js is to reduce the confusion between this type of terminology.

Sinon.js and testdouble.js at a Glance

Let's begin with a look at how Sinon.js and testdouble.js compare in basic usage.

Sinon has three separate concepts for test doubles: Spies, stubs and mocks. The idea is that each represents a different usage scenario. This makes the library more familiar to those coming from other languages or who have read books using the same terminology, such as xUnit Test Patterns. But the other side is that these three concepts can also make Sinon more difficult to understand when first using it.

Here is a basic example of Sinon usage:

//Here's how we can see a function call's parameters:
var spy = sinon.spy(Math, 'abs');

Math.abs(-10);

console.log(spy.firstCall.args); //output: [ -10 ]
spy.restore();

//Here's how we can control what a function does:
var stub = sinon.stub(document, 'createElement');
stub.returns('not an html element');

var x = document.createElement('div');

console.log(x); //output: 'not an html element'
stub.restore();

In contrast, testdouble.js opts for an API which is more straightforward. Instead of using concepts like spies or stubs, it uses language much more familiar to JavaScript developers, such as td.function, td.object and td.replace. This makes testdouble potentially easier to pick up, and better suited to certain tasks. But on the other hand, some more advanced uses may not be possible at all (which is sometimes intentional).

Here's what testdouble.js looks in use:

//Here's how we can see a function call's parameters:
var abs = td.replace(Math, 'abs');

Math.abs(-10);

var explanation = td.explain(abs);
console.log(explanation.calls[0].args); //output: [ -10 ]

//Here's how we can control what a function does:
var createElement = td.replace(document, 'createElement');
td.when(createElement(td.matchers.anything())).thenReturn('not an html element');

var x = document.createElement('div');
console.log(x); //output: 'not an html element'

//testdouble resets all testdoubles with one call, no need for separate cleanup
td.reset();

The language used by testdouble is more straightforward. We "replace" a function instead of "stubbing" it. We ask testdouble to "explain" a function to get information from it. Other than this, so far it's fairly similar to Sinon.

This also extends to creating "anonymous" test doubles:

var x = sinon.stub();

vs.

var x = td.function();

Sinon's spies and stubs have properties which offer more information about them. For example, Sinon provides properties such as stub.callCount, and stub.args. In testdouble's case, we get this information from td.explain:

//we can give a name to our test doubles as well
var x = td.function('hello');

x('foo', 'bar');

td.explain(x);
console.log(x);
/* Output:
{
  name: 'hello',
  callCount: 1,
  calls: [ { args: ['foo', 'bar'], context: undefined } ],
  description: 'This test double `hello` has 0 stubbings and 1 invocations.\n\nInvocations:\n  - called with `("foo", "bar")`.',
  isTestDouble: true
}
*/

One of the bigger differences relates to how you set up your stubs and verifications. With Sinon, you chain commands after a stub, and use an assertion to verify the result. testdouble.js simply has you show it how you want the function to be called — or how to "rehearse" the function call.

var x = sinon.stub();
x.withArgs('hello', 'world').returns(true);

var y = sinon.stub();
sinon.assert.calledWith(y, 'foo', 'bar');

vs.

var x = td.function();
td.when(x('hello', 'world')).thenReturn(true);

var y = td.function();
td.verify(y('foo', 'bar'));

This can make testdouble's API easier to understand, since you don't need to know what operations you can chain and when.

Comparing Common Testing Tasks in More Detail

On a high level both libraries are reasonably similar. But what about common testing tasks that you might need to do in a real project? Let's take a look at a few cases where the differences start to show.

Continue reading %JavaScript Testing Tool Showdown: Sinon.js vs testdouble.js%


by Jani Hartikainen via SitePoint

Killer way to Show a List of Items in Android Collection Widget

In the earlier versions of Android, app widgets could only display views like TextView, ImageView etc. But what if we want to show a list of items in our widget? For example, showing the list of temperature information for the whole next week. Collection widgets were introduced in Android 3.0 to provide this additional benefit. Collection widgets support ListView, GridView and StackView layouts.

Today, I am going to help you understand how the collection widget works. We are going to build an app widget for a Todo app. Collection widgets will be used to display the list of pending tasks.

Continue reading %Killer way to Show a List of Items in Android Collection Widget%


by Gagandeep Singh via SitePoint

Getting to Know and Love Xdebug

It's been 15 years since Xdebug first came out. We think this is the perfect opportunity to re-introduce it to the world, and explain how and why it does what it does.

Xdebug alternative logo

Xdebug is a PHP extension (meaning it needs to be compiled and installed into a PHP installation) which provides the developer with some features for debugging. Those include:

  • stack traces - detailed output of the path the application took to reach a given error, including parameters passed to functions, in order to easily track the error down.
  • a prettier var_dump output which produces color coded information and structured views, similar to VarDumper, along with a a super-globals dumper
  • a profiler for finding out where the bottlenecks in your code are, and the ability to visualize those performance graphs in external tools. What this results in is a graph similar to that which Blackfire produces.
  • a remote debugger which can be used to remotely connect Xdebug with running code and an end-client like an IDE or a browser to step through breakpoints in code and execute line by line of your application.
  • code coverage which tells you how much of your code was executed during a request. This is almost exclusively meant to help with unit tests and finding our how much of your code is test-covered.

How do I use it?

Xdebug comes with a detailed installation page which handles most if not all use cases, but if you'd like to play with the functionality presented below, we recommend using Homestead Improved which comes with the extension pre-installed and activated.

With modern IDEs and Blackfire, is there even a need for Xdebug?

IDEs do provide good code lookup functionality, so the link format functionality's usefulness can seem questionable. There's also loggers of all kinds now which can handle errors and exceptions. Likewise, function traces and profiling are done really well in Blackfire. However, file link formats are just one part of Xdebug, and using Blackfire has its own hurdles - installing the extension, setting up the keys, and then paying to keep trace history. Loggers also need to be used with a lot of foresight, and aren't very easy to add into an application later on.

There's more to Xdebug than just this, though - it's still required for proper unit testing (testing frameworks depend on it for code coverage reports), it's far from easy to get remote break-point debugging going via other means, and it's a tool so old and stable it's been ironed out to near perfection.

If your current tools can handle everything it offers or you don't need the features it offers then of course, there's no need for Xdebug, but I've yet to start a single project that could be completed just as efficiently without it.

Let's Try It Out

I'll assume you have a working Xdebug installation at this point. If not, please consider using Homestead Improved.

Let's make a new project folder with a simple index.php file, and echo out a non-existent variable like $foo:

<?php

echo $foo;

This is what we get:

Xdebug styled error

Turning Xdebug Off

Screens like these are so ubiquitous these days, and such a common default, that most people don't even realize this is already Xdebug-styled. To prove it, let's see how it looks without Xdebug. To disable Xdebug, we edit the file /etc/php/7.1/fpm/conf.d/20-xdebug.ini in Homestead Improved, and comment out the first line:

;zend_extension=xdebug.so
xdebug.remote_enable = 1
xdebug.remote_connect_back = 1
xdebug.remote_port = 9000
xdebug.max_nesting_level = 512

We need to restart PHP-FPM afterwards:

sudo service php7.1-fpm restart

Continue reading %Getting to Know and Love Xdebug%


by Bruno Skvorc via SitePoint

Appify

Appify

'Appify' is a smart Landing Page WordPress theme perfect for announcing your next app. Features include big intro image, parallax scrolling, neat feature infographic surrounding a device, video how-it-works section, client testimonial slider, statistics, pricing table, team, newsletter sign up box and of course a download link section.

by Rob Hope via One Page Love