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

Esplorare il Test-Driven Development (TDD) nel ...

Esplorare il Test-Driven Development (TDD) nel FrontEnd

Avatar for Luca Giuberti

Luca Giuberti

June 14, 2024
Tweet

More Decks by Luca Giuberti

Other Decks in Programming

Transcript

  1. © 2022 Thoughtworks 4 Fare TDD nel FE è difficile

    • Il TDD funziona bene quando abbiamo da testare la logica, ma non quando testiamo interazioni o parti grafiche • Nel BE abbiamo un chiaro contratto (e.g. API contract), nel FE non abbiamo contatti • Tests basati su dettagli implementativi
  2. © 2022 Thoughtworks 8 Business logic • Il TDD funziona

    bene quando abbiamo da testare la logica, ma non quando testiamo interazioni o parti grafiche
  3. © 2022 Thoughtworks 12 Contatto • Nel BE abbiamo un

    chiaro contratto (e.g. API contract), nel FE non abbiamo contatti • I contratti sono gli elementi nell’ accessibility tree
  4. © 2022 Thoughtworks 15% Della popolazione mondiale ha qualche forma

    di disabilità 13 13 © 2024 Thoughtworks | Confidential https://ddiy.co/web-accessibility-statistics/
  5. © 2022 Thoughtworks 17 E lo stile? Come possiamo applicare

    il TDD al CSS? Non dobbiamo! Non dobbiamo! Non Dobbiamo!
  6. © 2022 Thoughtworks Summary 25 Consigli (personali) su come applicare

    il TDD nel mondo FE: • Unit test the Domain Logic • Testare la UI tramite Accessibilità • Non applicare il TDD alle sperimentazioni • Favorire test comprensivi essendo consapevoli dei tradeoff
  7. © 2022 Thoughtworks References 26 Libri: Video: Shipping React app

    with zero-bugs policy using TDD (Nik Sumeiko) Articoli: • Modularizing React Applications with Established UI Patterns • Testing Implementation Details
  8. © 2022 Thoughtworks “There is no failure in sports, it’s

    step to success” 27 Giannis Antetokounmpo 27 © 2024 Thoughtworks | Confidential