Instead of returning an intint, return a value object that has the validation hard-coded. This is a case of primitive obsession and it'sits fix.
// should be class, not struct as struct can be created without calling a constructor public class ValidNumber { public int Number { get; } public ValidNumber(int number) { if (number <= 5) throw new ArgumentOutOfRangeException("Number must be greater than 5.") Number = number; } } public class Implementation : ISomeInterface { public ValidNumber SomeMethod(string a) { return new ValidNumber(int.Parse(a)); } } This way, the validation error would happen inside the implementation, so it should show up when developer tests this implementation. And havingHaving the method return a specific object, makes it obvious that there might be more to it than just returning a plain value.