пʼятниця, 21 жовтня 2022 р.

Types of performance testing

 Load testing is testing the behavior of the application under different load conditions where multiple users access it simultaneously.

When you want to understand if your system is meeting the performance goals, this is the type of test you'll run.

Run a load test to:

  • Asses the current performance of your system under typical and peak load.
  • Can be used to simulate a normal day in your system

Stress testing is a type of performance testing used to determine the limits of the system.
The purpose of this testing is to verify the stability and reliability of the system under extreme conditions.

Run a stress test to:

  • Determine how your system will behave under extreme conditions.
  • Determine what is the maximum capacity of your system in terms of users or throughput.
  • Determine the breaking point of your system and its failure mode.

Spike testing is a variation of stress test, but it does not gradually increase the load, instead it spikes to extreme load over a very short window of time.

Run a spike test to:

  • Determine how your system will perform under a sudden surge of traffic.
  • Determine if your system will recover without manual intervention after the traffic has subsided.

Success is based on expectations. System will generally react in 1 of 4 ways:

  1. Excellent: system performance is not degrated during the surge of traffic. Response time is similar during low traffic and high traffic
  2. Good: response time is slower, but the system does not produce any errors. All requests are handled
  3. Poor: system produces errors during the surge of traffic, but recovers to normal after the traffic subside
  4. Bad: system crashes, and does not recover after the traffic has subside

Soak testing is used to validate reliability of the system over a long time. A soak test is a long-running test that is used to determine application performance and/or stability over time. An application may work well for an hour or two, and then start to experience issues. These tests are especially useful when trying to track down memory leaks or corruption.

Run a soak test to:

  • Verify that your system does not suffer from bugs or memory leaks

Capacity testing is a test to determine how many users your application can handle before either performance or stability becomes unacceptable. As usual we start performance testing from capacity testing. We find max users and throughput which server can process

Quality characteristics:

  • Response time
  • Throughput (number of requests in second) - represents the ability of the server to handle heavy load. The higher the throughput is, the better is the server performance.
  • Concurrency

Types of metrics:

  • application-side metrics (response time (average, median, min, max), throughput, error, users)
  • server-side metrics (CPU and Memory usage)

Reports:

  • jmeter generate html report
  • blazemeter
  • Taurus
  • Grafana

How to start performance testing:

  1. capacity testing (take 1000 users and big rump-up time)

зображення.png

понеділок, 2 квітня 2018 р.

Day 1: five ideas


  1. Make a list of ideas that you can add to the application
  2. Determine which new modern technologies can be used
  3. Count ROI automation
  4. Determine the testing strategy
  5. Determine the testing risks

понеділок, 20 березня 2017 р.

Checklist: Is Your Automation Future Proof?

1. Is your framework modular?
2. Are objects identified uniquily?
3. Can your framework adapt to changes?
4. Object syncronization is implemented
5. Tests have been provided with with unique test data
6. Scripts are running in a controlled state
7. Have you implemented fail-over scenarios?
8. Test scripts are independent
9. Global configuration has been implemeted
10. The tear-dow and set-up approaches are implemented in scripts
11. A separate environment is used for automation
12. The core framework and business logic are separate 
13. Does the test data reside in separate files
14. Naming and coding convention are followed
15. Re-execution logic is implemented for failed test cases
16. The execution report is informative
17. The commenting guidelines are followed in your framework
18. Logging is implemented
19. Video recording is available for re-execution of failed tests
20. CI is implemented
21. You have implemented parallel execution
22. Implement test iteration

If you answered "No" to more to mare than 4 of these questions, then your automation is not yet future-proof

From www.qasource.com

How test report should looks like


Was taken from saucelabs.com

четвер, 17 листопада 2016 р.

Static

If you make the member Static, it will be shared by all the objects which you will create. There will always be only 1 copy of the Static member in the memory, no matter how many objects you will create.

середа, 16 листопада 2016 р.

ARP

ARP (англ. Address Resolution Protocol — протокол определения адреса) — протокол в компьютерных сетях, предназначенный для определения MAC-адреса по известному IP-адресу.
Рассмотрим суть функционирования ARP на простом примере. Компьютер А (IP-адрес 10.0.0.1) и компьютер Б (IP-адрес 10.22.22.2) соединены сетью Ethernet. Компьютер А желает переслать пакет данных на компьютер Б, IP-адрес компьютера Б ему известен. Однако сеть Ethernet, которой они соединены, не работает с IP-адресами. Поэтому компьютеру А для осуществления передачи через Ethernet требуется узнать адрес компьютера Б в сети Ethernet (MAC-адрес в терминах Ethernet). Для этой задачи и используется протокол ARP. По этому протоколу компьютер А отправляет широковещательный запрос, адресованный всем компьютерам в одном с ним широковещательном домене. Суть запроса: «компьютер с IP-адресом 10.22.22.2, сообщите свой MAC-адрес компьютеру с МАС-адресом (напр. a0:ea:d1:11:f1:01)». Сеть Ethernet доставляет этот запрос всем устройствам в том же сегменте Ethernet, в том числе и компьютеру Б. Компьютер Б отвечает компьютеру А на запрос и сообщает свой MAC-адрес (напр. 00:ea:d1:11:f1:11) Теперь, получив MAC-адрес компьютера Б, компьютер А может передавать ему любые данные через сеть Ethernet.

