To what extent do academics who do programming for academic research use standard software engineering practices, such as documentation and unit testing, to maintain their code?
It is quite rare to find such standards used for research prototypes. The overhead of doing that is just too high in terms of time. In a typical company, the responsibility split, e.g., Valeo has a whole unit to do unit tests, and the cost of spending a couple of extra man-hours to make sure that the product works is very important. For academics, they usually start a project, investigate something, build a prototype, publish a paper and forget about it. I have codes from universities around the world, and very few of them have proper documentations and almost none comes with a unit test. Exceptions can be found with-in the computing systems researchers, e.g., HTCondor, Mesos and PlanetLab, where quite a lot of these practices are exercised.
Documentation: is not needed because software is for personal use.
Unit testing: also not needed because you understand the code so if it works it is correct.
Unfortunately this means that a professor wrote a code when they were post-doc, and that code has been expanded by generations of students and post-docs, never properly documented, full of badly understood dependencies, and increasingly full of untested bits that are not at all obviously correct.
I don't have direct experience with code written by academics *for* academic work, but I have a decent amount of experience with code written by former academics who have just jumped into the private sector, e.g., EE PhD in his/her first non-academic role.
Judging from this, I'd guess that most academic code quality ranks somewhere between C- and F. It's pretty terrible, and very frustrating since the writers are clearly super smart. I think the resistance stems mainly from two things: 1) a perverse enjoyment of writing bad code because they think they're above such trifling matters, and 2) they think it takes too much time. These are both bad reasons, but that's for another question.