It is easy to put all the blame on “management.” But is management really telling you to specifically not do any unit testing?
Management in general does not (and probably should not) tell you how to do your job, whether it is modularization, abstract data types, design patterns, or unit testing. These are tools of trade that a successful, competent software engineer applies, but a poor engineer does not.
I think the real answer to your question is: unit testing is really difficult, and computer-science students are not trained for it.
It's easy when you are writing your own string class. When you are testing a real-life product, you run into challenges that nobody told you about in the powerpoint slides:
- User interaction. Half of your application is the user interface logic. How do you test it in an automated way, that doesn't break down if you move a button?
- Interaction with external APIs and frameworks. If you are writing a Windows kernel driver, how do you unit test it? Do you write stubs for every IRP and kernel function that you use, effectively creating a simulation of the OS kernel?
- Network communications is the thing of the 21st century. How do you coordinate a unit test consisting of several distributed components?
- How do you choose good test cases? I commonly see people trying the “do random things in a loop of 1000 iterations and see if it breaks” approach. When you do this the effort is higher than the returns, important bugs are missed, and unit testing is abandoned.
- How do you test that performance requirements are met?
- Knowledge of patterns in testing is scarce: stubs, canned responses, regression testing are concepts most people don't know. How many in your work place actually read a book about unit testing?
The one thing that we can blame management for is that requirement specifications rarely contain any requirements on quality level of the deliverable.
The next time your boss asks you to do a time estimate, include the time for writing a unit test and see what happens.