Thursday, October 31, 2019

Code testing type and used of tools




Code testing type and use of tools

Stability Testing is defined as the ability of the product to continue to function, over time and over its full range of use, without failing or causing failure.
In Stability testing under cover component
Transaction Response Times
Hits per Second
Throughput
Transaction per second
CPU: CPU percentage utilization spent during a test.
Memory: Memory usage during a test.
Disk: utilization of disk spaces spent during a test.
Stability Testing comes under Performance Testing –a technique that is performed to check some of the quality attributes of Software like stability, reliability, and availability.
Advantage of Stability Testing
  • Provide confidence in the stability of your system under test.
  • Ensure that your system can handle large programs.
  • Monitor the effectiveness of your system.
  • Test system stability under stress.
Tools used for stability testing
  • Performance Tester
  • Testing Anywhere
###  https://codingsans.com/blog/code-quality#code_quality
Code quality is a group of different attributes and requirements, determined and prioritized by according to business.
Main attributes of Code quality
Clarity
Maintainable
Documented
Refactored
Well-tested
Extendible
Efficiency
It is not possible all quality in every product but we can identified according to characteristics of project.
Tools use for code quality testing
Find Bugs
Checksystle
Sonar Qube
PMD

https://www.guru99.com/code-coverage.html
Code coverage is a measurement of how many lines/blocks/arcs of your code are executed while the automated tests are running. In code coverage system gathers information about the running program

Why use Code Coverage?

  • It helps you to measure the efficiency of test implementation
  • It offers a quantitative measurement.
  • It defines the degree to which the source code has been tested.
 Major code coverage methods
  • Statement Coverage
  • Decision Coverage
  • Branch Coverage
  • Toggle Coverage
  • FSM Coverage


Tools use for Code coverage
1.    JTest - a proprietary tool built over JUnit. (It generates unit tests as well.)
2.    Cobertura - an open source code coverage tool that can easily be coupled with JUnit tests to generate reports.
3.    Emma - another - this one we've used for a slightly different purpose than unit testing. It has been used to generate coverage reports when the web application is accessed by end-users.


Maven


Few point about maven
Maven: Lifecycle vs. Phase vs. Plugin vs. Goal
Life cycle is a sequence of named phases.

Phases executes sequentially. Executing a phase means executes all previous phases.

Plugin is a collection of goals also called MOJO (Maven Old Java Object). Most of Maven's functionality is in plugins. A plugin provides a set of goals that can be executed using the following syntax:

mvn [plugin-name]:[goal-name]

Goal is the task (action) that is executed.


Maven is based around the central concept of a build lifecycle. There are three built-in build lifecycles: default, clean and site.
The default lifecycle handles your project deployment
The clean lifecycle handles project cleaning
The site lifecycle handles the creation of your project's site documentation

Maven Lifecycle Phases default lifecycle

Lifecycle default -> [validate, initialize, generate-sources, process-sources, generate-resources, process-resources, compile, process-classes, generate-test-sources, process-test-sources, generate-test-resources, process-test-resources, test-compile, process-test-classes, test, prepare-package, package, pre-integration-test, integration-test, post-integration-test, verify, install, deploy]

Lifecycle clean -> [pre-clean, clean, post-clean]

Lifecycle site -> [pre-site, site, post-site, site-deploy]


Maven Lifecycles, Phases, Goals, Plugins


https://stackoverflow.com/questions/26607834/maven-lifecycle-vs-phase-vs-plugin-vs-goal
http://maven.apache.org/ref/3.6.2/maven-core/default-bindings.html
https://stackoverflow.com/questions/16205778/what-are-maven-goals-and-phases-and-what-is-their-difference
https://maven.apache.org/guides/introduction/introduction-to-profiles.html
https://www.baeldung.com/maven-goals-phases