The code is usually terrible in various ways (mostly due to the culture in game dev studios). Even Quake's code, which is quite good, includes various "what the fuck?"[1] comments
Unless you are a huge company that can have his own in house engine with it's own team working on it, you will basically start a game from scratch with DirectX and with an engine built only for the needs of your game. You will finish the game, release it, and now you will have to start everything again because the game you just built - with its code - is not advanced enough to ship the next game with the graphics required in 2 years. So rather to have to fight by refactoring 60% of your code you start a new engine again, or else you cut hard in it.
And secondly, a game is here to be consumed for a short period of time. After that the whole product just died. Maybe it will have a few patch, but that's it. Where for a software, it is supposed to be constantly evolving and here to stay a few years, rather to be consumed for say 6 months, and then discontinued.
And lastly because it's an entertainment industry. There is nothing huge happening if a bug comes. No fortune 500 will be down, just the computer of someone somewhere. So it's "better" to ship fast and correct a bug when you see one, rather to spend a big amount of time writing tests that you won't be able to use for your next game anyway.
Unless you are a huge company that can have his own in house engine with it's own team working on it, you will basically start a game from scratch with DirectX and with an engine built only for the needs of your game. You will finish the game, release it, and now you will have to start everything again because the game you just built - with its code - is not advanced enough to ship the next game with the graphics required in 2 years. So rather to have to fight by refactoring 60% of your code you start a new engine again, or else you cut hard in it.
And secondly, a game is here to be consumed for a short period of time. After that the whole product just died. Maybe it will have a few patch, but that's it. Where for a software, it is supposed to be constantly evolving and here to stay a few years, rather to be consumed for say 6 months, and then discontinued.
And lastly because it's an entertainment industry. There is nothing huge happening if a bug comes. No fortune 500 will be down, just the computer of someone somewhere. So it's "better" to ship fast and correct a bug when you see one, rather to spend a big amount of time writing tests that you won't be able to use for your next game anyway.