SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our User Agreement and Privacy Policy.
SlideShare uses cookies to improve functionality and performance, and to provide you with relevant advertising. If you continue browsing the site, you agree to the use of cookies on this website. See our Privacy Policy and User Agreement for details.
Successfully reported this slideshow.
Activate your 14 day free trial to unlock unlimited reading.
1.
Slides baseados no trabalho de SebastianBergmann, traduzido por José Ricardo (PHPMS) e adaptado por Silvano Girardi (PHPSC)<br />Original: http://sebastian-bergmann.de/talks/<br />
2.
Olá eu sou a TestFest<br />Objetivos<br />Aumentar a abrangência do código do interpretador de PHP (com testes)<br />Motivar usuários a participar, (re|con)tribuir com o PHP<br />Unir e motivar membros do grupo de usuário<br />Qualificar o participante com uma nova ferramenta<br />Atividade Global<br />Em 2009: Países de todo mundo já realizaram TestFests<br />PHPSP: Primeiro voluntário do Brasil e Segundo a realizar um testfest<br />Próximas oportunidades<br />PHPBR: TestFest durante o FISL (24 a 27/Junho)<br />
3.
Como será nosso dia?<br />Preparação<br />Palestra e apresentação ao PHPT<br />Instalação de VMs para trabalho<br />Configurações<br />Escolha<br />Escolher áreas que iremos focar<br />Dividir em grupos de trabalho<br />MadCodingSkillz Time<br />Escrever testes<br />Testar testes<br />Finalização<br />Verificar impacto (%)<br />Commitar testes para repositório SVN do PHP<br />
4.
PHPT<br />Cada arquivo .phpt possui um unico teste<br />Cada teste é executado por um processo separado<br />Isolamento total do teste<br />Configuração do PHP independente para cada teste<br />A suite de testes sobrevive a erros fatais, segfaults, etc..<br />PHPT: http://phpt.info<br />
5.
Dando nome ao seu filho<br />Testes queilustramfalhasreportadas (bugs)<br />bug<bugid>.phpt<br />Testes de comportamentobásico de umafunção<br /><functionname>_basic.phpt<br />Testes de comportamentoerrôneo de umafunção<br /><functionname>_error.phpt<br />Testes de variações no comportamento de umafunção<br /><functionname>_variation.phpt<br />Testes variadosparaextensões<br /><extname><no>.phpt<br />
6.
O Teste mais simples do mundo<br />--TEST--<br />Hello World<br />--FILE--<br />Hello World<br />--EXPECT--<br />Hello World<br />
17.
Mexendo nas Configurações<br />--TEST--<br />Definindo um fusoparaportabilidade<br />--INI--<br />date.timezone=UTC<br />--FILE--<br />--EXPECT--<br />
18.
Portavel e Seletivo<br />--TEST--<br />Verificando se estamosemumaplataforma de 32 bits...<br />--SKIPIF--<br /><?php<br />if (PHP_INT_SIZE!=4)die('32bit platforms only');<br />?><br />--FILE--<br />--EXPECT--<br />
19.
Portavel e Seletivo<br />--TEST--<br />Verificando se estamos no Linux...<br />--SKIPIF--<br /><?php<br />if (!stristr(PHP_OS, 'Linux'))die('Linux only');<br />?><br />--FILE--<br />--EXPECT--<br />
20.
Fui eu!<br />--TEST--<br />Um teste com umaseção de créditos<br />--CREDITS--<br />Jack <jack@phpsp.org.br><br />#testfest São Paulo on 2009-06-20<br />--FILE--<br />--EXPECT--<br />
28.
License<br />This presentation material is published under the Attribution-Share Alike 3.0 Unported license.<br />You are free:<br />to Share – to copy, distribute and transmit the work.<br />to Remix – to adapt the work.<br />Under the following conditions:<br />Attribution. You must attribute the work in the manner specified by the author or licensor (but not in any way that suggests that they endorse you or your use of the work).<br />Share Alike. If you alter, transform, or build upon this work, you may distribute the resulting work only under the same, similar or a compatible license.<br />For any reuse or distribution, you must make clear to others the license terms of this work.<br />Any of the above conditions can be waived if you get permission from the copyright holder.<br />Nothing in this license impairs or restricts the author's moral rights.<br />
29.
Licença<br />Este material paraapresentaçãoépublicado sob a licença “Attribution-Share Alike 3.0 Unported”.<br />Vocêélivrepara:<br />Compartilhar – copiar, distribuiretransmitirotrabalho.<br />Alterar – adaptarotrabalho.<br />Sob as seguintescondições:<br />Atribuição. Vocêdeveatribuirotrabalhonamaneiraespecificadapeloautoroulicenciador (masnão de maneira a sugerirqueelesteapóiamvocêou a maneiracomovocêutilizaotrabalho).<br />Distribuadamesma forma. Se vocêalterar, transformarouconstruiralgobaseando-se nestetrabalho, vocêdevedistribuirotrabalhoresultanteapenas sob a mesmalicença, umalicença similar oucompatível.<br />Para qualquerreusooudistribuição, vocêdevedeixarclaroaosoutrosostermos de licenciamentodestetrabalho. <br />Qualqueruma das condiçõesacimapode ser ignorada se vocêobtiver a permissões do proprietário dos direitosautorais. <br />Nada nestalicençadanificaourestringeosdireitosmorais do autor.<br />