"thinking man's turbo controller/cheat controller"
As nobody likes pressing switches to test a board when you have 20000 of the things then most controllers have test pads or other points you can put a signal into and thus test inputs. Hackers and people that make all those auto reload and game specific controller mods then also use these to input signals of their choosing. Turbo is just that and you input as many pulses as you need*, something with a bit more timing then takes an extra device to pull it off. If your chosen device lacks these pads you get to find somewhere else to solder to. Here is a website that covers a whole bunch of them for different systems
http://www.slagcoin.com/joystick/pcb_wiring.html
There are other interesting things you can do with this like split controllers and have two people operate one game, make foot pedals, for handhelds you can give them external controllers, if you need to sort something to help work around a disability you can do that, you can take the output of one game controller and feed it into another (an expensive way of making a controller adapter perhaps but it will work) and much more besides.
*modern game companies don't like this so you might want to mix it up and make it look slightly human rather than precise 200ms pulses every time if you fear getting banned.
Microcontrollers then. These are little chips you can program to do your bidding (send pulses, do maths, do logic on things like if this leg is high and so is this then do this). If you have ever heard of an arduino (
https://www.arduino.cc/ ) then that is a higher level one of them. As part of the basic introduction you will get it to send a signal to an onboard LED which in reality is just a leg on the chip, step two will be get it to light or flash a pattern when a button is pressed. For this controller testing you want it to output a signal when a button is pressed (or regularly as it does not really matter in the end)... it is that easy. In doing this you eliminate the guesswork of when the button hit bottom, if the button is sticky or if the switch bounced a bit, all of which help make the button and screen in frame tests less useful than they might be.
You wire up the scope probe to the output of your arduino so when the pulse happens it triggers capture on the scope. You need some means to tell when something has happened on the screen and this is probably the harder part. This second part will have another probe on it so you can measure the time delay.
Were I doing it with what I know I would probably change the sprite and use some kind of optical detector, I might also change the sprite in the game to be a black square, or I might change the whole screen to be black or something (or maybe all pink and get a pink filter). Sounds hard but have you ever wondered how duck hunt works, and also why shooting a lamp tricks it? There are any number of light dependent things you can use to take signals in, earlier today I watched a video in which someone took apart a air freshener that detects movement and it looked like that was something that did that. You might not need to mod games either if you can pick a suitable test (good contrast, obvious that something is happening and so forth).
As a halfway house and still quite useful you could find a quick light LED or something and trigger that at the same time as you fire the input pulse. With a camera on the screen and seeing the LED light you can get better timings than simply using a normal button.
If you want to do something fancy then you can also put a signal into the controller and tell how long it takes to spit something out the other side. On the face of it I would agree it is purely for the cool, however it would also allow you to tell what component of the lag is attributable to the controller and what the emulator/hardware and screen setup might contribute. If it is posing a problem (and there are all sorts of ways of checking inputs) don't get too hung up on it.
For a screen test then there are fancy devices that fancy screen testing sites use, I would say they are expensive but they even more than that. Most of us though just get a CRT screen (they are not without lag but it is so low that most consider it as good as it gets, not to mention one of the reasons many light gun games do not work on modern screens) and a LCD screen and wire them up to the same graphics card to display the same thing. You then film it as it goes through a (fast) sequence like counting up through numbers and then you can literally read off the lag by picking any frame once the test has started.