web application development using php and mysql

41
WEB APPLICATION DEVELOPMENT USING PHP AND MYSQL Ganesh Kamath MS – EWT (Embedded and Wireless Technology) Internship at Intel MCIS - 111003002 Development of Python Script Generator

Upload: ganesh-kamath

Post on 21-Jan-2017

199 views

Category:

Documents


3 download

TRANSCRIPT

Page 1: Web Application Development using PHP and MySQL

WEB APPLICATION DEVELOPMENT USING PHP AND MYSQL

Ganesh KamathMS – EWT (Embedded and Wireless Technology)

Internship at IntelMCIS - 111003002

Development of Python Script Generator

Page 2: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

2

CONTENT INTRODUCTION CONCEPTS

The AMP StackBenefits of using Database with Server-side scriptsClient-side versus Server-side scripting

Project RequirementProblem StatementWeb Application ArchitectureExpectation at the end of the projectStructure of the Script

Web Application in actionFeatures Supported Auto update of script based on Test Case DetailsAuto update of script based on Library SelectionAuto update of script based on Function Selection Undo-Redo FeatureAuto-population of dropdown

Conclusion Summary

5/25/2013

Page 3: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

3

INTRODUCTION1. Today, PHP and MySQL are the most widely used

combination of open source technologies for Web Application Development

2. In the presentation, we first discuss the various concepts that form a base-line for the development of web-technologies, followed by extensive focus on the specific application namely the Python Script Generator (PSG)

3. In the discussion of the Python Script Generator, the technologies that come into play behind the scenes are covered so that viewers of this presentation are acquainted with the knowledge to utilize the right technology for the application they intend to create

5/25/2013

Page 4: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

4

CONCEPTS

5/25/2013

Page 5: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

5

THE AMP STACK The AMP stack consists of:

A -> Apache the web-server. M -> MySQL the database. P -> PHP the server-side scripting engine.

There are several open-source AMP stacks readily available for use such as: LAMP – Linux Apache MySQL PHP, Perl & Python WAMP – Windows Apache MySQL PHP MAMP – Mac Apache MySQL PHP XAMPP – Cross-platform Apache MySQL PHP Platform

5/25/2013

Page 6: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

6

ADVANTAGES OF THE AMP STACK Free and open-source Maintained by the Apache Software Foundation Multi-platform & cross-platform support Good support in the form of mailing list and large

community of users Strong Default Configuration PHP has several inbuilt functions to perform query

with MySQL Ease of duplication of infrastructure on development

machine

5/25/2013

Page 7: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

7

USAGE STATISTICS OF AMP STACK

Web Server Usage

Open-source DBMS usage

Server-side scripting language usage

5/25/2013

Page 8: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

8

BENEFITS OF USING DATABASE WITH SERVER-SIDE SCRIPTS1. Storage, Retrieval, Management – Easy because database

allows users to store data in a logic format2. Security – Database adds to security of the web-application as

database access includes secured authentication.3. Independence – Data can be updated independently from the

content of the web-site as well as from independent locations4. Scalability – If data grows exponentially, it can be handled

independently with respect to the web-site infrastructure. Database can be scaled across servers by implementation of several HDR options

5. Simple Integration – An existing database can be easily integrated

6. Load Sharing – Database queries are processed autonomously with respect to server-side scripts calling them, this decreases load on the server-side scripts. Moreover, data retrieval from database has been optimized over decades of data related studies

7. Concurrency – Databases provide robust concurrent multi-user access

5/25/2013

Page 9: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

9

CLIENT-SIDE VERSUS SERVER-SIDE SCRIPTING

Client-side script Server-side scriptProcessing Browser. Server.Process Script is sent to the browser. Script is fetched from file system into

the server-side scripting engineLoad User's computer. Server machine.Security Lower security because source-

code of the script can be exposed on the user's computer.

Higher security because source-code is interpreted and the resulting HTML is returned to the user's computer (Logic is secure).

Speed Very quick, because processing is happening on user's computer

There is delay in fetching the processed resource from the server.

Dependency

User's browser needs to support the client-side scripting language. It must also be enabled for the web-application to function smoothly.

The result of server-side script processing is generally HTML which is supported on all browsers.

Performance Improvement

Performance can be improved by increasing hard-disk/RAM of the user's computer. There is performance impact seen when the user opens multiple web-application/web-pages on the browser simultaneously.

Performance depends not only on server's hard-disk, RAM and the Network but also on simultaneous concurrent connections to the server-side application.

Application Input-validation, user-interaction. Database or server-resource accessExample CSS, JavaScript, AJAX, VBScript PHP, ASP.Net, Ruby on Rails, JSP, Perl

5/25/2013

Page 10: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

10

CLIENT SIDE SCRIPTING 5/25/2013

Page 11: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

11

SERVER SIDE SCRIPTING WITH PHP & MYSQL 5/25/2013

Page 12: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

12

ACCESS A DYNAMIC WEB – PAGE (CONT’D)5/25/2013

Page 13: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

13

ROLE OF DISPATCHER The dispatcher converts an URL such as:

https://www.google.co.in/webhp?hl=en&tab=ww

