A friend had an interesting problem with his 2005 GM car. The symptom was this: the car died while driving and would not restart. He towed it to a shop where some repairs were made (fuel pump and filter replacement I think). This car does have over 100k miles on it. As he drove the car home it died again and would not restart. He brought the car home and scanned for DTC's. He got a P0101 which is a mass air flow (MAF) rationality fault.
At this point I need to provide some more details about how this fault works. You can find the GM diagnostics specs here: https://service.gm.com/gmspo/mode6/ This is a very helpful website since it described the diagnostics strategies. The way this DTC trips is a comparison between the MAF reading and a speed-density calculation done in the engine control which estimates MAF. When the MAF deviates too far from the speed-density model, the MAF signal is deemed bad, the DTC is set, and the engine control reverts to this speed-density model to control the engine.
When the DTC was cleared the car would run fine until the DTC tripped again. At that point, the engine would die and would not restart again until the P0101 was cleared again. Rationality DTC's like this are tricky to get right. The strategy did take a while to test and confirm the rationality fault before setting the DTC. If the MAF was disconnected, the engine would die and not restart.
With these symptoms I suspected the problem was actually with an input to the speed-density model and not a problem with the MAF. Further testing revealed that the manifold absolute pressure (MAP) reading showed 20kPa with the key ON, engine OFF. We are at about 600ft above sea level here. That reading should be around 100kPa. He checked the circuit for wiring issues and determined the MAP sensor had failed in range. Replacing the sensor corrected the problem.
While the DTC appeared to point to a MAF problem, the root cause was actually an in-range failure of the MAP sensor. This is a great example of how DTC's do not report root causes. They only report symptoms. Smart technicians need to take this info and determine root cause. It is NOT a matter of replacing the sensor the DTC relates to. You must have a good understanding of engine controls including the fact it has a speed-density model that is used for this rationality check and how that speed density model works.