#fp_matsuri
Alloyによる具体的な問題発⾒例
33
検証の実⾏と結果の解釈
Alloy Analyzerが発⾒する問題例
🚨 発⾒された問題シナリオ1:同時注⽂での在庫競合の発⾒
Instance found:
Book₀: isbn=ISBN₀, title="Kotlin Guide", price=Money₀
Customer₀: name="Alice", email="
[email protected]"
Customer₁: name="Bob", email="
[email protected]"
Inventory₀: book=Book₀, stock=1, reserved=0
Order₀: customer=Customer₀, status=Pending
OrderItem₀: book=Book₀, quantity=1, order=Order₀
Order₁: customer=Customer₁, status=Pending
OrderItem₁: book=Book₀, quantity=1, order=Order₁
// 問題:在庫1冊に対して2件の注文(計2冊)が存在
// どちらも確定されると在庫がマイナスになる