MAC-address

MAC, Media Access Control, address is a globally unique identifier assigned to network devices, and therefore it is often referred to as hardware or physical address. MAC addresses are 6-byte (48-bits) in length, and are written in MM:MM:MM:SS:SS:SS format. The first 3-bytes are ID number of the manufacturer, which is assigned by an Internet standards body. The second 3-bytes are serial number assigned by the manufacturer.

Difference between TCP and UDP

Difference between TCP and UDP

TCPUDP
Reliability: TCP is connection-oriented protocol. When a file or message send it will get delivered unless connections fails. If connection lost, the server will request the lost part. There is no corruption while transferring a message.Reliability: UDP is connectionless protocol. When you a send a data or message, you don’t know if it’ll get there, it could get lost on the way. There may be corruption while transferring a message.
Ordered: If you send two messages along a connection, one after the other, you know the first message will get there first. You don’t have to worry about data arriving in the wrong order.Ordered: If you send two messages out, you don’t know what order they’ll arrive in i.e. no ordered
Heavyweight: – when the low level parts of the TCP “stream” arrive in the wrong order, resend requests have to be sent, and all the out of sequence parts have to be put back together, so requires a bit of work to piece together.Lightweight: No ordering of messages, no tracking connections, etc. It’s just fire and forget! This means it’s a lot quicker, and the network card / OS have to do very little work to translate the data back from the packets.
Streaming: Data is read as a “stream,” with nothing distinguishing where one packet ends and another begins. There may be multiple packets per read call.Datagrams: Packets are sent individually and are guaranteed to be whole if they arrive. One packet per one read call.
Examples: World Wide Web (Apache TCP port 80), e-mail (SMTP TCP port 25 Postfix MTA), File Transfer Protocol (FTP port 21) and Secure Shell (OpenSSH port 22) etc.Examples: Domain Name System (DNS UDP port 53), streaming media applications such as IPTV or movies, Voice over IP (VoIP), Trivial File Transfer Protocol (TFTP) and online multiplayer games etc

Port

A port number is a way to identify a specific process

HTTP, HTTPS, SSH, SSL and TLS protocols

HTTP - Hypertext Transfer Protocol
application protocol responsible for transfer data. HTTP functions as a request–response protocol in the client–server computing model. A web browser, for example, may be the client and an application running on a computer hosting a website may be the server. The client submits an HTTP request message to the server. The server, which provides resources such as HTML files and other content, or performs other functions on behalf of the client, returns a response message to the client. The response contains completion status information about the request and may also contain requested content in its message body.

HTTPS
is a protocol for secure communication over a computer network which is widely used on the Internet. HTTPS consists of communication over Hypertext Transfer Protocol (HTTP) within a connection encrypted by Transport Layer Security or its predecessor, Secure Sockets Layer.

SSL - Secure Sockets Layer
is a standard security technology for establishing an encrypted link between a server and a client—typically a web server (website) and a browser, or a mail server and a mail client (e.g., Outlook).

TSL - Transport Layer Security
the same as SSL but new

SSH - Secure Shell
The best known example application is for remote login to computer systems by users. SSH provides a secure channel over an unsecured network in a client-server architecture, connecting an SSH client application with an SSH server

How is the lack of IP addresses being solved today?

NAT - Network Address Translation
devices, increasingly popular in homes and offices, allow multiple machines to share a single Internet address. 

IP, IPv4, IPv6

IP address
is short for Internet Protocol address. An IP address is an identifier for a computer or device on a TCP/IP network. The format of IP address is a 32-bit numeric address written as four numbers

IPv4
is a 32-bit numeric address written in decimal as four numbers separated by periods. Each number can be zero to 255. For example, 1.160.10.240

IPv6
In IPv6 the IP address size increased from 32-bits to 128-bits. IPv6 adress written in hexadecimal and separated by colons. An example IPv6 address could be written like this: 3ffe:1900:4545:3:200:f8ff:fe21:67cf

Differnces between hub, roter and switch

1. Hub
very primitive device. It creates a network between computers. it is impossible to manage it. If one computer send package to the another, this package is sending to the all computers  in the network

2. Switch
also create a network. One computer can send package to the another. Only this computer will receive this package

3. Router
connect networks. Links computer to the Internet. Via router you can send data between netorks

