tl;dr version if you don't want to wade through it - buy a new phone with more storage, more RAM and a faster CPU.
Checking all of internal memory in a modern Android phone (a walking bit test) would probably take almost forever to run. The "tests" done on SD cards don't really test the memory on the card, they test the card. (An SD card is a computer - with a controller [CPU] RAM and writable ROM. The tests don't walk every possible bit combination through the ROM, which is about the only really valid test, unless you have a problem that's repeatable enough to localize the problem all by itself.)
If you have a computer lying around that you seldom use, find a copy of memtest86 (memtest86.com is still an active site) and run it, if you want to see what I mean. Testing 512MB of fast RAM is a long process. Testing 32GB of slow storage ... it would probably be measured in seasons, not months.
Back up all your apps and data. Do a factory reset, start installing apps (make sure you leave at least 10% of your internal storage free) and see what happens. The problems you're describing are usually due to putting too many apps on a phone. Everything will probably work pretty well, until you store one more app - then you'll start noticing little problems. And the more you install, the worse the problems will get.
If you're going to ask how to "cure" the problem, you won't like the answer, but there's a reason carriers set 2 years as the time after which you could get a new phone. By that time, the apps have gotten larger and require faster phones to run well. IOW, we have to get new phones about every 2 years. It's not a plot by the manufacturers or the carriers. Five years ago, some apps we take for granted now weren't even dreams in the minds of devs. "A phone can't do that."
Fifty years from now you'll tell your phone to take you to your office, it'll remind you to bring an umbrella because it's going to be raining by the time you get there +/- 2 minutes, the phone will tell the car, it will also tell the car to change routes if there are reported delays ahead on the route it's taking ... 32GB of internal storage? Oh, you mean a phone from the turn of the century. No, this one has 50TB of storage, 5TB of RAM and a 64 core CPU. I opted for a cheap phone because I really don't need a 512 core CPU and 3PB of storage.
Moore's law - the number of transistors in a CPU doubles every 6 months. (I think the period has shortened a little.) That's 16 times in 2 years. 16 times the power. (Not 16 times the speed. The reason for multicore CPUs is that the laws of physics don't allow an electron to travel faster than light through a channel smaller than its wave size.) If we actually get quantum computers? And they make them small and low-power enough to put into cellphones? The cheapest (think $39.95 today) cellphone will have far more capabilities and power than the best Xeon server of today. That $39 phone is far more powerful than the first network server I administered only 20 years ago. Far more memory and storage too. And for $39 you could just about buy the nameplate on the server.
So the real answer to your problem is buy a better phone. Every 2 or 3 years. That's how fast the technology is changing. You're trying to get your car to go faster by whipping it on the fender with a buggy whip.
Reality? People put up with 4 and 5 year old phones. Corporate users, who can afford the latest phone out, use the phone for email, voice and texting. And occasionally social networking. Almost any phone will do that. A large part of the customer base is kids (I'm including up to those in college). Same thing. Text and social networking.
Those of us who want a laptop in our pockets just have to spend the bucks. If you buy the top of the line, maximum storage, very fast multicore CPU phone, it'll last longer. But eventually the M8 will be an old useless antique too.