The problem with a code is that while ATC may know you are testing. The a/c at FL100 with its TCAS active doesn't! You can generate T/A's and R/A's if testing below an active flightpath.
We used to do a quick check of mode A to ensure radiated efficiency then go straight into the box to check accuracy of the other coded information.