Those who have pushed emissions testing forward tend to be mavericks, like Leo Breton.

While working as an engineer at the Environmental Protection Agency in 1995, Mr. Breton cobbled together a prototype for a portable emissions measurement system. Because he had no official budget for the project, he borrowed parts he needed or adapted them from equipment in E.P.A. labs.

Image Dan Carder, director of the Center for Alternative Fuels Engines and Emissions, in the center’s Vehicle and Engine Testing Laboratory in Morgantown, W.Va. Credit... Tom M. Johnson for The New York Times

The work helped expose cheating cases and also led to several patents that the agency licensed to equipment manufacturers. Mr. Carder calls Mr. Breton the “grandfather” of mobile emissions testing. West Virginia researchers built on his work when testing highway emissions for trucks in 1999.

Despite such successes, the E.P.A. and other regulators have continued to rely on laboratory tests to check auto emissions. Volkswagen took advantage of that practice, programming its diesel vehicles to increase their control of pollution when the engine software detected that the car was running on rollers in a lab.

Otherwise, emissions equipment in Volkswagen diesels was deployed sparingly to protect components or save fuel. Volkswagen has admitted in court documents that it never expected anyone to test its cars on the road, where the illegal software would not work.

Part of the difficulty is that measuring the emissions of a moving vehicle is a significant engineering challenge.

Mr. Carder and his team drew on their experience testing trucks when they got the contract to test cars in 2013. One challenge was to fit what amounts to a mobile laboratory in the car. At the time, the equipment available for such emissions testing had enough battery power only for short trips.