I am not a lawyer, so this is a layman's reply. Assuming the patent is valid, you are breaking a law by infringing. Now if your product is obscure, the patent holder might not notice, but really even without the legal aspect, infringing on a valid patent is essentially stealing someone's intellectual property. To me this is an ethical issue. As I said, I'm not a lawyer, but I believe willful infringement can incur greater penalties if you are sued. As for licensing, I'm relatively confident it is cheaper to license than to be sued considering you would be in the wrong and the infringement is willful. As for the length of time before patent expiration, clearly if the time is only 10 days, you would simply wait. The longer the patent has until expiration, the more valuable it is and that would be reflected in the licensing terms.