Presentation is loading. Please wait.

Presentation is loading. Please wait.

Functional Testing with the Java Stack Test Runner.

Similar presentations


Presentation on theme: "Functional Testing with the Java Stack Test Runner."— Presentation transcript:

1 Functional Testing with the Java Stack Test Runner

2 DisclaimerDisclaimer This is a training not a presentation. Please be prepared to:  Learn  Ask questions  Participate in the lab Prerequisites: Knowledge of Maven (required) Java Stack ALM Training (recommended) This is a training not a presentation. Please be prepared to:  Learn  Ask questions  Participate in the lab Prerequisites: Knowledge of Maven (required) Java Stack ALM Training (recommended)

3 What we’ll cover… In this training, we will discuss  What is functional testing?  How is it unique from other forms of testing?  What is the Java Stack Test Runner?  How does it integrate with Maven and AnthillPro?  How do I invoke Test Runner from my IDE?  Where do I find my functional test results? In this training, we will discuss  What is functional testing?  How is it unique from other forms of testing?  What is the Java Stack Test Runner?  How does it integrate with Maven and AnthillPro?  How do I invoke Test Runner from my IDE?  Where do I find my functional test results?

4 What we won’t cover… Topics that we will not have time to discuss are: Testing frameworks and APIs i.e. TestNG, Selenium, Spock, etc. Testing methodologies Writing tests Test case management tools Topics that we will not have time to discuss are: Testing frameworks and APIs i.e. TestNG, Selenium, Spock, etc. Testing methodologies Writing tests Test case management tools

5 First, some background…

6 Stages of Testing *We will discuss functional testing and how it differs from unit and integration testing.

7 Unit Testing  Scope Narrow (single class or method)  Purpose Validates small units of code  Responsible Party Code developer  Failure : Indicates code is broken Typically fails the build * Has direct dependencies on application code

8 Integration Testing  Scope Medium (spans two integrated systems)  Purpose Validate code that integrates with another system. (e.g. a database or web service)  Responsible Party Code developer.  Failure : Indicates failure of systems to communicate as expected. Does not typically fail the build. * Has direct dependencies on application code.

9 Functional Testing  Scope Broad (end-to-end feature testing)  Purpose Validate functional requirements and/or user stories  Responsible Party QA resource or feature developer  Failure : Indicates failure to meet user story requirements Results recorded in test case management and/or bug tracker * Has little or no direct dependencies on application code.

10 Functional Testing and Application Life-cycle Management (ALM)

11 ALM Build Tools Maven Project definition Dependency management Plug-in configuration and management Build profiles Maven Project definition Dependency management Plug-in configuration and management Build profiles AnthillPro Manages build processes Creation of build artifact(s) Deployment to server environment Functional test execution Maintains build life history Provides ability to re-execute a process on any build life AnthillPro Manages build processes Creation of build artifact(s) Deployment to server environment Functional test execution Maintains build life history Provides ability to re-execute a process on any build life

12 ALM Tools: Maven Life-cycles The default Maven build life-cycle (simplified):  compile  test (unit tests)  package  integration-test (integration tests)  install (to local Maven repository)  deploy (to remote Maven repository) Where do we plug in functional testing?

13 ALM Tools: Maven Life-cycles The woes of having “one build to rule them all”: Functional Testing ≠ Integration Testing Confuses build with server deployment Must re-build to re-deploy or re-test Complicates build management Less productive use of build agents

14 ALM Tools: Maven Life-cycles The Java Stack ALM build life-cycle (simplified):  alm-db (run database scripts)  alm-deploy (deploy application to server)  alm-test (run functional tests)  alm-promote (run all previous phases) This life-cycle is available to the artifact produced by the “alm” module of a Java Stack project.

15 ALM Tools: Maven Life-cycle Advantages of a second build life-cycle: Clean separation of configuration: One configuration for build One configuration for deployment and/or functional testing Separate processes: One process for building artifact One process for deployment and/or functional testing Simplified build management More productive use of build agents

16 ALM Tools: Test Runner In Stack 3.2, as part of its ALM tooling, the Java Stack introduced the “test-bundle” artifact as a part of its suite of testing plug-ins, collectively known as “Test Runner”: Why another artifact? Why another tool?

17 ALM Tools: The Test Bundle The “test” jar  Not an executable jar  Difficult to execute without help from Maven.  Relied on maven to supply its dependencies.  Difficult to execute tests from past code revisions. The “test” jar  Not an executable jar  Difficult to execute without help from Maven.  Relied on maven to supply its dependencies.  Difficult to execute tests from past code revisions. The “test-bundle” jar An executable jar Can be executed with or without Maven. Comes packaged with all its dependencies. Each test artifact represents a snapshot of the current code revision. The “test-bundle” jar An executable jar Can be executed with or without Maven. Comes packaged with all its dependencies. Each test artifact represents a snapshot of the current code revision.

18 ALM Tools: Test Runner The “failsafe:test” goal Supports TestNG Supports test suites Supports environment configuration Produces JUnit and TestNG reports.  Executes tests from the target/classes folder The “failsafe:test” goal Supports TestNG Supports test suites Supports environment configuration Produces JUnit and TestNG reports.  Executes tests from the target/classes folder The “stack-test:functional-test” goal Supports TestNG Supports test suites Supports environment configuration Produces JUnit and TestNG reports. Executes “test-bundle” artifact. The “stack-test:functional-test” goal Supports TestNG Supports test suites Supports environment configuration Produces JUnit and TestNG reports. Executes “test-bundle” artifact.

19 ALM Tools: Functional Test Goal Common configuration for stack-test:functional-test: testBundle – groupId and artifactId of QA test bundle testEnv – the test environment properties to load skipFTs – whether to skip functional tests suiteXmlResources – TestNG suites to load includes – test class patterns (e.g. **/*FT.class) systemPropertyVariables – custom system properties argLine – JVM arguments (e.g. memory options, debugger, etc.) For the additional options, see: http://code.lds.org/maven-sites/stack/modules/test/

20 ALM Tools: The Test Bundle Simple to upgrade existing QA projects. 1. Upgrade the project to Stack 3.2 Then change the QA pom’s packaging type from to 2. Add QA module as a dependency to the ALM module. jar test-bundle ${project.groupId} example-qa ${project.version} test-bundle

21 ALM Tools: The Test Bundle 3. Bind the functional-test goal to the alm-test phase: org.lds.stack.test stack-test-maven-plugin test functional-test alm-test org.lds.training.testrunner.lab1 testrunner-lab1-qa

22 ALM Tools: The Test Bundle 4. Modify build profiles to fit your needs test false test

23 Lab #1 A Simple QA Test Bundle Project https://tech.lds.org/wiki/Functional_Testing_with_the_Java_Stack_Test_Runner

24 Lab #2 Running Functional Tests in AnthillPro https://tech.lds.org/wiki/Functional_Testing_with_the_Java_Stack_Test_Runner

25 Credits The Apache Maven Project: http://maven.apache.org/ Urban Code, for it’s AnthillPro documentation: http://www.urbancode.com/html/products/anthillpro/ The Dark Lord Sauron, for the quote, “One ring to rule them all”. (The Lord of the Rings, by J.R.R. Tolkien) The Apache Maven Project: http://maven.apache.org/ Urban Code, for it’s AnthillPro documentation: http://www.urbancode.com/html/products/anthillpro/ The Dark Lord Sauron, for the quote, “One ring to rule them all”. (The Lord of the Rings, by J.R.R. Tolkien)

26

27


Download ppt "Functional Testing with the Java Stack Test Runner."

Similar presentations


Ads by Google