	{"id":406,"date":"2013-06-19T19:13:13","date_gmt":"2013-06-19T12:13:13","guid":{"rendered":"http:\/\/science-technology.vn\/?p=406"},"modified":"2013-06-19T19:13:13","modified_gmt":"2013-06-19T12:13:13","slug":"phat-trien-duoc-dan-lai-boi-kiem-thu","status":"publish","type":"post","link":"https:\/\/science-technology.vn\/?p=406","title":{"rendered":"Ph\u00e1t tri\u1ec3n \u0111\u01b0\u1ee3c d\u1eabn l\u00e1i b\u1edfi ki\u1ec3m th\u1eed"},"content":{"rendered":"<p><span style=\"font-size: 14px;\">Ph\u00e1t tri\u1ec3n \u0111\u01b0\u1ee3c d\u1eabn l\u00e1i b\u1edfi ki\u1ec3m th\u1eed &#8211; Test Driven Development (TDD) l\u00e0 th\u1ef1c h\u00e0nh Agile \u0111\u1ec3 kh\u1eed b\u1ecf th\u1eadt nhi\u1ec1u l\u1ed7i c\u00f3 th\u1ec3 \u0111\u1ec3 cho ng\u01b0\u1eddi ph\u00e1t tri\u1ec3n c\u00f3 th\u1ec3 th\u00eam c\u00e1c t\u00ednh n\u0103ng hay th\u1ef1c hi\u1ec7n c\u00e1c thay \u0111\u1ed5i nh\u01b0ng v\u1eabn t\u1ea1o ra ph\u1ea7n m\u1ec1m ch\u1ea5t l\u01b0\u1ee3ng cho m\u1ecdi l\u1ea7n l\u1eb7p.<\/span><\/p>\n<p>Kh\u00e1i ni\u1ec7m n\u00e0y t\u01b0\u01a1ng \u0111\u1ed1i \u0111\u01a1n gi\u1ea3n. Ng\u01b0\u1eddi ph\u00e1t tri\u1ec3n ph\u1ea3i t\u1ea1o ra c\u00e1c ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb cho m\u00e3 c\u1ee7a h\u1ecd tr\u01b0\u1edbc khi vi\u1ebft m\u00e3. V\u1ec1 truy\u1ec1n th\u1ed1ng ph\u1ea7n l\u1edbn ng\u01b0\u1eddi ph\u00e1t tri\u1ec3n vi\u1ebft m\u00e3 tr\u01b0\u1edbc r\u1ed3i m\u1edbi ph\u00e1t tri\u1ec3n ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb. Tuy nhi\u00ean trong c\u00e1ch ti\u1ebfp c\u1eadn n\u00e0y, ng\u01b0\u1eddi ph\u00e1t tri\u1ec3n \u0111\u1ea7u ti\u00ean b\u1eaft \u0111\u1ea7u b\u1eb1ng ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb \u0111\u1ec3 ki\u1ec3m nghi\u1ec7m m\u00e3 s\u1ebd l\u00e0m g\u00ec. B\u1eb1ng vi\u1ec7c t\u1ea1o ra ki\u1ec3m th\u1eed tr\u01b0\u1edbc cho ph\u00e9p ng\u01b0\u1eddi ph\u00e1t tri\u1ec3n hi\u1ec3u nhi\u1ec1u h\u01a1n v\u1ec1 m\u00e3 m\u00e0 h\u1ecd s\u1ebd vi\u1ebft. B\u1eb1ng vi\u1ec7c vi\u1ebft m\u00e3 \u0111\u1ec3 ch\u1eafc n\u00f3 s\u1ebd qua \u0111\u01b0\u1ee3c ki\u1ec3m th\u1eed, h\u1ecd c\u00f3 th\u1ec3 kh\u1eed b\u1ecf l\u1ed7i v\u00e0 c\u00f3 ph\u1ea7n m\u1ec1m ch\u1ea5t l\u01b0\u1ee3ng cao.<\/p>\n<p>T\u1ea5t nhi\u00ean l\u00fac ban \u0111\u1ea7u ph\u1ea7n l\u1edbn ng\u01b0\u1eddi ph\u00e1t tri\u1ec3n th\u01b0\u1eddng c\u1ea3m th\u1ea5y kh\u00f4ng tho\u1ea3i m\u00e1i b\u1edfi v\u00ec h\u1ecd \u0111\u01b0\u1ee3c \u0111\u00e0o t\u1ea1o vi\u1ebft m\u00e3 tr\u01b0\u1edbc, ki\u1ec3m th\u1eed sau. Tuy nhi\u00ean, n\u1ebfu h\u1ecd tu\u00e2n theo c\u00e1ch ti\u1ebfp c\u1eadn n\u00e0y, h\u1ecd s\u1ebd hi\u1ec3u r\u00f5 s\u1ef1 \u0111\u01a1n gi\u1ea3n c\u1ee7a n\u00f3. Vi\u1ec7c g\u1ee1 l\u1ed7i truy\u1ec1n th\u1ed1ng th\u01b0\u1eddng c\u00f3 ngh\u0129a l\u00e0 nh\u00ecn qua nhi\u1ec1u m\u00e3 \u0111\u1ec3 nh\u1eadn di\u1ec7n l\u1ed7i. C\u00e1ch ti\u1ebfp c\u1eadn d\u1eabn l\u00e1i b\u1edfi ki\u1ec3m th\u1eed cho ph\u00e9p ng\u01b0\u1eddi ph\u00e1t tri\u1ec3n h\u1ed9i t\u1ee5 v\u00e0o \u0111\u01a1n v\u1ecb nh\u1ecf \u0111\u1ec3 ch\u1eafc n\u00f3 kh\u00f4ng c\u00f3 l\u1ed7i. C\u00e1ch g\u1ee1 l\u1ed7i truy\u1ec1n th\u1ed1ng y\u00eau c\u1ea7u nhi\u1ec1u th\u1eddi gian \u0111\u1ec3 l\u1eadp c\u00e1c \u0111i\u1ec3m ng\u1eaft, c\u00e1c bi\u1ebfn t\u1ea1m th\u1eddi v\u00e0 c\u00e2u l\u1ec7nh in r\u1ed3i s\u1ebd b\u1ecb b\u1ecf \u0111i sau ki\u1ec3m th\u1eed. M\u1ed9t khi ng\u01b0\u1eddi ph\u00e1t tri\u1ec3n t\u00ecm ra v\u00e0 s\u1eeda l\u1ed7i, nh\u1eefng tr\u01b0\u1eddng h\u1ee3p ki\u1ec3m th\u1eed n\u00e0y th\u01b0\u1eddng b\u1ecb b\u1ecf \u0111i. Trong pha b\u1ea3o tr\u00ec, nh\u1eefng ng\u01b0\u1eddi ph\u00e1t tri\u1ec3n kh\u00e1c c\u00f3 th\u1ec3 ph\u1ea3i b\u1eaft \u0111\u1ea7u l\u1ea1i v\u1edbi ki\u1ec3m th\u1eed ri\u00eang c\u1ee7a h\u1ecd, \u0111i\u1ec1u y\u00eau c\u1ea7u nhi\u1ec1u n\u1ed7 l\u1ef1c h\u01a1n. V\u1edbi c\u00e1ch ti\u1ebfp c\u1eadn d\u1eabn l\u00e1i theo ki\u1ec3m th\u1eed, m\u1ecdi ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb \u0111\u1ec1u \u0111\u01b0\u1ee3c duy tr\u00ec cho d\u00f9ng v\u1ec1 sau. N\u1ebfu l\u1ed7i x\u1ea3y ra, c\u00f9ng ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb \u0111\u00f3 c\u00f3 th\u1ec3 b\u1eaft \u0111\u01b0\u1ee3c n\u00f3 l\u1ea7n n\u1eefa. N\u1ebfu l\u1ed7i m\u1edbi x\u1ea3y ra v\u00e0 kh\u00f4ng c\u00f3 ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb t\u01b0\u01a1ng \u1ee9ng, ng\u01b0\u1eddi ph\u00e1t tri\u1ec3n c\u00f3 th\u1ec3 vi\u1ebft ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb m\u1edbi b\u1eaft n\u00f3 v\u00e0 d\u00f9ng l\u1ea1i c\u00f9ng ki\u1ec3m \u00a0th\u1eed n\u00e0y v\u1ec1 sau trong pha b\u1ea3o tr\u00ec.<\/p>\n<p>Nh\u1eefng ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb nh\u1ecf n\u00e0y c\u00f3 th\u1ec3 \u0111\u01b0\u1ee3c t\u1ed5 ch\u1ee9c th\u00e0nh t\u1eadp c\u00e1c ki\u1ec3m th\u1eed \u0111\u01a1n v\u1ecb \u0111\u1ec3 ph\u00e1t hi\u1ec7n m\u1ecdi l\u1ed7i cho t\u1eebng l\u1ea7n \u0111\u01b0a ra. V\u00ec ch\u00fang \u0111\u00e3 ki\u1ec3m th\u1eed cho m\u1ecdi m\u00e3 m\u1ed9t c\u00e1ch k\u0129 l\u01b0\u1ee1ng, ph\u1ea7n m\u1ec1m \u0111\u01b0a ra v\u00e0o l\u00fac n\u00e0y th\u01b0\u1eddng c\u00f3 \u00edt l\u1ed7i h\u01a1n nhi\u1ec1u so v\u1edbi ki\u1ec3m th\u1eed t\u00edch h\u1ee3p truy\u1ec1n th\u1ed1ng.<\/p>\n<p>&nbsp;<\/p>\n<p>&#8212;-English version&#8212;-<\/p>\n<p>&nbsp;<\/p>\n<p>Test driven\u00a0 development<\/p>\n<p>Test Driven Development (TDD) is an Agile practice to eliminate as many defects as possible so developers can add features or implement changes but still produce quality software for every iteration.<\/p>\n<p>The concept is relatively simple. Developers must create Unit tests for their code before they write code. Traditionally most developers write code first then develop Unit tests. However in this approach, developers begin first with a Unit test to validate what the code will do. By create the test first allows developers to understand more about the code that they will write. By writing code to make sure it will pass the test, they can eliminate defects and have high quality software.<\/p>\n<p>Of course in the beginning most developers often feel uncomfortable because they are trained to write code first, test later. However, if they follow this approach, they will appreciate the simplicity of it. Traditional debugging often means looking through a lot of code to identify defects. Test driven approach allows developers to focus on a smaller unit to make sure it does not have bugs. Traditional debugging requires lot of time to set up break points, temporary variable and print statements which are thrown away after test. Once developer find and fix the bug, these test cases are often discarded. During the maintenance phase, other developers may have to start again with their own tests which require more efforts. With Test-driven approach, all Unit tests are maintained for later use. If a bug happens, the same Unit test that caught it can catch it again. If a new bug happens and there is no matching Unit test, developer can write a new Unit test that captures it and reuse the same test later during maintenance phase.<\/p>\n<p>These small unit tests can be organized into a set of automated unit tests to detecting all bugs for each release. Since they already test all codes thoroughly, released software at this time usually has much less defects than the traditional integration test.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>Ph\u00e1t tri\u1ec3n \u0111\u01b0\u1ee3c d\u1eabn l\u00e1i b\u1edfi ki\u1ec3m th\u1eed &#8211; Test Driven Development (TDD) l\u00e0 th\u1ef1c h\u00e0nh Agile \u0111\u1ec3 kh\u1eed b\u1ecf th\u1eadt nhi\u1ec1u l\u1ed7i c\u00f3 th\u1ec3 &hellip; <\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[24],"tags":[],"class_list":["post-406","post","type-post","status-publish","format-standard","hentry","category-quan-li-du-an"],"_links":{"self":[{"href":"https:\/\/science-technology.vn\/index.php?rest_route=\/wp\/v2\/posts\/406","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/science-technology.vn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/science-technology.vn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/science-technology.vn\/index.php?rest_route=\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/science-technology.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=406"}],"version-history":[{"count":1,"href":"https:\/\/science-technology.vn\/index.php?rest_route=\/wp\/v2\/posts\/406\/revisions"}],"predecessor-version":[{"id":407,"href":"https:\/\/science-technology.vn\/index.php?rest_route=\/wp\/v2\/posts\/406\/revisions\/407"}],"wp:attachment":[{"href":"https:\/\/science-technology.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=406"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/science-technology.vn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=406"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/science-technology.vn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=406"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}