Skip to Content
Outillage Python hypermoderne
book

Outillage Python hypermoderne

by Claudio Jolowicz
November 2024
Intermediate to advanced
270 pages
7h 37m
French
O'Reilly Media, Inc.
Content preview from Outillage Python hypermoderne

Chapitre 7. Mesurer la couvertureavec Coverage.py

Cet ouvrage a été traduit à l'aide de l'IA. Tes réactions et tes commentaires sont les bienvenus : translation-feedback@oreilly.com

A quel point es-tu confiant dans un changement de code lorsque tes tests sont réussis ?

Si tu considères les tests comme un moyen de détecter les bugs, tu peux décrire leur sensibilité et leur spécificité.

La sensibilité de ta suite de tests est la probabilité d'échec d'un test lorsqu'il y a un défaut dans le code. Si de grandes parties du code ne sont pas testées, ou si les tests ne vérifient pas le comportement attendu, ta sensibilité est faible.

La spécificité de tes tests est la probabilité qu'ils réussissent si le code est exempt de défauts. Si tes tests sont instables (ils échouent par intermittence) oufragiles (ils échouent lorsque tu changes les détails de l'implémentation), alors tu as une faible spécificité. Invariablement, les gens cessent de prêter attention aux tests qui échouent. Ce chapitre ne traite pas de la spécificité.

Il existe un excellent moyen d'augmenter la sensibilité de tes tests : lorsque tu ajoutes ou modifies un comportement, écris un test qui échoue avant le code qui le fait passer. Si tu fais cela, ta suite de tests saisira tes attentes par rapport au code.

Une autre stratégie efficace consiste à tester ton logiciel avec les différentes entrées et contraintes environnementales que tu t'attends à rencontrer dans le monde réel. Couvre les cas limites d'une fonction, comme ...

Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.

Read now

Unlock full access

More than 5,000 organizations count on O’Reilly

AirBnbBlueOriginElectronic ArtsHomeDepotNasdaqRakutenTata Consultancy Services

QuotationMarkO’Reilly covers everything we've got, with content to help us build a world-class technology community, upgrade the capabilities and competencies of our teams, and improve overall team performance as well as their engagement.
Julian F.
Head of Cybersecurity
QuotationMarkI wanted to learn C and C++, but it didn't click for me until I picked up an O'Reilly book. When I went on the O’Reilly platform, I was astonished to find all the books there, plus live events and sandboxes so you could play around with the technology.
Addison B.
Field Engineer
QuotationMarkI’ve been on the O’Reilly platform for more than eight years. I use a couple of learning platforms, but I'm on O'Reilly more than anybody else. When you're there, you start learning. I'm never disappointed.
Amir M.
Data Platform Tech Lead
QuotationMarkI'm always learning. So when I got on to O'Reilly, I was like a kid in a candy store. There are playlists. There are answers. There's on-demand training. It's worth its weight in gold, in terms of what it allows me to do.
Mark W.
Embedded Software Engineer

You might also like

Faire évoluer Python avec Dask

Faire évoluer Python avec Dask

Holden Karau, Mika Kimmins
Mise à l'échelle de Python avec Ray

Mise à l'échelle de Python avec Ray

Holden Karau, Boris Lublinsky
Puissant Python

Puissant Python

Aaron Maxwell

Publisher Resources

ISBN: 9798341608924