Написание юнит-тестов большинству представляется занятием скучным и до некоторой степени бесполезным. Мое мнение — это всё оттого, что сама "классическая" схема юнит-тестов подразумевает непродуктивное написание унылого линейного кода.
В докладе я расскажу о том, как с помощью pytest начать писать тесты, которые приятно читать и поддерживать, почему setUp и tearDown — это прошлый век, как с помощью правильной организации fixtures ускорить исполнение тестов, а также какие ещё уловки могут помочь вам в вашей нелегкой борьбе с рутиной.
Basics of Iterators and Generators,Uses of iterators and generators in python. advantage of iterators and generators. difference between generators and iterators.
Arquitetura básica de testes para seu projeto JavaElias Nogueira
Palestra ministrada no The Developers Conference São Paulo 2017 dia 21/07 na Trilha Arquitetura Java.
Nesta apresentação falo da importância de planejar testes em diversos níveis dentro de um processo de desenvolvimento, bem como uma build pipeline ideal pensando em testes e dicas do que devemos ter na nossa arquitetura de teste para uma aplicação em Java.
Basics of Iterators and Generators,Uses of iterators and generators in python. advantage of iterators and generators. difference between generators and iterators.
Arquitetura básica de testes para seu projeto JavaElias Nogueira
Palestra ministrada no The Developers Conference São Paulo 2017 dia 21/07 na Trilha Arquitetura Java.
Nesta apresentação falo da importância de planejar testes em diversos níveis dentro de um processo de desenvolvimento, bem como uma build pipeline ideal pensando em testes e dicas do que devemos ter na nossa arquitetura de teste para uma aplicação em Java.
In the automotive industry, and in Quality Assurance, we always hear about the Production Part Approval Process (PPAP). This is a dossier that is submitted as part of qualifying new parts and processes regarding to the manufacturing. It is interesting to note that the PPAP process, as defined by the Automotive Industry Action Group (AIAG) only really applies to what was traditionally the Detroit Big Three (GM, Ford, Chrysler), or to companies like John Deere and Company or Caterpillar. I am not explaining the AIAG PPAP process in this post, as it has been done previously in a previous slideshare cited below:
http://www.slideshare.net/JEETQA/ppap
The tutorial will give you a brief introduction to Generators in Python. Next, you will learn the advantages of using generators in Python. Further, you will know the utility of the next() function.
After that, we will have hands-on demonstrations for Generators in Python.
Slides from my talk at Reversim 2021 convention (also passed a talk with the same slide at PyWeb-IL, 2022-03) in Tel-Aviv, Israel.
The recording of the talk is on youtube, here: https://www.youtube.com/watch?v=ahGLUdW3cqk&ab_channel=Reversim.
You can find more information, and services to help you get started on my website, https://propertybasedtesting.com.
The talk introduces property-based testing, a software testing technique that improves the ROI of automated tests.
While with standard tests, we need to work hard, hand-coding many examples - with property-based tests the computer generates hundreds or thousands of tests for us.
The random generation saves us a lot of effort, and also has a surprising tendency to come up with edge cases we would have never thought to test.
This helps us find bugs sooner and more easily, and have more confidence in our code.
The talk covered the basics of property-based tests.
It also gave the feeling for the power and variety of real-world use cases, by taking a CRUD web application and letting our test explore the application’s external API and find bugs in edge cases we didn’t know.
See the last slides for extra resources.
Introduction of TestNG framework and its benefits over Junit frameworkBugRaptors
TestNG is a testing framework stirred from NUnit and JUnit but presenting some new functionalities that make it much easier and powerful to use. It is an open source automated testing framework; in which NG means Next Generation. TestNG is much more influential than JUnit but is inspired by JUnit. It is developed to be better than JUnit, specifically while testing integrated classes. We should thank Cedric Beust who has created TestNG.
In the field of software testing, Static & Dynamic Testing are two important testing techniques that help validate the quality of various software components, such as program code, documentation, etc
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
In this introduction to Test Driven Development (TDD) or Behaviour Driven Development (BDD) we give a high level description of what it is and why it is useful for developers. Then we go into some details on stubs and mocks, test data, UI testing, SQL testing, JavaScript testing, web services testing and how to start doing TDD/BDD on an existing code base.
Дмитрий Лукьяненко: Первый фреймворк на Selenium + TestNGDataArt
Дмитрий Лукьяненко, QA Automation рассматривает:
- Selenium IDE;
- Selenium WebDriver;
- Page Obgect Pattern;
- Page Factory Pattern;
- локаторы;
- как построить фреймворк и куда его можно дальше развивать.
In the automotive industry, and in Quality Assurance, we always hear about the Production Part Approval Process (PPAP). This is a dossier that is submitted as part of qualifying new parts and processes regarding to the manufacturing. It is interesting to note that the PPAP process, as defined by the Automotive Industry Action Group (AIAG) only really applies to what was traditionally the Detroit Big Three (GM, Ford, Chrysler), or to companies like John Deere and Company or Caterpillar. I am not explaining the AIAG PPAP process in this post, as it has been done previously in a previous slideshare cited below:
http://www.slideshare.net/JEETQA/ppap
The tutorial will give you a brief introduction to Generators in Python. Next, you will learn the advantages of using generators in Python. Further, you will know the utility of the next() function.
After that, we will have hands-on demonstrations for Generators in Python.
Slides from my talk at Reversim 2021 convention (also passed a talk with the same slide at PyWeb-IL, 2022-03) in Tel-Aviv, Israel.
The recording of the talk is on youtube, here: https://www.youtube.com/watch?v=ahGLUdW3cqk&ab_channel=Reversim.
You can find more information, and services to help you get started on my website, https://propertybasedtesting.com.
The talk introduces property-based testing, a software testing technique that improves the ROI of automated tests.
While with standard tests, we need to work hard, hand-coding many examples - with property-based tests the computer generates hundreds or thousands of tests for us.
The random generation saves us a lot of effort, and also has a surprising tendency to come up with edge cases we would have never thought to test.
This helps us find bugs sooner and more easily, and have more confidence in our code.
The talk covered the basics of property-based tests.
It also gave the feeling for the power and variety of real-world use cases, by taking a CRUD web application and letting our test explore the application’s external API and find bugs in edge cases we didn’t know.
See the last slides for extra resources.
Introduction of TestNG framework and its benefits over Junit frameworkBugRaptors
TestNG is a testing framework stirred from NUnit and JUnit but presenting some new functionalities that make it much easier and powerful to use. It is an open source automated testing framework; in which NG means Next Generation. TestNG is much more influential than JUnit but is inspired by JUnit. It is developed to be better than JUnit, specifically while testing integrated classes. We should thank Cedric Beust who has created TestNG.
In the field of software testing, Static & Dynamic Testing are two important testing techniques that help validate the quality of various software components, such as program code, documentation, etc
Test and Behaviour Driven Development (TDD/BDD)Lars Thorup
In this introduction to Test Driven Development (TDD) or Behaviour Driven Development (BDD) we give a high level description of what it is and why it is useful for developers. Then we go into some details on stubs and mocks, test data, UI testing, SQL testing, JavaScript testing, web services testing and how to start doing TDD/BDD on an existing code base.
Дмитрий Лукьяненко: Первый фреймворк на Selenium + TestNGDataArt
Дмитрий Лукьяненко, QA Automation рассматривает:
- Selenium IDE;
- Selenium WebDriver;
- Page Obgect Pattern;
- Page Factory Pattern;
- локаторы;
- как построить фреймворк и куда его можно дальше развивать.
Промышленный подход к автоматизации тестирования или Keyword-driven testing в...Maksim Grinevich
Доклад описывает промышленный подход к организации процесса автоматизации тестирования. Если у вас серьезный проект ни на один человекогод и необходимо внедрять автоматизацию, либо сделать так, чтобы она, наконец, заработала – предлагаю рассмотреть нашу реализацию как один из возможных выходов из ситуации.
Автотесты генерируют специалисты в предметной области, а не тестировщики-программисты. Сценарии тестирования пишутся в формате xml с использованием "стандартных операций". Эти операции поддерживаются генератором автотестов и автоматизированы на VBScript (QuickTestPro).
Доклад может быть интересен тем, кто вплотную занимается автоматизацией либо пытается разобраться в этом вопросе.
лившиц владимир - независимое тестирование мифMagneta AI
Сюжет этой короткометражки рассказывает о том, как можно трансформировать «незавсимую» команду тестирования для обеспечения качества в нескольких Scrum командах (работающих в одном известном инвест-банке). Это почти что боевик о ломке устоявшихся принципов и небоязни меняться. Обсуждается вопрос: приносят тест-кейсы пользу? Тут есть немного философии: отношения тестировщиков и не совсем к тестированию и качеству в Agile командах.
Presentation from https://heisenbug-piter.ru/en/talks/2018/spb/kkw6oivsoywayacggksmk/
Once upon a time, we got a requirement to finish all testing in 2 days despite the number of tests to run. That number grew, and grew, and grew, and now there are tens of millions of them. So this is a story about building a dam against the never-ending flood which turned out to be not that scary. You are very welcome to join and see it for yourself.
14. pytest fixtures
Наивный подход. Как это бы сделал я сам
file: fixtures.py
def get_user():
return User(name='Roman', age=30, ...)
file: test_user.py
def test_user():
user = get_user()
assert user.name == 'Roman'
29. Как ещё использовать fixtures
• warnings: turn MySQL warnings to errors
• mock: подготовка mockup объектов
• freezegun: управление временем
• selenium: запуск веб-драйвера
30. О чём я ещё не рассказал
def pytest_addoption(parser):
parser.addoption("cleanmysql",
action="store_true", default=False)
@pytest.fixture(scope='session', autouse=True)
def clean_mysql(request):
if not request.config.getoption('cleanmysql'):
return
# clean MySQL tables heres
31. О чём я ещё не рассказал
@pytest.mark.parametrize("input,expected", [
("3+5", 8),
("2+4", 6),
])
def test_eval(input, expected):
assert eval(input) == expected
32. О чём я ещё не рассказал
• pytest-django: интеграция с Django
• pytest-xdist: параллельные и
распределенные тесты
33. О чём я ещё не рассказал
• tox: выполнение тестов для разных python
• detox: то же самое, только параллельно
[tox]
envlist = py26,py27
[testenv]
deps=pytest
commands=py.test