Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                                  Ìîòèâàöèîííàÿ                                      Âíåäðåíèå                       ...
Intro                                  Ìîòèâàöèîííàÿ                                      Âíåäðåíèå                       ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                               Ìîòèâàöèîííàÿ                                   Âíåäðåíèå                             ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Intro                             Ìîòèâàöèîííàÿ                                 Âíåäðåíèå                                 ...
Upcoming SlideShare
Loading in …5
×

Pragmatic Test Driven Development. Практика.

672 views

Published on

Доклад в двух частях (практика и теория) от специалистов компании SaM Solutions, применявших TDD на практике.
Теория: http://www.slideshare.net/samsolutionsby/pragmatic-test-driven-development-18180858

0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
672
On SlideShare
0
From Embeds
0
Number of Embeds
228
Actions
Shares
0
Downloads
1
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

Pragmatic Test Driven Development. Практика.

  1. 1. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå Ïðàêòèêà Pragmatic Test Driven Development. Ïðàêòèêà Âëàä mend0za Øàõîâ Linux and Embedded department SaM Solutions March 2012SaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  2. 2. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàOutline: Êðàòêîå ñîäåðæàíèå è òåìû þíèò-òåñòèðîâàíèå ôóíêöèîíàëüíîå òåñòèðîâàíèå çàïóñê òåñòîâ è ïðîâåðêà ðåçóëüòàòîâ êîíòðîëü ïîêðûòèÿ òåñòàìè êîäà óòèëèòû è áèáëèîòåêè (Free Software) íà ïðèìåðå 2õ ðåàëüíûõ embedded ïðîåêòîâ äëÿ ÿçûêà ïðîãðàììèðîâàíèÿ ÑèSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  3. 3. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÀ íàäî ëè âîîáùå òåñòèðîâàòü? Çà÷åì êîçå áàÿí TDD ?SaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  4. 4. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÏðè÷èíû ïî÷åìó ÄÀ òåñòèðóåò ñàì ðàçðàáîò÷èê ýòî òîæå ïðîãðàììèðîâàíèåSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  5. 5. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÏðè÷èíû ïî÷åìó ÄÀ òåñòèðóåò ñàì ðàçðàáîò÷èê ýòî òîæå ïðîãðàììèðîâàíèå ñîîòâåñòâèå òðåáîâàíèÿì ãàðàíòèÿ, ÷òî âàø êîä äåëàåò âñ¼ êàê íàäîSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  6. 6. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÏðè÷èíû ïî÷åìó ÄÀ òåñòèðóåò ñàì ðàçðàáîò÷èê ýòî òîæå ïðîãðàììèðîâàíèå ñîîòâåñòâèå òðåáîâàíèÿì ãàðàíòèÿ, ÷òî âàø êîä äåëàåò âñ¼ êàê íàäî êîíòðîëü êîððåêòíîñòè èçìåíåíèé èñïðàâëåíèÿ ëåãêî ïðîâåðèòü ïðîñòî çàïóñòèâ òåñòûSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  7. 7. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÏðè÷èíû ïî÷åìó ÄÀ òåñòèðóåò ñàì ðàçðàáîò÷èê ýòî òîæå ïðîãðàììèðîâàíèå ñîîòâåñòâèå òðåáîâàíèÿì ãàðàíòèÿ, ÷òî âàø êîä äåëàåò âñ¼ êàê íàäî êîíòðîëü êîððåêòíîñòè èçìåíåíèé èñïðàâëåíèÿ ëåãêî ïðîâåðèòü ïðîñòî çàïóñòèâ òåñòû ìåíåäæåðü¼ è çàêàç÷èêè ëþáÿò êðàñèâûå öèôðû TDD äàñò öèôðû äëÿ îò÷¼òàSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  8. 8. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÏðè÷èíû ïî÷åìó ÄÀ òåñòèðóåò ñàì ðàçðàáîò÷èê ýòî òîæå ïðîãðàììèðîâàíèå ñîîòâåñòâèå òðåáîâàíèÿì ãàðàíòèÿ, ÷òî âàø êîä äåëàåò âñ¼ êàê íàäî êîíòðîëü êîððåêòíîñòè èçìåíåíèé èñïðàâëåíèÿ ëåãêî ïðîâåðèòü ïðîñòî çàïóñòèâ òåñòû ìåíåäæåðü¼ è çàêàç÷èêè ëþáÿò êðàñèâûå öèôðû TDD äàñò öèôðû äëÿ îò÷¼òà èòîãî êà÷åñòâî è óïðàâëÿåìîñòü ðàçðàáîòêè óëó÷øèòñÿSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  9. 9. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÂíåäðåíèå. Ïðîñòûå ðåöåïòû Òåñòû áåç ïðîâåðêè ïîêðûòèÿ - áåñïîëåçíû Sad but true a a Metallica c 1993 Sad but true singleSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  10. 10. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÂíåäðåíèå. Ïðîñòûå ðåöåïòû Òåñòû áåç ïðîâåðêè ïîêðûòèÿ - áåñïîëåçíû Sad but true a a Metallica c 1993 Sad but true single Ìàëåíüêèé ïðîåêò - ïðîñòûå ïðîöåññûSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  11. 11. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÂíåäðåíèå. Ïðîñòûå ðåöåïòû Òåñòû áåç ïðîâåðêè ïîêðûòèÿ - áåñïîëåçíû Sad but true a a Metallica c 1993 Sad but true single Ìàëåíüêèé ïðîåêò - ïðîñòûå ïðîöåññû Áîëüøîé ïðîåêò - ãåìîððîéíûå èíñòðóìåíòû R R Rational Purify íàïðèìåðSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  12. 12. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÂíåäðåíèå. Ïðîñòûå ðåöåïòû Òåñòû áåç ïðîâåðêè ïîêðûòèÿ - áåñïîëåçíû Sad but true a a Metallica c 1993 Sad but true single Ìàëåíüêèé ïðîåêò - ïðîñòûå ïðîöåññû Áîëüøîé ïðîåêò - ãåìîððîéíûå èíñòðóìåíòû R R Rational Purify íàïðèìåð Ôèçèêà çàêîíû ìàêðîìèðà è ìèêðîìèðà îòëè÷àþòñÿ êîðåííûì îáðàçîìSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  13. 13. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÑáîðî÷íàÿ ñèñòåìà 1 Äîáàâëÿåì êîìïèëÿöèþ òåñòîâ â ñáîðêó 2 Âêëþ÷àåì ïîäñ÷¼ò ïîêðûòèÿ gcov : CFLAGS+= - -coverage 1 CFLAGS += −DDEBUG (DEBUG) −g −− c o v e r a g e =$ BINARY_TEST = unit_test 3 OBJ_TEST = test / test . o source / fts_binsearchtree . o 5 $ (BINARY_TEST) : $ ( OBJ) $ (OBJ_TEST) $ (CC) $ (CFLAGS) $ (LDFLAGS) −o $@ $^ / usr / l i b / libcheck . a 7 check : $ (BINARY_TEST) $ (CONFIG_SPACE_PATH) 9 . / $ (BINARY_TEST) $ (CONFIG_SPACE_PATH) [SaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  14. 14. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÊàê ðàçðàáàòûâàåì 1: êîä è òåñòû test/test.c 1 START_TEST( c o n f i g _ s p a c e _ c h e c k _ t e s t ) { 3 int ret = c o n f i g _ s p a c e _ c h e c k ( nvram_basedir , BMCInst ) ; fail_if ( ret != −1 , config_space_check ( ) must return −1 ) ; 5 } END_TESTSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  15. 15. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÊàê ðàçðàáàòûâàåì 2: êîìïèëÿöèÿ è çàïóñê test/test.c $ make check 96%: Checks: 27, Failures: 1, Errors: 0 test/test.c:54:F:Cong Space:test_init:0: path should not open test/test.c:1524:P:Cong Space:cong_space_check_test:0: Passed test/test.c:1561:P:Cong Space:string_with_zero_test:0: Passed test/test.c:1595:P:Cong Space:migration_test:0: PassedSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  16. 16. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÊàê ðàçðàáàòûâàåì 3: ïðîâåðêà ïîêðûòèÿ ïðîâåðêà ïîêðûòèÿ ãäå îòðàáîòàëè, ãäå íå âîøëè + ñòàòèñòèêàSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  17. 17. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÊàê ðàçðàáàòûâàåì 3: ïðîâåðêà ïîêðûòèÿ ïðîâåðêà ïîêðûòèÿ ãäå îòðàáîòàëè, ãäå íå âîøëè + ñòàòèñòèêà ggcovSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  18. 18. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÏðèìåð 1. Áèáëèîòåêà ñ âíåøíèì API Ïðîåêò: ïðîøèâêà BMC ñåðâåðîâ Fujitsu Primergy Íàçíà÷åíèå: óïðàâëåíèå ïåðåìåííûìè äëÿ IPMI-ñòåêà Ðîëü TDD: òîëüêî Unit-òåñòèðîâàíèå Èíñòðóìåíû è ëèáû TDD: check, gcc/gcov, ggcovSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  19. 19. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÏðèìåð 2. Óïðàâëÿþùåå ÏÎ ïðîøèâêè Ïðîåêò: 4-õ êàíàëüíûé âèäåîðåãèñòðàòîð Íàçíà÷åíèå: óïðàâëÿþùåå ÏÎ â user-space Ðîëü TDD: Unit Testing, Functional Testing, Integration Testing, ýìóëÿöèÿ îáîðóäîâàíèÿ Èíñòðóìåíû è ëèáû TDD: cunit, make, gcc/gcov, ggcov, Linux KernelSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  20. 20. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå Ïðàêòèêàèíñòðóìåíòû Unit-test frameworks 1. check - http://check.sourceforge.net 2. cunit - http://cunit.sourceforge.net Coverage tools 3. Ðàñøèðåíèå gcov - âñòðîåíî â GCC (- -coverage) 4. ggcov tool - http://ggcov.sourceforge.net Âåñü èíñòðóìåíòàðèé - äîñòóïåí â äèñòðèáóòèâàõ, ïîä ñâîáîäíûìè ëèöåíçèÿìèSaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà
  21. 21. Intro Ìîòèâàöèîííàÿ Âíåäðåíèå ÏðàêòèêàÂîïðîñû? Âàøè âîïðîñû www: http://www.sam-solutions.com email: v.shakhov@sam-solutions.net jabber: mend0za@jabber.org.bySaM Solutions: Linux and Embedded department Pragmatic Test Driven Development. Ïðàêòèêà

×