As a teacher, I 100% agree with this. It's easy to have false positives and negatives though, so should never be used as more than in evidence building. Students can get nervous when put on the spot and some are smooth talkers. But it is a good start.
> but it's not easy to do anything about it.
This is actually prolific and a problem. I caught two students cheating once and their excuse was "I didn't know GitHub was on the internet." This was a junior level course... and the professor's focus was on networking... (he put in the syllabus that you can't use the internet for help. Let's put personal opinions aside (I wasn't checking them against SO fwiw)). The other student couldn't speak a lick on English. Yet, our department didn't want us to do anything about it. Despite being about as clear cut of a case as you can get, they even admitted it. In my other post I mention Goodhart's Hell. The reason the department didn't want to do anything is because the university evaluates a department's level of cheating by the number of reports that they make. So obviously, no one fucking reports it.
But besides this, I think we have to ask why students cheat in the first place. It's because despite GPA not having meaningful outcome [0], they are critical for students so get into grad school or get their first job. No one knows that you took the hard professor, learned twice as much, but barely got a C which would easily be an A in the other course. So of course they cheat. I design my class around this actually. I make it easy to get a good grade on purpose, but get students to work. To do projects, explore, and be creative. If I don't, they just cheat and that undoes any benefit from a hard and challenging homework. I let them know too. But I also am purposefully late to return grades, which makes them sweat. It might sound dumb, but you got to adapt to the environment. My goal is to make students learn. I can't make someone choose to learn, and I don't bother with students that are checked out. But I do make my class engaging and highly encourage creativity, and I've found that a lot of students that previously were checked out end up checking in (I give often give them opportunities to make up their slack, but require more from them). And the students that do work hard, they have good projects in their portfolios which I've seen them use to get hired. Its dumb, but it is the only way I've found to re-align the a class with the intended goals: to teach students.
[0] https://web.archive.org/web/20230107050342/https://www.nytim...