{"id":967,"date":"2012-04-20T14:57:00","date_gmt":"2012-04-20T14:57:00","guid":{"rendered":"http:\/\/nestor.nestasoft.fr\/?p=967"},"modified":"2012-04-20T17:34:06","modified_gmt":"2012-04-20T17:34:06","slug":"7-raisons-principales-dcrire-les-tests-unitaires","status":"publish","type":"post","link":"https:\/\/nestasoft.fr\/?p=967","title":{"rendered":"7 raisons principales d&rsquo;&eacute;crire les tests unitaires"},"content":{"rendered":"<p><a href=\"http:\/\/nestor.nestasoft.fr\/wp-content\/uploads\/2012\/04\/Acc1.png\"><img loading=\"lazy\" decoding=\"async\" style=\"background-image: none; border-bottom: 0px; border-left: 0px; margin: 0px 10px 0px 0px; padding-left: 0px; padding-right: 0px; display: inline; border-top: 0px; border-right: 0px; padding-top: 0px\" class=\"alignleft\" title=\"Acc\" border=\"0\" alt=\"Acc\" src=\"http:\/\/nestor.nestasoft.fr\/wp-content\/uploads\/2012\/04\/Acc_thumb1.png\" width=\"133\" height=\"131\" \/><\/a>     <br \/>Certains d\u00e9veloppeurs ont prit l\u2019habitude de cr\u00e9er des projets de tests dans leur app et d\u2019autres non. Ceux qui ne le font pas pense gagner du temps, car rallent-ils \u201cje n\u2019ai pas le temps\u201d. Rappelons-le, la mise en place d\u2019un projet de tests semble \u00e0 priori \u00eatre une perte de temps, cependant les r\u00e9sultats nous prouvent le contraire.<\/p>\n<p>Voici quelques raisons principales d\u2019\u00e9crire les tests unitaires:<\/p>\n<blockquote>\n<p><img decoding=\"async\" style=\"border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none\" class=\"wlEmoticon wlEmoticon-thumbsup\" alt=\"Pouce lev\u00e9\" src=\"http:\/\/nestor.nestasoft.fr\/wp-content\/uploads\/2012\/04\/wlEmoticon-thumbsup.png\" \/>&#160; Raison <abbr>n<sup>o<\/sup><\/abbr><strong> <\/strong>1 : Plus besoin de d\u00e9boguer le m\u00eame code n fois.<\/p>\n<\/blockquote>\n<p><!--more--><\/p>\n<blockquote>\n<p><img decoding=\"async\" style=\"border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none\" class=\"wlEmoticon wlEmoticon-thumbsup\" alt=\"Pouce lev\u00e9\" src=\"http:\/\/nestor.nestasoft.fr\/wp-content\/uploads\/2012\/04\/wlEmoticon-thumbsup.png\" \/>&#160; Raison <abbr>n<sup>o<\/sup><\/abbr> 2 : Maintenabilit\u00e9 du code assur\u00e9; Encapsulation des fonctionnalit\u00e9s, ce qui rend une maintenabilit\u00e9 moins fastidieuse.<\/p>\n<\/blockquote>\n<blockquote>\n<p><img decoding=\"async\" style=\"border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none\" class=\"wlEmoticon wlEmoticon-thumbsup\" alt=\"Pouce lev\u00e9\" src=\"http:\/\/nestor.nestasoft.fr\/wp-content\/uploads\/2012\/04\/wlEmoticon-thumbsup.png\" \/>&#160; Raison <abbr>n<sup>o <\/sup><\/abbr>3 : Gain de temps sur les tests; votre app peut-\u00eatre test\u00e9 \u00e0 la vitesse de votre CPU.<\/p>\n<\/blockquote>\n<blockquote>\n<p><img decoding=\"async\" style=\"border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none\" class=\"wlEmoticon wlEmoticon-thumbsup\" alt=\"Pouce lev\u00e9\" src=\"http:\/\/nestor.nestasoft.fr\/wp-content\/uploads\/2012\/04\/wlEmoticon-thumbsup.png\" \/>&#160; Raison <abbr>n<sup>o <\/sup><\/abbr>4 : Ne pas embarrasser le client; En r\u00e9digeant vos tests unitaires, vos pouvez \u00e9crire une multitudes de sc\u00e9narios et ainsi d\u00e9celer les failles possibles de votre code.<\/p>\n<\/blockquote>\n<blockquote>\n<p><img decoding=\"async\" style=\"border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none\" class=\"wlEmoticon wlEmoticon-thumbsup\" alt=\"Pouce lev\u00e9\" src=\"http:\/\/nestor.nestasoft.fr\/wp-content\/uploads\/2012\/04\/wlEmoticon-thumbsup.png\" \/>&#160; Raison <abbr>n<sup>o<\/sup><\/abbr> 5 : Les tests unitaires vous permettent de n\u2019\u00e9crire que du code n\u00e9cessaires, ce qui rend l\u2019app moins volumineuse.<\/p>\n<\/blockquote>\n<blockquote>\n<p><img decoding=\"async\" style=\"border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none\" class=\"wlEmoticon wlEmoticon-thumbsup\" alt=\"Pouce lev\u00e9\" src=\"http:\/\/nestor.nestasoft.fr\/wp-content\/uploads\/2012\/04\/wlEmoticon-thumbsup.png\" \/>&#160; Raison <abbr>n<sup>o<\/sup><\/abbr> 6 : Plus besoin de se soucier lors de l\u2019ajout d\u2019une nouvelle fonctionnalit\u00e9 dans votre app.<\/p>\n<\/blockquote>\n<blockquote>\n<p><img decoding=\"async\" style=\"border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none\" class=\"wlEmoticon wlEmoticon-thumbsup\" alt=\"Pouce lev\u00e9\" src=\"http:\/\/nestor.nestasoft.fr\/wp-content\/uploads\/2012\/04\/wlEmoticon-thumbsup.png\" \/>&#160; Raison <abbr>n<sup>o<\/sup><\/abbr> 7 : Am\u00e9liore la lisibilit\u00e9 du code.<\/p>\n<\/blockquote>\n<blockquote>\n<p><img decoding=\"async\" style=\"border-bottom-style: none; border-right-style: none; border-top-style: none; border-left-style: none\" class=\"wlEmoticon wlEmoticon-thumbsup\" alt=\"Pouce lev\u00e9\" src=\"http:\/\/nestor.nestasoft.fr\/wp-content\/uploads\/2012\/04\/wlEmoticon-thumbsup.png\" \/>&#160; Bonus : Avec les tests unitaires, vous saurez exactement o\u00f9 le code bloque.<\/p>\n<\/blockquote>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_967\" class=\"pvc_stats all  \" data-element-id=\"967\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/nestasoft.fr\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"excerpt":{"rendered":"<p>Certains d\u00e9veloppeurs ont prit l\u2019habitude de cr\u00e9er des projets de tests dans leur app et d\u2019autres non. Ceux qui ne le font pas pense gagner du temps, car rallent-ils \u201cje n\u2019ai pas le temps\u201d. Rappelons-le, la mise en place d\u2019un projet de tests semble \u00e0 priori \u00eatre une perte de temps, cependant les r\u00e9sultats nous [&hellip;]<\/p>\n<div class=\"pvc_clear\"><\/div>\n<p id=\"pvc_stats_967\" class=\"pvc_stats all  \" data-element-id=\"967\" style=\"\"><i class=\"pvc-stats-icon medium\" aria-hidden=\"true\"><svg aria-hidden=\"true\" focusable=\"false\" data-prefix=\"far\" data-icon=\"chart-bar\" role=\"img\" xmlns=\"http:\/\/www.w3.org\/2000\/svg\" viewBox=\"0 0 512 512\" class=\"svg-inline--fa fa-chart-bar fa-w-16 fa-2x\"><path fill=\"currentColor\" d=\"M396.8 352h22.4c6.4 0 12.8-6.4 12.8-12.8V108.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v230.4c0 6.4 6.4 12.8 12.8 12.8zm-192 0h22.4c6.4 0 12.8-6.4 12.8-12.8V140.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v198.4c0 6.4 6.4 12.8 12.8 12.8zm96 0h22.4c6.4 0 12.8-6.4 12.8-12.8V204.8c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v134.4c0 6.4 6.4 12.8 12.8 12.8zM496 400H48V80c0-8.84-7.16-16-16-16H16C7.16 64 0 71.16 0 80v336c0 17.67 14.33 32 32 32h464c8.84 0 16-7.16 16-16v-16c0-8.84-7.16-16-16-16zm-387.2-48h22.4c6.4 0 12.8-6.4 12.8-12.8v-70.4c0-6.4-6.4-12.8-12.8-12.8h-22.4c-6.4 0-12.8 6.4-12.8 12.8v70.4c0 6.4 6.4 12.8 12.8 12.8z\" class=\"\"><\/path><\/svg><\/i> <img loading=\"lazy\" decoding=\"async\" width=\"16\" height=\"16\" alt=\"Loading\" src=\"https:\/\/nestasoft.fr\/wp-content\/plugins\/page-views-count\/ajax-loader-2x.gif\" border=0 \/><\/p>\n<div class=\"pvc_clear\"><\/div>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[],"tags":[],"class_list":["post-967","post","type-post","status-publish","format-standard","hentry"],"_links":{"self":[{"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/posts\/967","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=967"}],"version-history":[{"count":4,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/posts\/967\/revisions"}],"predecessor-version":[{"id":973,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=\/wp\/v2\/posts\/967\/revisions\/973"}],"wp:attachment":[{"href":"https:\/\/nestasoft.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=967"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=967"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/nestasoft.fr\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=967"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}