Linearity testing