38
Automation For Developers

Automation for developers

Embed Size (px)

DESCRIPTION

Automation has bing a demanding field with the growth of the aoganization. This presentation includes mind mapping series of slides in path of quality asspect for developers

Citation preview

Page 1: Automation for developers

Automation For Developers

Page 2: Automation for developers

● We are super developers and we don't make mistakes.

● I never do changes to my code.

● I am the life time owner of my code.

● I am the only person who use each component I build.

● We have telepathic.

● My code runs on each platform

○ Its platform vendor’s responsibility to make

platforms unique.

Page 3: Automation for developers
Page 4: Automation for developers

What do you think ??????

Page 5: Automation for developers

Who write the code ??

Who works with your code??

Page 6: Automation for developers

Page 7: Automation for developers

“Quality is free, but only to thosewho are willing to pay heavily for it.”

- Lister, Demarco: “Peopleware”

Page 8: Automation for developers

Page 9: Automation for developers

Testing Good Bad And Ugly

Page 10: Automation for developers

Page 11: Automation for developers

●●

Page 12: Automation for developers

Page 13: Automation for developers

Page 14: Automation for developers

Understanding - Cost of test Wrong way

Page 15: Automation for developers

Understanding - Cost of test Right way

Page 16: Automation for developers

Basic Understanding - Unit Test

● Focused on testing behavior of a

particular class, module or method.

● Smallest part of the application.

● Fast (less than 0.1 second per test)

● No external implementation

dependencies

(filesystem, database, web services, etc.). All

dependencies are faked for the test context.

● Can easily be parallelized, since each test is atomic

Page 17: Automation for developers

Basic Understanding - Integration Test

● Focused on verifying the integration

of one or more components together.

● May have external dependencies.

● A test that takes longer than a unit

Test should

Integration Tests - with in WSO2 ● Executes on product pack created by build.

● Not depending on other product environments.

● Independent.

● Lightweight.

● Covers only scenarios related to features on individual product.

Page 18: Automation for developers

●●

○○○○○○○

●M = E − N + 2P,

where

E = the number of edges of the graph.

N = the number of nodes of the graph.

P = the number of Connected Components

●fi

Page 19: Automation for developers

●●●●

Page 20: Automation for developers

Jacoco /EclEmma coverage report

Emma coverage report

Page 21: Automation for developers

● Platform scenarios.

● Integration scenarios.

● UI scenarios.

● Real world use cases.

● Performance and Security scenarios.

● Patches provided.

Page 22: Automation for developers

How tests really looks like

Platform - Platform Tests

Cross Platform Tests

Product - Integration Tests

Component - Unit Tests

Component - Unit Tests

Component - Unit Tests

Component - Unit Tests

Product - Integration Tests

Component - Unit Tests

Component - Unit Tests

Component - Unit Tests

Component - Unit Tests

Product - Integration Tests

Component - Unit Tests

Component - Unit Tests

Component - Unit Tests

Component - Unit Tests

Product - Integration Tests

Component - Unit Tests

Component - Unit Tests

Component - Unit Tests

Component - Unit Tests

Page 23: Automation for developers
Page 24: Automation for developers

What got better and bigger

● Lightweight test execution engine.

● More focus on platform wide scenarios.

● More user friendly configuration management.

● Ability to extend TestNG based listener implementation

○ Ability to plugin custom servers like Tomcat, CXF ,ActiveMQ,

Apache FTP and more.

● Ability to come up with your automation story.

Page 25: Automation for developers

Organization Test Automation Framework modules

Engine

Extensions Admin Service API

Core - Utilities

Automation Test

Core Servers External Tools

Extensibility Modules

Configuration

Page 26: Automation for developers

Overall Architecture

Configuration

Support Modules Test Automation Framework

Test

Build platform -Maven

Test Trigger- Surefire

Testing Framework - TestNg

Test Suite

platform

Automation.xml

Coverage

Instrumentation.txt

Pluggable Extensions

TestNg Listener Extension Modules

Test Tooling Extensions

Server Management

Tenant Management

Engine

TestNg Listener Extensions

Configuration Management

Context Management

Extensible module handling

Admin Service API

Reusable core utils

filter.txt

Test Configurations

TestNg.xmlTestNg.xmlTestNg.xml

Page 27: Automation for developers

Flexibilities Provided

● Manage several products inside single test.

● Manage users in several product domains.

● Deployment of artifacts for different products under

different users.

● Configured admin service clients as test oriented API.

● Retrieving test environment configurations easily.

● Running same test in both local and Stratos environments.

● Reporting TestNg and surefire reports for all your tests.

● Tooling support of Selenium and Jmeter.

Page 28: Automation for developers

Technologies for Automation

Test Framework Build Systems

Code Coverage

Extensibility Support

UI Automation

Page 29: Automation for developers

● Like JUnit but not JUnit

● Annotation based Architecture

● Test Grouping

● Extensibility features

○ Listeners

○ Bean Shell

○ Annotation Transformers

● Easiness of managing Test cases.

● Failed test execution (Straight and easy)

Page 30: Automation for developers

○ Trigger out TestNg.

○ Control TestNG flow (Through Surefire TestNg Utils)

○ Generate reports. (HTML, XML and emailable report)

Page 31: Automation for developers

Execution Started@BeforeSuite

@BeforeTest

@AfterTest

@AfterSuite

Execution Closed

@BeforeClass

@BeforeGroups

@BeforeMethod

@AfterMethod

@AfterGroups

@AfterClass

Page 32: Automation for developers

● Listeners are interfaces allows to modify TestNG's

behavior.

● Listeners are binned to a testNg execution.

● Listeners implement the interface org.testng.ITestListener○ IExecutionListener

■ Triggers at start and end of any execution.■ ISuiteListener.

○ ISuiteListener■ Triggers at suite start and end.ITestListener■ Triggers at Test start, Finish, Failure, Skip and partial failure.

● Reporters implement the interface org.testng.IReporter ○ Notified when all the suites have been run by TestNG. ○ The IReporter instance receives a summary of entire test run

Page 33: Automation for developers

○ Offline instrumentation

○ On fly instrumentation

○ LOC coverage

○ Class coverage

○ cyclomatic complexity

Page 34: Automation for developers

Common Extensions

Automation.xml

Test Suite

Test Suite Extensions

Test Suite Utilities

Test classes

Automation Framework Engine

Page 35: Automation for developers

Page 36: Automation for developers

● Includes all utility classes that can play supportive role inside a test.

○ Ex :-

■ Axis2 client.

■ Wire message monitor.

■ Custom server startup scenarios (Axis2, Tomcat, ActiveMQ).

■ Concurrency test scenarios.

■ Rest Clients.

● Provides common methodology for all development

teams and Automation team to maintain a set

of supportive classes without changing the Core.

Page 37: Automation for developers

Questions?

Happy Automation !!