Why Passing Tests Doesn't Mean Your Software Is Correct
go
dev.to
A Go pricing example show my green tests and high coverage can still miss a business rule defect. Imagine a checkout service that gives customers a 10% discount on orders of $200 or more. The change has passed code review. The CI pipeline is green and the unit tests report 100% statement coverage. Then a customer places a $150 order and recieves the discount. The service is working as written but it is not following the business rule. How could the tests pass ? The answer is simple a tes