Thursday, March 1, 2018

Database Normalization


Edgar F. Codd proposed the relational model in 1970 and also Normalization.

https://stackoverflow.com/questions/8337309/superkey-candidate-key-primary-key

Normalization:
Removing inconsistent dependency and redundancy within a database is called normalization.

Denormalization:
Normalization supports for efficient data storage but it increases the time to access the related values, as when querying dbms will look into multiple table for joining tables to return values.

Performance and tracking historical data

Rows = Tuples = Records
Columns = Attributes

Super Key: A super key is a set of columns that uniquely defines a row.

Name:     Not Unique
Id:            Unique
Address:  Not Unique
Phone    :  Unique

Here Id and Phone are Unique. All the below combinations are super keys. Super keys is a superset of candidate key. Any combination which uniquely defines a row is a superkey.

  • Id
  • Id, Name
  • Id, Address
  • Id, Phone
  • Phone
  • Phone, Name
  • Phone, Id
  • Phone, Address

Below examples are not Super Keys,
Name, Address

What is Composite Key?

Primary key consists of more than one attributes/Columns is called Composite Key.


Candidate Key:
A candidate key is a "minimal" superkey. So in the above example the minimal is 1. So, we have two canditate key Id and Phone.

Primary Key: There will be

Prime attributes:
The attributes/Columns which are the part of candidate key are called Prime attributes.

Functional Dependency: means relationship among the attributes.

Functional Dependency: X → Y means that the values of Y are determined by the values of X. Two tuples sharing the same values of X will necessarily have the same values of Y. 
enter image description here
Reference: https://www.youtube.com/watch?v=7-ka5ylK_DI
A à B 
A functionally determines B

  Name
     ID
      Marks
Pradeep
    1
     62
Vinod
    2
     67
Ravi
    3
     78
Pradeep
    4
    78

In this example
IDà Name     (if you know ID, we can uniquely determine the name of the person, vice versa not holds good as same Name can be have by multiple persons. In this example there are 2 persons with name Pradeep)

IDà Marks   (With ID we can know the marks, but vice versa again not holds good). 

Normalization: Designing a relational database to minmize data redundancy
Introduced by Edgar codd
1NF, 2NF, 3NF and so on.

1NF:
  1. each table has only relevant columns
  2. each table has primary key
  3. each table has no repeating groups
  4. No multiple values in any coloumn of any row

2NF : No partial dependency should exist

To be in 2NF, the table has to be in 1NF and all non-prime attributes/coloumns has to be depend on the whole primary key, and not on a part of the primary key. 

Consider a Customer table with CustomerID and StoreID together making up the primary key. If we have an attribute StoreLocation, we can see that it depends only on StoreID, which is not the complete primary key. Hence its not in 2NF.

If the primary key is not composite Key,  Primary key is single attribute then the relation will be in 2NF
https://www.tutorialspoint.com/dbms_for_gate_exams/dbms_second_normal_form_2nf.asp


3NF:
https://beginnersbook.com/2015/05/normalization-in-dbms/



Chrome Developer tools



Reference:
Open Developers Tools : Shift + Ctrl + I    or   F12


docking postion options will be at top right corner with three vertical dots.


options on right click :


Mobile view:


strikeing means :
Styles: top is most specfic , bottom is general
you could see padding and border-bottom is strike-out, it means more specific is over-written the same properties.


we can select and deselect the properties as shown below


Computed shows only the applied property or styles


in the event listener, we can see the various events associated with the element:


Console is to write Javascript :
even in Elements tab , if we press Esc key a small Console window will get open, both options are same.


extra:


Network tab:
we can disable cache so every time the requests are made to the server.




if you click on Initiator , its shows the source code where the request has started.










Wednesday, February 28, 2018

Performance Monitor (Windows Default)

todo:






Select % Processor Time
Select the required instance of the processor core
and click on Add.
Now clear the first screen and check the performance of all the processor core while executing any program or application.


https://msdn.microsoft.com/en-us/library/dn271687(v=nav.90).aspx

https://www.codeproject.com/Articles/8590/An-Introduction-To-Performance-Counters


Sunday, August 27, 2017

General Technical Information


Zoolz Cloud Storage: Lifetime of 1TB Instant Vault and 1TB of Cold Storage


https://academy.sciencealert.com/sales/zoolz-cloud-storage-lifetime-subscription-2tb?utm_source=sciencealert.com&utm_medium=referral&utm_campaign=zoolz-cloud-storage-lifetime-subscription-2tb_081817&utm_term=scsf-236285&utm_content=a0x1a000001tTd7EditDetailsDeleteMoreClose



Handling Large Files:

The difference between log files, a text file and a data file.
Log files is generated automatically to keep track of some specific appliation.
A text file is created by the user in a word processor.
A data file stores data pertaining to a specific application for later use.

CSV: Comma seperated values
LDF: log data files
MDF: master data files

Basic tool editors for handling large log files

Notepad++
It supports multi tab for multi documents
Its supports multiple programming langs - C, C++, Java, C#, XML, HTML< PHP, JavaScript, VB/VBS, SQL, Perl, Python, Unix shell script.
Notepad++ is commonly known as the the best HTML editor.
Supports Regular Expression
Drag and Drop

Glogg

