More Related Content
ODP
PDF
An introduction to functional programming with Go [redux] PDF
PDF
PDF
PDF
DOCX
PDF
[C++ Korea] Effective Modern C++ Study, Item 27, 29 - 30 What's hot
PPTX
Clang-tidy: путешествие внутрь AST C++ ODP
PPTX
Алексей Кутумов, C++ без исключений, часть 3 PDF
ODP
PDF
Тененёв Анатолий, Boost.Asio в алгоритмической торговле PPTX
PDF
PDF
Rambler.iOS #8: Чистые unit-тесты PPTX
OpenResty/Lua 70+ Advanced Programming Skills and Optimization tips TXT
DOCX
DOCX
PDF
PDF
ZIP
PPTX
PPTX
Understanding Python decorators KEY
More from Adam Przybyła
PDF
Back to Future. Agile w latach 90 na Amidze. PDF
NSM as Another Gherkin Replacement in Robot Framework PDF
Mission ImpAnsible - NSM at (RobotFrame)work ODP
Aby wąż giętki robił to co wymyśli głowa, czyli słów kilka o analizie leksyk... ODP
Koniec testowania na sposób “testerski”. Zmiana paradygmatu testowania oprogr... ODP
SELinux, czyli zero-zero-day exploits - DWO 2013 PDF
ODP
Humanista w twoim linuksie ODP
Open Source i nowe technologie, czyli trochę o systemach o dużej niezawodności Mikstura it2013
- 1.
Niepraktycznie i nieskładnie
oTest Driven Development
Adam Przybyła <adam@ertel.com.pl>
(Creative Commons cc-by-nd)
Mikstura 2 Lateral Thinking - Rybnik 2013
- 2.
- 3.
[root@synergia TDD_ANTLR]# cattest_mikstura.py
#! /usr/bin/python
import unittest
class test_moj(unittest.TestCase):
def test_test(self):
self.assertTrue(False)
if __name__ == '__main__':
unittest.main()
[root@synergia TDD_ANTLR]#
- 4.
- 5.
[root@synergia TDD_ANTLR]# cattest_mikstura.py
#! /usr/bin/python
import unittest
class test_moj(unittest.TestCase):
def test_test(self):
self.assertTrue(True)
if __name__ == '__main__':
unittest.main()
[root@synergia TDD_ANTLR]#
- 6.
- 7.
#!/usr/bin/python
import unittest
import antlr3
fromCSVLexer import CSVLexer
from CSVParser import CSVParser
class test_csv(unittest.TestCase):
def setUp(self):
pass
def test_test(self):
self.assertTrue(True)
def test_lf(self):
parser=parserek("n")
wynik=parser.line()
self.assertFalse(wynik)
def test_crlf(self):
parser=parserek("rn")
wynik=parser.line()
self.assertFalse(wynik)
#@unittest.skip("omijam test")
def test_red(self):
parser=parserek("red")
wynik=parser.pole()
self.assertEqual(wynik,"red")
- 8.
grammar CSV;
Options {language=Python; }
@header {
def test1(s): print "test"
}
line returns [wynik]
scope { wynik2 }
@init { wynik =[]; $line::wynik2=[]; }
: ( (NEWLINE) => NEWLINE
| ( p1=pole {wynik.append(p1) } ( COMMA p1=pole {wynik.append(p1) } )* NEWLINE ) )
{ wynik=$line::wynik2};
COMMA : ( ' '* ',' ' '*) ;
pole returns [wynik1]
@init {
wynik1=""
try:
wyn=$line::wynik2
except IndexError:
wyn=[]
}
: ( p=ZNAWIASEM { wynik1 = $p.text;}
| p=BEZNAWIASU { wynik1 = $p.text;}
| //nic
) {wyn.append(wynik1)};
NEWLINE : 'r'? 'n';
ZNAWIASEM : ('"' ( options {greedy=false;}: . )+ '"')+
{txt = self.getText().strip('"').replace('""','"');self.setText(txt)};
BEZNAWIASU : ~('r' | 'n' | ',' | ' ' | '"')+;
- 9.
#! /usr/bin/python
# -*-coding: UTF-8 -*-
import unittest
from analizator import *
from pobieracz import *
from TDDczysciciel import Lexer
import pobieracz,analizator,warstwa_leksykalna,codecs,TDDczysciciel
class testy_pobierania(unittest.TestCase):
def setUp(self):
pass
def test_dziala(self):
self.assertTrue(True)
def test_nazwy(self):
self.assertTrue(nazwa_ma_ip("dns.ertel.com.pl"))
def test_zlej_nazwy(self):
self.assertFalse(nazwa_ma_ip("dns-45.ertel.com.pl"))
def test_pinga_dziala(self):
self.assertTrue(nazwa_odp_na_ping('127.0.0.1'))
def test_pinga_niedziala(self):
self.assertFalse(nazwa_odp_na_ping('224.0.0.0'))
- 10.
Lateral Thinking
● Wikinomia
● Wikipedia
● Wolna kultura
● Falsyfikacja jako metoda naukowa i metoda testów
- 11.