Upload
sqalab
View
33.633
Download
1
Embed Size (px)
Citation preview
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Характеристикикачестваавтотестов© 2015 Алексей Баранцев
Software-Testing.Ru
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Кто здесь?Алексей Баранцев[email protected]
http://software-testing.ru/http://selenium2.ru/
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Как оценить качество?
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Серия стандаров 250NN
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Серия стандартов 25000
• ГОСТ Р ИСО/МЭК 25010– модель качества продукта– модель качества при использовании
• ГОСТ Р ИСО/МЭК 25012– модель качества данных
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Цели моделей качества
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
ГОСТ Р ИСО/МЭК 25010
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Функциональная пригодность
•Функциональнаяполнота•Функциональнаякорректность•Функциональнаяцелесообразность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Целесообразность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Функциональная пригодность
•Функциональнаяполнота•Функциональнаякорректность•Функциональнаяцелесообразность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Пример №1@Rulepublic TemporaryFolder tempDir = new TemporaryFolder();
@Testpublic void canCreateFileWithValidName() throws IOException { String validName = "test.txt"; File f = new File(tempDir.getRoot(), validName); f.createNewFile();}
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Пример №2@Rulepublic TemporaryFolder tempDir = new TemporaryFolder();
@Testpublic void canCreateFileWithValidName() throws IOException { String validName = "test.txt"; File f = new File(tempDir.getRoot(), validName); Assert.assertTrue(f.createNewFile());}
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Пример №3@Rulepublic TemporaryFolder tempDir = new TemporaryFolder();
@Testpublic void canCreateFileWithValidName() throws IOException { String validName = "test.txt"; File f = new File(tempDir.getRoot(), validName); assertTrue(f.createNewFile()); assertTrue(f.exists());}
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Пример №4@Rulepublic TemporaryFolder tempDir = new TemporaryFolder();
@Testpublic void canCreateFileWithValidName() throws IOException { String validName = "test.txt"; File f = new File(tempDir.getRoot(), validName); assertTrue(f.createNewFile()); assertTrue(f.exists()); assertEquals(1, tempDir.getRoot().listFiles().length);}
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Функциональная пригодность
•Функциональнаяполнота•Функциональнаякорректность•Функциональнаяцелесообразность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Уровень производительности
• Временные характеристики•Использование ресурсов•Потенциальные возможности
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Параллельность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Шаблон проектирования «Сон»
http://www.slideshare.net/orgeirIngvarsson/ui-automation-patterns-sleep
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Уровень производительности
• Временные характеристики•Использование ресурсов•Потенциальные возможности
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Та самая пирамида
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Совместимость• Сосуществование•Интероперабельность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Изоляция тестов@ClassRulepublic static TemporaryFolder tempDir = new TemporaryFolder();
@Testpublic void canCreateFileWithValidName1() throws IOException { String validName = "test.txt"; File f = new File(tempDir.getRoot(), validName); assertTrue(f.createNewFile());}
@Testpublic void canCreateFileWithValidName2() throws IOException { String validName = "test.txt"; File f = new File(tempDir.getRoot(), validName); assertTrue(f.createNewFile());}
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Oops…
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Совместимость• Сосуществование•Интероперабельность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Failed to start up socket within 45000 ms
OpenQA.Selenium.WebDriverException: Failed to start up socket within 45000 msResult StackTrace:at OpenQA.Selenium.Firefox.Internal.ExtensionConnection.ConnectToBrowser(TimeSpan timeToWait) at OpenQA.Selenium.Firefox.Internal.ExtensionConnection.Start() at OpenQA.Selenium.Firefox.FirefoxDriver.StartClient() at OpenQA.Selenium.Remote.RemoteWebDriver..ctor(ICommandExecutor commandExecutor, ICapabilities desiredCapabilities) at OpenQA.Selenium.Firefox.FirefoxDriver..ctor(FirefoxBinary binary, FirefoxProfile profile) at OpenQA.Selenium.Firefox.FirefoxDriver..ctor()
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Взаимодействие с баг-трекером
@Test@Bug(12345)public void testSomething() { Assert.assertTrue(someOperationWithBug());}
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
TestNG и MantisBTpublic class AssumeBugIsFixed implements IAnnotationTransformer { public void transform(ITestAnnotation annotation, Class testClass, Constructor testConstructor, Method testMethod) { Bug bugAnnotation = testMethod.getAnnotation(Bug.class); if (bugAnnotation != null) { try { MantisConnectLocator mcl = new MantisConnectLocator(); MantisConnectPortType mcp = mcl.getMantisConnectPort( new URL("http://localhost/mantisbt-1.2.17/api/soap/mantisconnect.php")); IssueData issue = mcp.mc_issue_get("administrator", "root", BigInteger.valueOf(bugAnnotation.value())); String status = issue.getStatus().getName(); if (! ("closed".equals(status) || "resolved".equals(status))) { annotation.setEnabled(false); } } catch (Exception e) { e.printStackTrace(); } } }}
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Удобство использования
• Определимость пригодности• Изучаемость• Управляемость• Защищенность от ошибки пользователя• Эстетика пользовательского интерфейса• Доступность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Пользовательский интерфейс
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Доступность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Тоже доступность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Удобство использования
• Определимость пригодности• Изучаемость• Управляемость• Защищенность от ошибки пользователя• Эстетика пользовательского интерфейса• Доступность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Надёжность• Завершённость• Готовность•Отказоустойчивость• Восстанавливаемость
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Позаботься о себе самdef test_delete_some_group(app, db):
if len(db.get_group_list()) == 0: app.group.create(Group(name="test"))
group = random.choice(db.get_group_list()) app.group.delete_group_by_id(group.id)
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Эффект домино
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Защищённость• Конфиденциальность•Целостность•Неподдельность•Отслеживаемость•Подлинность
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Переносимость• Адаптируемость• Устанавливаемость• Взаимозаменяемость
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Пример №6@Rulepublic TemporaryFolder tempDir = new TemporaryFolder(new File("C:/temp"));
@Testpublic void canCreateFileWithValidName() throws IOException { String validName = "test.txt"; File f = new File(tempDir.getRoot(), validName); assertTrue(f.createNewFile());}
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Пример №7@Testpublic void deleteGroup() { driver.get(baseUrl + "/addressbook/group.php");
driver.findElement( By.xpath("//input[@value='42']")).click();
driver.findElement(By.name("delete")).click();}
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Сопровождаемость•Модульность• Возможностьмногократного использования• Анализируемость•Модифицируемость• Тестируемость
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Читайте хорошие книжки
Алексей Баранцев Software-Testing.Ru Selenium2.Ru facebook.com/groups/selenium.ru/ [email protected] skype:barancev
Удачной автоматизации!
Алексей Баранцев[email protected]
http://software-testing.ru/http://selenium2.ru/