There are two ways designers and developers can ensure that software is a joy to use.
User interviews. While user interviews play an important role, we can't always accurately predict our behaviour: We don't act consciously when it comes to reflexive behaviors.
Behavioural design can gather insights into human behavior for all users. Developers can take advantage of behaviour patterns to create software experiences that drive increased usage.