Nicolás Berger - Co-founder & Engineer, Winding Tree
A decentralized marketplace for travel
ICO (Initial Coin Offering): mid-September
Reverse dutch auction crowdsale
- Just the examples the programmer come up with
assert.equal(5, sum(2, 3))
assert.equal(5, sum(1, 4))
- Just the examples the programmer come up with
assert.equal(5, sum(2, 3))
assert.equal(5, sum(1, 4))
function sum(x,y) {
return 5;
}
-
Too many combinations
- submitBid -> submitBid -> presalePayment -> submitBid ...
- presalePayment -> submitBid -> presalePayment ...
- submitBid -> wait -> wait -> submitBid ...
- wait -> submitBid -> [...] -> presalePayment -> submitBid
- Generators: generate random input
- Run: Verify that property holds true on every input
- Shrink: Find the smallest input that still fails
- State
- stage: Stopped / Running / Finished
- bids: [{account: xyz, tokens: 42, price: 2.7}, ...]
- presalePayments: [{account: abc, ether: 4}, {...}]
- ...
- Generate sequence of transactions
- Apply transactions on the smart contracts
- Compare actual state to expected state
- Find the shortest sequence that still fails
- wait -> wait -> wait -> wait -> submitBid
- Mathematical
a + b == b + a // commutative
- Round tripping / inverse
s == fromJSON(toJSON(s))
- Idempotence
update(user) == update(update(user))
- Function equality
sort(arr) == fastSort(arr)
- Truffle: development framework for Ethereum
- testrpc: Fast Ethereum RPC client for testing and development
- JSVerify: Javascript property-based testing library
John Hughes - Testing the Hard Stuff and Staying Sane https://www.youtube.com/watch?v=zi0rHwfiX1Q
JSVerify - Property-based testing for javascript http://jsverify.github.io/
Adding property-based tests for Winding Tree smart contracts windingtree/lif-token#60
An introduction to property-based testing https://fsharpforfunandprofit.com/posts/property-based-testing/