We present a (randomized) test for monotonicity of Boolean functions. Namely, given the ability to query an unknown function f : (0,1)n → (0,1) at arguments of its choice, the test always accepts a monotone f, and rejects f with high probability if it is ∈-far from being monotone (i.e., every monotone function differs from f on more than an ∈ fraction of the domain). The complexity of the test is O(n/∈). The analysis of our algorithm relates two natural combinatorial quantities that can be measured with respect to a Boolean function; one being global to the function and the other being local to it. A key ingredient is the use of a switching (or sorting) operator on functions.