Deriving upwinding, mass lumping and selective reduced integration by residual-free bubbles