пʼятниця, 19 серпня 2016 р.

How to create database in Microsoft SQL Server and view via Visual Studio

1. Download SQL Server Express
2. Download Microsoft SQL Server Management Studio
3. On SQL Express window click on Connect now button.
or
in cmd type sqlcmd -S <ComputerName>  
As result sqlcmd window will be opend
type create database NewDB
4. type go
5. type  use NewDB
6. type go
7. type create table NewTable ( columnname1 columntype1, columnname2 columntype2)
8. type go
9. In Management Studio click on File/Connect Object Explorer
    type server name and authentication
If DB created locally you can find server name on the tpo of sqlcmd
If DB created locally authentification will be Windows Authentification
10. in Visual Studio Tools/Connect to Database type server name and authentication

четвер, 18 серпня 2016 р.

How set/get data to cache c#

1. create helper class
 public static class CacheHelper
    {
        static readonly ObjectCache Cache = MemoryCache.Default;

        public static void SaveTocache(string cacheKey, object savedItem, DateTime absoluteExpiration)
        {
            MemoryCache.Default.Set(cacheKey, savedItem, absoluteExpiration);
        }

        public static T GetFromCache<T>(string cacheKey) where T : class
        {
            return MemoryCache.Default[cacheKey] as T;
        }

        public static void RemoveFromCache(string cacheKey)
        {
            MemoryCache.Default.Remove(cacheKey);
        }

        public static bool IsIncache(string cacheKey)
        {
            return MemoryCache.Default[cacheKey] != null;
        }

        public static T Get<T>(string cacheKey, string regionName = null) where T : class
        {
           
            return MemoryCache.Default.Get(cacheKey) as T;
        }

        /// <summary>
        /// Gets all cached items as a list by their key.
        /// </summary>
        /// <returns></returns>
        public static List<string> GetAll()
        {
            return Cache.Select(keyValuePair => keyValuePair.Key).ToList();
        }
    }

2. in base class add

        /// <summary>
        ///     The general test clean.
        /// </summary>
        [TestCleanup]
        public void GeneralTestClean()
        {
            this.TestContextWithTimer.EndTimer(TestName);
           
            //Create a custom Timeout of 10 seconds
            DateTime customTimeout = DateTime.Now.AddSeconds(60.0);
            testDetailed.TestName = TestName;
            testDetailed.Date = DateTime.Now;
           
            testDetailed.Duration = this.TestContextWithTimer.TestDuration(testName).ToString();
            testDetailed.PassFail = (Microsoft.VisualStudio.TestTools.UnitTesting.UnitTestOutcome.Passed == this.TestContext.CurrentTestOutcome ? "Pass" : "Fail");
            result.Add(testDetailed);

            CacheHelper.SaveTocache(CacheKeyValue, result, customTimeout);

            //get list of keys
            List<string> getCacheKeyList = CacheHelper.GetAll();
            getCacheValueList = new Dictionary<string, List<string>>();
            foreach (var item in getCacheKeyList)
            {
                var getCacheValueFromCache = CacheHelper.GetFromCache<List<string>>(item);
                getCacheValueList.Add(item, getCacheValueFromCache);
            }
         
           this.client.Dispose();
        }

        private readonly string CacheKeyValue = "TestResultDetails " + DateTime.Now;

        private static Dictionary<string, List<string>> getCacheValueList;

        private static List<TestDetailed> endResult = new List<TestDetailed>();

        [AssemblyCleanup]
        public static void ClassCleanup()
        {                            
            foreach (string key in getCacheValueList.Keys)
            {
                foreach (string val in getCacheValueList[key])
                {
                    Console.WriteLine(val);
                }
            }        
        }

середа, 13 липня 2016 р.

Івенти


  1. Событие, это ситуация, при возникновении которой, произойдут некоторые действия. Само событие имеет определенную структуру
  2. https://habrahabr.ru/post/213809/

Делегати


  1. делегат - это класс, содержащий данные о сигнатуре метода
  2. delegate string MyDelegate(int x)
  3. http://metanit.com/sharp/tutorial/3.13.php

четвер, 23 червня 2016 р.

Test Reports with Visual Studio, NUnit and Allure

  • Firstly we need to download and install NUnit: www.NUnit.org
  • Secondly we need the Allure NUnit adaptor, follow instructions here: Allure Framework Adaptor for NUnit
  • The Allure Command Line Interface is needed, get it from here: Allure CLI
  • Java JDK needs to be installed and specified correctly in your JAVE_HOME variable in your environment

вівторок, 23 лютого 2016 р.

Git: main commands

1. git status
Основной инструмент, используемый для определения, какие файлы в каком состоянии находятся
2. git add
Для того чтобы начать отслеживать (добавить под версионный контроль) новый файл, используется команда
3. git commit