Vim: Visual Interactive

ConText
http://www.contexteditor.org/downloads
Source code repository path: http://code.google.com/archive/p/contexteditor/

EditPad Lite


EmEditor

LogExpert:

--------------------------------------------------------------------------------------

Factors consideration while choosing programming language
Functionality of the application
support for new features
the platform on which the application will run
performance
security
code size
community and support


Features
Perl
PHP
Python
Version
6
7.1.2
 3.6.0

Most powerful in regular expression and string manipulation.
Useful while parsing huge amount of data.
It's a server side scripting language.
Popular for small or medium level website development.
Testing, automation, web development, data analytics, cloud computing,  mobile development and game development.
Platform
Support all platforms


Useful
Web development, System administration, network programming and game development
Web development.
Dynamic webpages
Good documentation
Used in 3D animation and game development.

Disadvantage
Syntax is complex,
Poor documentation.
Slow compared to other scripting language.
As it is open source, security is the major challenge as the code is available to all; hence intruders can easily find weakness in the code.
PHP not suitable for desktop application.

It is slower compared to C and C++
It is also an interpreted language.
Its doesn't perform multi-processor / multi-core work efficiently.

Frameworks
Catalyst, Dancer, Mojolicious
Laravel, symphony, codeigniter, phalcon
Django, TurboGears, Web2py, Bottle, CherryPy, Flask, Pyramid,
IDE/ Text Editor


Sublime:
https://www.sublimetext.com/3





Saturday, August 26, 2017

Web Service testing using SOAPUI - https://www.soapui.org/

https://www.guru99.com/api-testing.html

All Web Services are API but APIs are not Web Services.

Api Testing is entirely different from GUI Testing and mainly concentrates on the business logic layer of the software architecture. This testing won't concentrate on the look and feel of an application.

Instead of using standard user inputs(keyboard) and outputs, in Api Testing, you use software to send calls to the API, get output, and note down the system's response.


Difference between API testing and Unit testing


Unit TestingAPI testing
  • Developers perform it
  • Testers perform it

Tools for API testing

Since API and Unit Testing both target source code, similar tools can be used for testing both.

  • SOAPUI - It's an easy-to-use tool with extensive REST and SOAP API testing capabilities – no scripting experience is required.
  • Runscope
  • Postman with jetpacks
  • Postman with Newman

https://www.linkedin.com/pulse/difference-between-api-testing-unit-mj-alavi



https://www.youtube.com/watch?v=0pcM6teVdKk&list=PL6n9fhu94yhW7yoUOGNOfHurUE6bpOO2b


References:
  • https://www.soapui.org/
  • https://www.soapui.org/tutorials.html
    http://techonestop.com/soapui-alternative-for-webservice-testing
  • https://www.youtube.com/watch?v=Op6XpK9VJn4&list=PL_SsnJZ0TQhaTWws490iAxZby6Lwf7tFX



Web Service can be called by a Software Application using SOAP or HTTP protocol.  


Web Services can be implemented in different ways, but the following two are the popular implementations approaches.
  1. SOAP (Simple Object Access Protocol)
  2. REST (Representational State Transfer architecture)
SOAP uses the XML format to send and receive the request 


REST is an alternative to SOAP. Rest API supports both XML and JSON format. It is usually preferred for Mobile and web apps as it makes app work faster and smoother


SOAPUI is used to test the web service, it also used for functional testing also.
XML: Extended Markup Language
In html we need to use predefined set of tags Ex: <input /> <p> <h1> <body>
In XML we can set our user defined tags.
<booking>
 <name>        </name>
 <location>    </location>
 <FromDate>    </FromDate>
 <ToDate>      </ToDate>
</booking>


SOAP is a protocol which use xml format. This protocol used to pass data from one application to another application.


Install SOAP:


https://www.soapui.org/   this software is from smartbear corp.
There are 2 version of the SOAPUI
  1. SoapUi  (Free)
  2. SOAP Pro - Licensed  (Trail for 14 days)


Prerequisite
Java install.


Download and Install with default options.


Open application


It will ask for survey, we can ignore it for the moment.


Now the Home page will be opened.


WSDL:  Web service description language
An WSDL document describes a web service. 


Now we require to get some free web service for testing. Lets take the example of currency convertor.






Copy WSDL :


Open SoapUI:




In Initial WSDL field enter the WSDL location. The Project Name is auto picked from WSDL and also you can change to any name.
Click on OK.


Under Project we can see CurrencyConvertor → ConversionRate → Request1
Double click on Request1 to see the right panel. Its has two sections Raw and XML. Now, we need to Convert the value from us dollar to indian rupees.
So we need to add parameters in FromCurrency and ToCurrency tags.


Change the values as highlighted
  1. FromCurrency USD and ToCurrency INR
  2. Click on Execute
  3. Check response – Conversion value.


Assertion in SOAPUI:
For this  am using the following WSDL location:






Click on OK








  1. Click on + (Add Assertion) button
  2. Select Assertion type : here am selecting string contains type.
  3. Click on Add button






Manual Testing Concepts



TEST CASES FOR ATM MACHINE

          http://testingclass.com/manual-testing/test-cases-atm-machine/

JMeter Simple Controller

  Simple Controller is just a  container  for user request.