, into function calls with parameters: Dispatch.run(https://www.google.co.in/webhp, hl=en, tab=ww)

5/25/2013

Page 14: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

14

ACCESS A DYNAMIC WEB – PAGE (CONT’D)5/25/2013

Page 15: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

15

PROJECT REQUIREMENT

DEFINITION

5/25/2013

Page 16: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

16

PROBLEM STATEMENT- THE SPECIFIC PROBLEM

Test automation is a challenging yet important field in Validation world

An average validation engineer is not expected to be expert in any of the programming languages that can be used to create the scripts to automate test execution

The idea was to create a tool that can aid validation engineers to generate scripts quickly and efficiently without the need of being an expert in the scripting language

Common Python script errors were improper indentations and spelling mistakes which were reducing the performance of validation engineers

5/25/2013

Page 17: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

17

STAGES OF TEST AUTOMATION

5/25/2013

Page 18: Web Application Development using PHP and MySQL

18

LIBRARIES AND TEST-CASE SCRIPTS

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

5/25/2013

Page 19: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

19

WEB APPLICATION ARCHITECTURE

5/25/2013

Page 20: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

20

HIGH-LEVEL ARCHITECTURE 5/25/2013

Page 21: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

21

EXPECTATION AT THE END OF THE PROJECT

5/25/2013

Page 22: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

22

STRUCTURE OF THE SCRIPT5/25/2013

Page 23: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

23

CONTINUE AFTER DEMO http://localhost/college/PSG.php

5/25/2013

Page 24: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

24

SEQUENCE DIAGRAM5/25/2013

Page 25: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

25

DATA DESIGNTable in Content Database

Table in User Database

Visitor Count through “IP + Time Stamp” interpretation

5/25/2013

Page 26: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

26

FLOW CHART OF PYTHON SCRIPT GENERATOR

5/25/2013

Page 27: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

27

WEB APPLICATION IN ACTION

5/25/2013

Page 28: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

28

AUTO UPDATE OF SCRIPT BASED ON TEST CASE DETAILS 5/25/2013

Page 29: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

29

AUTO UPDATE OF SCRIPT BASED ON LIBRARY SELECTION 5/25/2013

Page 30: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

30

AUTO UPDATE OF SCRIPT BASED ON FUNCTION SELECTION 5/25/2013

Page 31: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

31

FEATURES SUPPORTED BY THE TOOL

Auto-population of library specific dropdown values

Independent update database values Ability to undo/redo an activity Fill in the mandatory header field manually Save the script on script completion Function prototype Authentication Centralized storage Analytics for the Admin Formatting

5/25/2013

Page 32: Web Application Development using PHP and MySQL

UNDO-REDO AND ASSOCIATED CHANGE

Change in state transition diagram and associated additional processing

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

32

5/25/2013

Page 33: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

33

UNDO-REDO AND ASSOCIATED CHANGE (CONT’D)

Redo

Undo

Undo

Redo

Change induced on Dependent Library part of the script

Change induced on Script body

5/25/2013

Page 34: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

34

AUTO-POPULATION OF DROPDOWN

Dynamic Dropdown population

5/25/2013

Page 35: Web Application Development using PHP and MySQL

Web Application Development using PHP and MySQL 35

5/25/2013

Page 36: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

36

PROBLEMS SOLVED BY THE PYTHON SCRIPT GENERATOR Common standard of test-case script creation – a

benchmark tool web-application - available everywhere, no need to

install It has eliminated the chances syntax errors such as

spelling mistakes and problematic indentations. It does not require a Python expert to create a test-case

script. This eliminates the need to train people in Python to create the wrapper files.

Updating library - now independent of script creation Fast Centralized repository of scripts

5/25/2013

Page 37: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

37

CONCLUSION Using AMP stack can help developers

reduce the application development time.

The python code generator enabled rapid development of test-case execution scripts thereby reducing the duration of validation cycle. In this project, no of scripts in library were ~800

where as scripts were ~4000 This give domain experts more time to create

efficient & more generic scripts

5/25/2013

Page 38: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

38

SUMMARY In this presentation, we discussed the concepts

which come into play during developing a web-application Distinction between Client-side and Server-side

scripting Benefits of implementing a database with web-sites The advantages of AMP stack was also discussed,

where we saw why PHP worked so well with MySQL Test cycle used in the Automation Team was

discussed, this was followed by requirements of Python Script Generator

Architecture and Detailed implementation of each feature was discussed with a brief description of problems solved by the tool

5/25/2013

Page 39: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

39

KEY TAKEAWAYS FROM THE PROJECT

Web technologies like HTML, PHP, CSS, JavaScript, JQuery, SQL, AJAX was learnt along with software suits like XAMPP, Doxygen, Perforce during the course of the project implementation.

Database implementation concepts Importance of Scripting languages such

as Python in test-case execution Functioning of an organization with

several teams

5/25/2013

Page 40: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

40

REFERENCES “Beginning PHP6, Apache, MySQL® Web

Development”, Timothy Boronczyk, Elizabeth Naramore, Jason Gerner, Yann Le Scouarnec, Jeremy Stolz, Michael K. Glass, 2009

“Learning PHP, MySQL and JavaScript”, Robin Nixon, 2009

“PHP & MySQL For Dummies 3rd edition”, Janet Valadey, 2007

“Build your own Database driven Website using PHP & MySQL”, Kevin Yank, 2009

“How to Do Everything with PHP and MySQL”, Vikram Vaswani, 2007

5/25/2013

Page 41: Web Application Development using PHP and MySQL

Web

App

licat

ion

Deve

lopm

ent u

sing

PHP

and

MyS

QL

41

THANK YOU

5/25/2013