|
|
|
|
|
by jph
3076 days ago
|
|
Turns out this is a great example of why tests are better than documentation. One way to implement this is by using two methods: one normal and one with the hardware mitigation code, with a dispatch that chooses between them. This separation of concerns ensures that your normal code runs normally on normal hardware, and your specialized code runs in a specialized way on the buggy hardware. This separation also makes it much clearer/easier to end-of-life the mitigation code when it's time. |
|
B. Your solution is not obviously better, it's a different trade-off. And it's not immediately apparent to me how exactly you would write the test for the affected hardware, in the first place. What if the hardware bug is extremely hard to reproduce?