In this paper, we introduced the concept of $f$-derivation which is a generalization of derivation in subtraction algebra, and some related properties are investigated.