Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Unlocking Potential of Property Based Testing w...

Unlocking Potential of Property Based Testing with Ractor

Masato Ohba

May 15, 2024
Tweet

More Decks by Masato Ohba

Other Decks in Programming

Transcript

  1.  ✅ &BTZUPXSJUFBOEVOEFSTUBOE ✅ 6TFGVMUPFOTVSFPVSQSPHSBN XPSLTBTFYQFDUFE ❌ 0OMZ fi OETCVHTUIBUB

    QSPHSBNNFSQSFEJDUFE &YBNQMFCBTFEUFTUJOH 8IBUJTQSPQFSUZCBTFEUFTUJOH 8IBUJGBOFNQUZBSSBZJTHJWFO
  2.  w (FOFSBUFIVOESFET UIPVTBOETPGUFTUJOQVUT BUSBOEPN w %FTDSJCFUFTUUBSHFUT QSPQFSUZ OPUBOFYBNQMF 1SPQFSUZCBTFEUFTUJOH

    8IBUJTQSPQFSUZCBTFEUFTUJOH 3BOEPNJTO`USFBMMZSBOEPN$POUSPMMFEBOESFQSPEVDJCMFSBOEPNOFTT
  3.  1SPQFSUZ 8IBUJTQSPQFSUZCBTFEUFTUJOH w "QSPQFSUZDBOCF FYQSFTTFEBTGPMMPX w GPSBOZ Y Z

      TVDIUIBU QSFDPOEJUJPO Y Z   IPMET QSFEJDBUF Y Z  JT USVF 2
  4.  w *UTIJTUPSZJTMPOH w  IUUQTJFFFYQMPSFJFFFPSH EPDVNFOU w  IUUQTEMBDNPSHEPJBCT

     w  IUUQTEMBDNPSHEPJ  2%PFTJUIBWFUSBDLSFDPSET ":FT BMPU 8IBUJTQSPQFSUZCBTFEUFTUJOH
  5.  w 'V[[JOHJTGFFEJOHBQJFDFPGDPEF GVODUJPO QSPHSBN FUD EBUB GSPNBMBSHFDPSQVT QPTTJCMZEZOBNJDBMMZHFOFSBUFE QPTTJCMZ

    EFQFOEFOUPOUIFSFTVMUTPGFYFDVUJPOPOQSFWJPVTEBUB JOPSEFS UPTFFXIFUIFSJUGBJMT w 1SPQFSUZCBTFEUFTUJOHJTUIFDPOTUSVDUJPOPGUFTU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NQMFUBTL 4JNQMFUBTLCVUGBJMVSF w /FJUIFS$16CPVOEOPS*0CPVOE w *UKVTUSVOTBUFTUUJNFTGPSFBDIHFOFSBUFEWBMVF w /FJUIFS$16CPVOEOPS*0CPVOE w

    4ISJOLJOHIBQQFOTUJNFTXJUIBHJWFOTFFE UFTUUBSHFUT 5FTUJOHUPPMJNQMFNFOUBUJPOUPWFSJGZUIFIZQPUIFTJT
  19.  $16CPVOE *0CPVOE w 5BSBJGVODUJPOXJUI   XIJDIDBVTFT  UJNFTNFUIPEDBMMT

    w 5IJTCFODINBSLVTFTADPOTUBOUABSCJUSBSZ UP fi YJOQVUWBMVFT w *USFBETB fi MFUIBUDPOUBJOTQBSBHSBQIT   XPSET  CZUFT w *XBOUFEUPDBMMBOFUXPSL%#DBMMIFSFCVU XBTOUBCMFEVFUP3BDUPSTMJNJUBUJPOT 5FTUJOHUPPMJNQMFNFOUBUJPOUPWFSJGZUIFIZQPUIFTJT
  20.  *UFSBUJPOTQFSTFDPOECFODINBSL IUUQTHJUIVCDPNPICBSZFQCUCMPCDFGBFBFBBDGBCCGCFODINBSL3&"%.&NE w NBD04  "QQMF.1SP DPSFT  QFSGPSNBODFBOE

    F ffi DJFODZ  w SVCZ  SFWJTJPO DDE  ./ <BSNEBSXJO> w QCUDPNNJUIBTI FDBFDDFCB FECBEGG EDGEB 5FTUJOHUPPMJNQMFNFOUBUJPOUPWFSJGZUIFIZQPUIFTJT
  21.  1028 1534 2425 w 4FRVFOUJBMQSPDFTTJOH JTGBTUFOPVHI w 3BDUPSFNFSHFTBTB DIBNQJPOXIFOBUFTU

    UBSHFUJT$16CPVOE w .VMUJQSPDFTTUISFBE XPOOPOFPGSBDFT 0WFSBMMPCTFSWBUJPO 5FTUJOHUPPMJNQMFNFOUBUJPOUPWFSJGZUIFIZQPUIFTJT
  22.  1028 1534 2425 UJNFT GBTUFS UJNFT TMPXFS UJNFT TMPXFS

    UJNFT TMPXFS w 3BDUPSJTYGBTUFS GPSUIF$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