Tuesday, August 15, 2017

Database testing



Useful tools for Database testing

-todo-- http://www.seleniumeasy.com/selenium-tutorials/database-testing-example-with-selenium-using-java

DATAGRIP:    https://www.jetbrains.com/datagrip/
dbforge:   https://www.devart.com/dbforge/sql/studio/


Database testing is a test type in which data manipulation, integrity, data comparison etc operations can be verified.
Database testing is a subset of functional testing & performance testing.
We can conduct database testing manually and also automated.
Data Integrity: Data is stored in correct place.
Ex: Name and ID values interchanged while saving in DB, so Integrity error.

Database scenarios:
1. Add record
2. Update record
3. Delete record
4. Data Integrity
5. Data Authentication
6. Data Comparision - (front end data with backend data)
7. Data Comparision - (two databases)
8. Data Comparision different data sources (Database vs Excel)
9. Data Backup
10. Data Recovery

Parts of Database: data and schema

Schema: Datastructures in the database is called as Schema.
Table, Columns, Stored Procedure, Views, Functions, Trigger are the parts of the schema.
Stored Procedure : Contains Input and Output
Functions: Contains only Input, No Output



Schema testing:
·         Table: Table name should be meaningful name short/long
·         Contains all necessary columns.
·         Correct keys
·         Unique information - no duplicate
·         unnecessary columns
·         Columns: Correct data type, data size, Name constraints and relationship( Ex Foreign key)
·         View:
·         Stored Procedure : exec storeprocedureName 'param1' 'param2'
·         Functions

Data testing:
·         Is data correct w.r.t Source(UI, other), complete, unambiguous, unique and fresh ?
·         Source: User Entered in UI / XML / another database
·         Column - Is the data format(correct space, characters, capitalization) correct and not truncated ?
do the keys match ?

Database testing challenges
·         large size - scope the test items, test according to database test plan(Ex: newly created)
·         Incorrect / scaled-down database - Test production database(or copy with or without obfuscation)
·         Many companies they take copy of production database and hide sensitive database ( Ex. Credit card information ) , where ever sensitive we can use null
·         Frequent changes:
·         Analyze impact, re-design tests and re-test impacted objects

Database testing approach
·         Gather database requirements
·         Create test scenarios against each requirement
·         Test schema, data and test scenarios
·         Negative testing
·         Performance testing for throughput and response times.
·         Security testing – user has restricted access and try to access
·         Use SQL queries(faster) or query builder(slower method)
·         Organize tests into test suites.
·         Automate tests as far as possible. We can run as a batch one after the other.

Database test plan:
·         Introduction – db name and application
·         Scope – Important items, in scope, out of scope
·         Test approach – list of test and approaches.
·         Test environment – database copy, server, tools
·         Test activates and schedule –requirements analysis, test design test execution, results analysis and reporting
·         Responsibilities – Test lead, tester
·         Deliverable – Test queries, bug reports, tested db
·         Risks – mitigation and contingency plans


Sample database test plan:


2 Video
https://www.youtube.com/watch?v=1ozPUHBfseY
https://www.udemy.com/framework-development-with-selenium-csharp-advanced/

https://www.youtube.com/watch?v=CjNqKlTluxc
https://www.youtube.com/watch?v=1ozPUHBfseY
https://www.youtube.com/watch?v=md_x6Yr2fgM
--
 https://www.youtube.com/watch?v=sRaPFn9ZQDs





Thursday, July 27, 2017

Big O notation



Big O specifically describes the worst-case scenario, and can be used to describe the execution time required or the space used (e.g. in memory or on disk) by an algorithm

The rate of growth of time with respect to input. 

https://www.quora.com/What-are-some-easy-ways-to-understand-and-calculate-the-time-complexity-of-algorithms




Sunday, July 23, 2017

SOLID Principles and Design Patterns



http://www.dotnetcurry.com/tutorials/software-gardening

S
O
L
I
D

BDD : Behavior Driven Development



http://specflow.org/getting-started/

http://www.dotnetcurry.com/patterns-practices/1375/behavior-driven-development-bdd

http://specflow.org/documentation/Unit-Test-Providers/


Steps:

1. Open Visual Studio --> Tools --> Extension and Update
    Specflow

2. Create a Unit test Project
    Select project --> Nuget Manager
     Specflow
     install Specflow and NUnit

3.  App.Config , Add following
<specFlow>  
  <unitTestProvider name="MSTest"></unitTestProvider>
</specFlow>

4. Create new Item,
  Specflow. feature file
  Right Click on Feature file in Test Editor  --> Generate Steps

5. Build , Open test explore and select the test case
     Execute


Wednesday, July 19, 2017

Test data generator tools


http://www.mockaroo.com/

http://www.generatedata.com/

http://www.datanamic.com/datagenerator/index.html

http://wiki.c2.com/?TestDataGenerator

https://webresourcesdepot.com/test-sample-data-generators/

http://www.softwaretestingmagazine.com/tools/open-source-test-data-generators/

http://toolsfordatabases.com/test-data-generation-tools.html

https://www.quora.com/What-are-the-tools-used-for-test-data-generation




Thursday, July 13, 2017

Command prompt cmd.exe c#


MSIEXEC


Microsoft Windows Installer (Windows 7/2008).

https://ss64.com/nt/msiexec.html

**********************************************************************

https://stackoverflow.com/questions/17613216/how-to-pause-cmd-before-it-close

https://www.microsoft.com/resources/documentation/windows/xp/all/proddocs/en-us/cmd.mspx?mfr=true

Specify the K parameter instead of C
From Microsoft documentation:
/c : Carries out the command specified by string and then stops.
/k : Carries out the command specified by string and continues.


proc.Arguments = "/K ""ipconfig" 


Example:

using System.Diagnostics;
 
namespace ConsoleApplication7
{
    class Program
    {
        static void Main(string[] args)
        {
            string cmd = @"xcopy C:\abc\1\1.txt C:\abc\2\";
            ExecuteCommand(cmd);
        }
 
 
        public static string ExecuteCommand(string command)
        {
 
            ProcessStartInfo procStartInfo = new ProcessStartInfo("cmd""/k " + command)
            {
                UseShellExecute = false,
                CreateNoWindow = false,
                WindowStyle = ProcessWindowStyle.Maximized
            };
 
            using (Process proc = new Process())
            {
                proc.StartInfo = procStartInfo;
                proc.Start();
 
                string output = proc.StandardOutput.ReadToEnd();
 
                if (string.IsNullOrEmpty(output))
                    output = proc.StandardError.ReadToEnd();
 
                return output;
            }
 
        }
    }
 
}

Thursday, July 6, 2017

Python & Java


Tools to Code:

Python online interpreter

https://realpython.com/blog/python/setting-up-sublime-text-3-for-full-stack-python-development/

https://sourceforge.net/projects/pyscripter/


Java file executing and JVM

.java file (source code file) is compiled in to bytecode(.class file). Bytecode is platform independent, it can you distributed to any OS.   

JVM is platform dependent, its depends on Operating system, Processor. JVM comes with different version for different operating system.

The .Class file will be converted into Machine code by Windows JVM or Linux JVM depends on operating system.  The machine code will be used by processor and the program will execute. 

JMeter Simple Controller

  Simple Controller is just a  container  for user request.