Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Ferramentas de teste para a linguagem
Python
Jos´
e Fonseca
Faculdade de Engenharia da Universidade do Porto
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Estrutura da apresenta¸
c˜
ao
1
Introdu¸
c˜
ao `
a linguagem Python
2
Ferramentas para testes unit´
arios
doctest
PyUnit
3
Ferramentas para cobertura de c´
odigo
coverage.py
4
Ferramentas para profiling
Python profiler
5
IDEs
eric3
PyDev
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao
Testes unit´arios doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python – Breve descri¸
c˜
ao da linguagem
interpretada
interactiva
orientada por objectos (tudo ´
e um objecto, heran¸ca m´
ultipla)
introspectiva
sintaxe elegante (indenta¸c˜
ao faz parte da sintaxe)
suporte nativo para alguns tipos de dados de alto n´ıvel (string,
list, dictionary)
biblioteca rica (express˜
oes regulares, HTTP, XML, . . . )
extens´ıvel (com m´
odulos compilados em C ou C++)
embeb´ıvel noutra aplica¸
c˜
ao (ABAQUS, Blender, Paint Shop Pro
8, Vim, . . . )
port´
avel (Unix, Windows, Mac OS, Nokia S60, . . . )
v´
arios toolkits gr´
aficos dispon´ıveis (TK, GTK, QT, wxWidgets,
. . . )
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao
Testes unit´arios doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python – Exemplo de uma sess˜
ao interactiva
$ p y t h o n P y t h o n 2 . 3 . 5 (#2 , Mar 27 2005 , 0 9 : 4 3 : 3 1 ) [ GCC 3 . 3 . 5 ( D e b i a n 1 : 3 . 3 . 5 - 1 2 ) ] on l i n u x 2 T y p e " h e l p " , " c o p y r i g h t " , " c r e d i t s " or " l i c e n s e " for m o r e i n f o r m a t i o n . > > > tax = 1 2 . 5 / 1 0 0 > > > p r i c e = 1 0 0 . 5 0 > > > p r i c e * tax 1 2 . 5 6 2 5 > > > p r i c e + _ 1 1 3 . 0 6 2 5 > > > r o u n d ( _ , 2) 1 1 3 . 0 6 > > >
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao
Testes unit´arios doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python – Exemplo de uma fun¸
c˜
ao
ex func.py
def prime(n):
”””Retorna verdadeiro ou falso consoante n ´
e um
n´
umero primo.”””
for i in range(2, n):
# ciclo de 2 a n−1
if not n % i:
# resto da divis˜
ao inteira
return False
return True
print prime(10)
print prime(11)
$ p y t h o n e x _ f u n c . py F a l s e T r u eFerramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao
Testes unit´arios doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python – Exemplo de uma classe
ex class.py
class Complex:
”””Representa¸
c˜
ao de um n´
umero complexo.”””
def
init (self, real=0.0, imag=0.0):
”””Constructor.”””
self.real = real
self.imag = imag
def
mul (self, other):
”””Produto de dois n´
umeros complexos.”””
return Complex(
self.real∗other.real − self.imag∗other.imag,
self.real∗other.imag + self.imag∗other.real)
def conj(self):
return Complex(self.real, −self.imag)
def
str (self):
”””Representa¸
c˜
ao textual do n´
umero.”””
return
”%g+%gi”
% (self.real, self.imag)
# formata¸
c˜
ao
a = Complex(1,2)
print a
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao
Testes unit´arios doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python – Exemplo de uma classe
$ p y t h o n e x _ c l a s s . py 1+2 i
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao
Testes unit´arios doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python – Mais informa¸
c˜
ao
Python homepage
http://www.python.org/
Python Introduction
http://www.python.org/doc/Introduction.html
Python Tutorial
http://www.python.org/doc/current/tut/
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
doctest – Descri¸
c˜
ao
Procura na pr´
opria documenta¸c˜
ao do c´
odigo a especifica¸c˜
ao de
casos de teste.
Os casos de teste servem quer para verifica¸c˜
ao quer para
exemplifica¸c˜
ao do uso.
Pode ser usado em m´
odulos, fun¸c˜
oes, classes e m´
etodos.
Parte da biblioteca standard da linguagem.
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
doctest – Exemplo
ex doctest.py
def factorial(n):
”””Return the factorial of n, an exact integer >= 0.
If the result is small enough to fit in an int, return an int.
Else return a long.
>>> [factorial(n) for n in range(6)]
[1, 1, 2, 6, 24, 120]
>>> factorial(30)
265252859812191058636308480000000L
>>> factorial(−1)
Traceback (most recent call last):
...
ValueError: n must be >= 0
Factorials of floats are OK, but the float must be an exact integer:
>>> factorial(30.1)
Traceback (most recent call last):
...
ValueError: n must be exact integer
It must also not be ridiculously large:
>>> factorial(1e100)
Traceback (most recent call last):
...
OverflowError: n too large
”””
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
doctest – Exemplo
import math
if not n >= 0:
raise ValueError(
”n must be >= 0”
)
if math.floor(n) != n:
raise ValueError(
”n must be exact integer”
)
if n+1 == n:
# catch a value like 1e300
raise OverflowError(
”n too large”
)
result = 1
factor = 2
while factor <= n:
result ∗= factor
factor += 1
return result
if
name
==
” main ”
:
import doctest
doctest.testmod()
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
doctest – Exemplo
$ p y t h o n e x _ d o c t e s t . py - v R u n n i n g _ _ m a i n _ _ . _ _ d o c _ _ 0 of 0 e x a m p l e s f a i l e d in _ _ m a i n _ _ . _ _ d o c _ _ R u n n i n g _ _ m a i n _ _ . f a c t o r i a l . _ _ d o c _ _ T r y i n g : [ f a c t o r i a l ( n ) for n in r a n g e (6) ] E x p e c t i n g : [1 , 1 , 2 , 6 , 24 , 1 2 0 ] ok T r y i n g : f a c t o r i a l ( 3 0 ) E x p e c t i n g : 2 6 5 2 5 2 8 5 9 8 1 2 1 9 1 0 5 8 6 3 6 3 0 8 4 8 0 0 0 0 0 0 0 L ok T r y i n g : f a c t o r i a l ( -1) E x p e c t i n g : T r a c e b a c k ( m o s t r e c e n t c a l l l a s t ) : ... V a l u e E r r o r : n m u s t be >= 0 ok T r y i n g : f a c t o r i a l ( 3 0 . 1 ) E x p e c t i n g : T r a c e b a c k ( m o s t r e c e n t c a l l l a s t ) : ... V a l u e E r r o r : n m u s t be e x a c t i n t e g e r ok T r y i n g : f a c t o r i a l (1 e 1 0 0 ) E x p e c t i n g : T r a c e b a c k ( m o s t r e c e n t c a l l l a s t ) : ... O v e r f l o w E r r o r : n too l a r g e ok 0 of 5 e x a m p l e s f a i l e d in _ _ m a i n _ _ . f a c t o r i a l . _ _ d o c _ _ 1 i t e m s had no t e s t s : _ _ m a i n _ _ 1 i t e m s p a s s e d all t e s t s : 5 t e s t s in _ _ m a i n _ _ . f a c t o r i a l 5 t e s t s in 2 i t e m s . 5 p a s s e d and 0 f a i l e d . T e s t p a s s e d .Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
doctest – Mais informa¸
c˜
ao
Manual de referˆ
encia do m´
odulo doctest
http://docs.python.org/lib/module-doctest.html
Testing frameworks in Python
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
PyUnit – Descri¸
c˜
ao
´
E uma vers˜
ao em Python da framework JUnit.
Suporta a automa¸c˜
ao de testes, a partilha de c´
odigo de
inicializa¸c˜
ao e finaliza¸c˜
ao de testes, a agrega¸c˜
ao de testes em
colec¸c˜
oes, e a separa¸c˜
ao entre os testes e a interface com o
utilizador.
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
PyUnit – Exemplo
ex unittest.py
import random
# m´
odulo a testar
import unittest
# defini¸
c˜
ao da classe para casos de teste
class TestSequenceFunctions(unittest.TestCase):
def setUp(self):
self.seq = range(10)
def testshuffle(self):
# certifica que a sequˆ
encia baralhada n˜
ao perdeu elementos
random.shuffle(self.seq)
self.seq.sort()
self.assertEqual(self.seq, range(10))
def testchoice(self):
element = random.choice(self.seq)
self.assert (element in self.seq)
def testsample(self):
self.assertRaises(ValueError, random.sample, self.seq, 20)
for element in random.sample(self.seq, 5):
self.assert (element in self.seq)
if
name
==
’ main ’
:
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
PyUnit – Exemplo
$ p y t h o n e x _ u n i t t e s t . py - v t e s t c h o i c e ( _ _ m a i n _ _ . T e s t S e q u e n c e F u n c t i o n s ) ... ok t e s t s a m p l e ( _ _ m a i n _ _ . T e s t S e q u e n c e F u n c t i o n s ) ... ok t e s t s h u f f l e ( _ _ m a i n _ _ . T e s t S e q u e n c e F u n c t i o n s ) ... ok -Ran 3 t e s t s in 0 . 0 0 0 s OKFerramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
PyUnit – Mais informa¸
c˜
ao
Manual de referˆ
encia do m´
odulo unittest
http://docs.python.org/lib/module-unittest.html
PyUnit homepage
http://pyunit.sf.net/
Testing frameworks in Python
http://www.ibm.com/developerworks/linux/library/l-cptest.html
Dive Into Python: Unit Testing
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
coverage.py – Descri¸
c˜
ao
´
E um m´
odulo em Python que mede a cobertura de linhas de
c´
odigo durante a execu¸c˜
ao.
Usa as ferramentas de an´
alise de c´
odigo e as callbacks de
depura¸c˜
ao de c´
odigo fornecidas pela biblioteca standard da
linguagem para determinar quais as linhas execut´
aveis e quais
foram executadas, respectivamente.
Acumula a informa¸c˜
ao das instru¸c˜
oes executadas ao longo de
v´
arias execu¸
c˜
oes.
Gera relat´
orios e/ou anota o c´
odigo fonte com as linhas
cobertas.
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
coverage.py – Exemplo
ex coverage.py
def abs(x):
if x < 0:
return −x
else:
return x
print abs(−1)
$ p y t h o n c o v e r a g e . py - e $ p y t h o n c o v e r a g e . py - x e x _ c o v e r a g e . py $ p y t h o n c o v e r a g e . py - r - m e x _ c o v e r a g e . py N a m e S t m t s E x e c C o v e r M i s s i n g -e x _ c o v -e r a g -e 5 4 80% 5 $ p y t h o n c o v e r a g e . py - a e x _ c o v e r a g e . pyex coverage.py anotado
1
> d e f a b s ( x ) :
2
>
i f
x < 0 :
3
>
r e t u r n −x
4
!
e l s e :
5
!
r e t u r n x
6
7
> p r i n t
a b s ( −1)
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
coverage.py – Mais informa¸
c˜
ao
coverage homepage
http://www.nedbatchelder.com/code/modules/coverage.html
Statement coverage for Python
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python profiler – Descri¸
c˜
ao
Profiling determin´ıstico de qualquer programa em Python.
Ferramentas para gerar relat´
orios de modo a permitir examinar
os resultados da opera¸c˜
ao de profiling.
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python profiler – Estat´ısticas por fun¸
c˜
ao
ncalls
n´
umero de chamadas
tottime
tempo total gasto na fun¸c˜
ao (excluindo o tempo gasto
em chamadas a sub-fun¸c˜
oes)
percall
quociente de tottime por ncalls
cumtime
tempo total gasto na fun¸c˜
ao e todas as sub-fun¸c˜
oes
(desde a invoca¸c˜
ao at´
e ao retorno)
percall
quociente de percall por ncalls
filename:lineno(function)
referˆ
encia `
a fun¸
c˜
ao
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python profiler – Exemplo 1
ex profile1.py
def ismultiple(n, i):
return n % i == 0
def isprime(n):
for i in range(2,n):
if ismultiple(n, i):
return False
return True
def main():
for i in range(2,1000):
if isprime(i):
print i,
main()
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python profiler – Exemplo 2
ex profile2.py
primes = []
# guardar os primos anteriores
def ismultiple(n, i):
return n % i == 0
def isprime(n):
import math
global primes
sn = int(math.sqrt(n))
for i in primes:
if i > sn:
# terminar na raiz quadrada
break
if ismultiple(n, i):
return False
primes.append(n)
return True
def main():
for i in range(2,1000):
if isprime(i):
print i,
main()
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python profiler – Resultados
$ p y t h o n - m p r o f i l e e x _ p r o f i l e 1 . py 2 3 5 7 11 13 17 19 23 29 31 37 41 43 47 53 59 61 67 71 73 79 83 89 97 101 103 107 109 113 127 131 137 139 149 151 157 163 167 173 179 181 191 193 197 199 211 223 227 229 233 239 241 251 257 263 269 271 277 281 283 293 307 311 313 317 331 337 347 349 353 359 367 373 379 383 389 397 401 409 419 421 431 433 439 443 449 457 461 463 467 479 487 491 499 503 509 521 523 541 547 557 563 569 571 577 587 593 599 601 607 613 617 619 631 641 643 647 653 659 661 673 677 683 691 701 709 719 727 733 739 743 751 757 761 769 773 787 797 809 811 821 823 827 829 839 853 857 859 863 877 881 883 887 907 911 919 929 937 941 947 953 967 971 977 983 991 997 7 9 0 2 3 f u n c t i o n c a l l s in 0 . 5 3 0 CPU s e c o n d s O r d e r e d by : s t a n d a r d n a m e n c a l l s t o t t i m e p e r c a l l c u m t i m e p e r c a l l f i l e n a m e : l i n e n o ( f u n c t i o n ) 1 0 . 0 0 0 0 . 0 0 0 0 . 5 2 0 0 . 5 2 0 < string > : 1 ( ? ) 1 0 . 0 0 0 0 . 0 0 0 0 . 5 2 0 0 . 5 2 0 e x _ p r o f i l e 1 . py : 1 ( ? ) 7 8 0 2 1 0 . 2 3 0 0 . 0 0 0 0 . 2 3 0 0 . 0 0 0 e x _ p r o f i l e 1 . py :1( i s m u l t i p l e ) 1 0 . 0 0 0 0 . 0 0 0 0 . 5 2 0 0 . 5 2 0 e x _ p r o f i l e 1 . py : 1 0 ( m a i n ) 998 0 . 2 9 0 0 . 0 0 0 0 . 5 2 0 0 . 0 0 1 e x _ p r o f i l e 1 . py :4( i s p r i m e ) 1 0 . 0 1 0 0 . 0 1 0 0 . 5 3 0 0 . 5 3 0 p r o f i l e :0( e x e c f i l e ( ’ e x _ p r o f i l e 1 . py ’) ) 0 0 . 0 0 0 0 . 0 0 0 p r o f i l e :0( p r o f i l e r ) $ p y t h o n - m p r o f i l e e x _ p r o f i l e 2 . py ... 3 8 0 2 f u n c t i o n c a l l s in 0 . 0 4 0 CPU s e c o n d s O r d e r e d by : s t a n d a r d n a m e n c a l l s t o t t i m e p e r c a l l c u m t i m e p e r c a l l f i l e n a m e : l i n e n o ( f u n c t i o n ) 1 0 . 0 0 0 0 . 0 0 0 0 . 0 2 0 0 . 0 2 0 < string > : 1 ( ? ) 1 0 . 0 0 0 0 . 0 0 0 0 . 0 2 0 0 . 0 2 0 e x _ p r o f i l e 2 . py : 1 ( ? ) 1 0 . 0 0 0 0 . 0 0 0 0 . 0 2 0 0 . 0 2 0 e x _ p r o f i l e 2 . py : 1 8 ( m a i n ) 2 8 0 0 0 . 0 0 0 0 . 0 0 0 0 . 0 0 0 0 . 0 0 0 e x _ p r o f i l e 2 . py :3( i s m u l t i p l e ) 998 0 . 0 2 0 0 . 0 0 0 0 . 0 2 0 0 . 0 0 0 e x _ p r o f i l e 2 . py :6( i s p r i m e ) 1 0 . 0 2 0 0 . 0 2 0 0 . 0 4 0 0 . 0 4 0 p r o f i l e :0( e x e c f i l e ( ’ e x _ p r o f i l e 2 . py ’) ) 0 0 . 0 0 0 0 . 0 0 0 p r o f i l e :0( p r o f i l e r )
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Python profiler – Mais informa¸
c˜
ao
Manual de referˆ
encia do m´
odulo profile
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
IDEs – eric3
Escrito em Python.
Integra ferramentas de:
debugging
unit testing
code coverage
profiling
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
IDEs – eric3
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
IDEs – eric3
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
IDEs – PyDev
Plug-in para o eclipse (escrito em Java).
Integra ferramentas de:
debugging
code coverage
refactoring
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
IDEs – PyDev
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
IDEs – PyDev
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
IDEs – Mais informa¸
c˜
ao
eric3 Python IDE
http://www.die-offenbachs.de/detlev/eric3.html
PyDev Eclipse plugin
http://pydev.sf.net/
Integrated Development Environments – PythonInfo Wiki
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas
Outras ferramentas
Python debugger
http://docs.python.org/lib/module-pdb.html
Pylint – analisa estaticamente c´
odigo python `
a procura de bugs ou c´
odigo
de m´
a qualidade
Ferramentas de teste para a linguagem Python Jos´e Fonseca Introdu¸c˜ao Testes unit´arios
doctest PyUnit Cobertura de c´odigo coverage.py Profiling Python profiler IDEs eric3 PyDev Outras ferramentas