Logical methods for property testing in the bounded degree model