Or you could just have the government itself develop the software in tandem with the tax regulations. Obviously, even that would still be easier and cheaper with a less complex tax code, but in this thread we're talking about "open source tax software" that shouldn't even really need to exist when the government could just provide a fully functional web portal where the corner cases have been tested exhaustively by the organisation that knows those corner cases better than anyone.