Finding Bugs in Web Applications Using Dynamic Test Generation and Explicit-State Model Checking -Shreyas Ravindra.

Slides:



Advertisements
Similar presentations
PHP I.
Advertisements

Microsoft Research March 20, 2000 A Programming Language for Developing Interactive Web Services Claus Brabrand BRICS, University of Aarhus, Denmark.
Prioritizing User-session-based Test Cases for Web Applications Testing Sreedevi Sampath, Renne C. Bryce, Gokulanand Viswanath, Vani Kandimalla, A.Gunes.
Languages for Dynamic Web Documents
SOFTWARE SECURITY JORINA VAN MALSEN 1 FLAX: Systematic Discovery of Client-Side Validation Vulnerabilities in Rich Web Applications.
SE 450 Software Processes & Product Metrics Reliability: An Introduction.
Software Testing and Quality Assurance
An Object-Oriented Architecture Supporting Web Application Testing Presented By: Bhavdeep Singh.
RIT Software Engineering
SE 450 Software Processes & Product Metrics 1 Defect Removal.
Michael Ernst, page 1 Improving Test Suites via Operational Abstraction Michael Ernst MIT Lab for Computer Science Joint.
1 State-Based Testing of Ajax Web Applications A. Marchetto, P. Tonella and F. Ricca CMSC737 Spring 2008 Shashvat A Thakor.
1 Software Testing and Quality Assurance Lecture 30 – Testing Systems.
Leveraging User Interactions for In-Depth Testing of Web Applications Sean McAllister, Engin Kirda, and Christopher Kruegel RAID ’08 1 Seoyeon Kang November.
Automated Tests in NICOS Nightly Control System Alexander Undrus Brookhaven National Laboratory, Upton, NY Software testing is a difficult, time-consuming.
Leveraging User Interactions for In-Depth Testing of Web Application Sean McAllister Secure System Lab, Technical University Vienna, Austria Engin Kirda.
State coverage: an empirical analysis based on a user study Dries Vanoverberghe, Emma Eyckmans, and Frank Piessens.
TEST CASE DESIGN Prepared by: Fatih Kızkun. OUTLINE Introduction –Importance of Test –Essential Test Case Development A Variety of Test Methods –Risk.
‘ ?>
Finding Bugs in Dynamic Web Applications Shay Artzi, Adam Kiezun, Julian Dolby, Frank Tip, Danny Dig, Amit Paradkar, Michael D. Earnst Proceeding: ISSTA.
Software Testing Verification and validation planning Software inspections Software Inspection vs. Testing Automated static analysis Cleanroom software.
Dr. Pedro Mejia Alvarez Software Testing Slide 1 Software Testing: Building Test Cases.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
CSCI 6962: Server-side Design and Programming Course Introduction and Overview.
Architecture Of ASP.NET. What is ASP?  Server-side scripting technology.  Files containing HTML and scripting code.  Access via HTTP requests.  Scripting.
CIS 375—Web App Dev II ASP.NET 2 Introducing Web Forms.
1. Topics to be discussed Introduction Objectives Testing Life Cycle Verification Vs Validation Testing Methodology Testing Levels 2.
CS 501: Software Engineering Fall 1999 Lecture 16 Verification and Validation.
Introduction Telerik Software Academy Software Quality Assurance.
Chapter 14: Inspection  Basic Concept and Generic Process  Fagan Inspection  Other Inspection and Related Activities.
1 A Static Analysis Approach for Automatically Generating Test Cases for Web Applications Presented by: Beverly Leung Fahim Rahman.
CSC-682 Cryptography & Computer Security Sound and Precise Analysis of Web Applications for Injection Vulnerabilities Pompi Rotaru Based on an article.
Testing Workflow In the Unified Process and Agile/Scrum processes.
Testing and Debugging Version 1.0. All kinds of things can go wrong when you are developing a program. The compiler discovers syntax errors in your code.
1 Hybrid-Formal Coverage Convergence Dan Benua Synopsys Verification Group January 18, 2010.
1 Introduction to Software Engineering Lecture 1.
CSC 2720 Building Web Applications Server-side Scripting with PHP.
David Lawrence 7/8/091Intro. to PHP -- David Lawrence.
Implementing and Using the SIRWEB Interface Setup of the CGI script and web procfile Connecting to your database using HTML Retrieving data using the CGI.
Introduction Selenium IDE is a Firefox extension that allows you to record, edit, and debug tests for HTML Easy record and playback Intelligent field selection.
27.1 Chapter 27 WWW and HTTP Copyright © The McGraw-Hill Companies, Inc. Permission required for reproduction or display.
D R A T D R A T ABSTRACT Every semester each department at Iowa State University has to assign its faculty members and teaching assistants (TAs) to the.
Internet Applications (Cont’d) Basic Internet Applications – World Wide Web (WWW) Browser Architecture Static Documents Dynamic Documents Active Documents.
8 Chapter Eight Server-side Scripts. 8 Chapter Objectives Create dynamic Web pages that retrieve and display database data using Active Server Pages Process.
Software Testing Mehwish Shafiq. Testing Testing is carried out to validate and verify the piece developed in order to give user a confidence to use reliable.
ASP-2-1 SERVER AND CLIENT SIDE SCRITPING Colorado Technical University IT420 Tim Peterson.
Unit 1 – Web Concepts Instructor: Brent Presley.
JavaScript 101 Introduction to Programming. Topics What is programming? The common elements found in most programming languages Introduction to JavaScript.
System To Generate Test Data: The Analysis Program Syed Nabeel.
Error Explanation with Distance Metrics Authors: Alex Groce, Sagar Chaki, Daniel Kroening, and Ofer Strichman International Journal on Software Tools for.
JavaScript Introduction and Background. 2 Web languages Three formal languages HTML JavaScript CSS Three different tasks Document description Client-side.
Whole Test Suite Generation. Abstract Not all bugs lead to program crashes, and not always is there a formal specification to check the correctness of.
Testing Overview Software Reliability Techniques Testing Concepts CEN 4010 Class 24 – 11/17.
IST 210: PHP Basics IST 210: Organization of Data IST2101.
SOFTWARE TESTING AND QUALITY ASSURANCE. Software Testing.
Tool Support for Testing
A Review of Software Testing - P. David Coward
Prepared by: Fatih Kızkun
Presentation by: Naga Sri Charan Pendyala
Testing Tutorial 7.
Automated Pattern Based Mobile Testing
Database Driven Websites
Software Quality Engineering
Chapter 14: Inspection Basic Concept and Generic Process
All You Ever Wanted to Know About Dynamic Taint Analysis & Forward Symbolic Execution (but might have been afraid to ask) Edward J. Schwartz, Thanassis.
Software Verification and Validation
Software Verification and Validation
Institute of Computing Tech.
TYPES OF TESTING.
Presentation transcript:

Finding Bugs in Web Applications Using Dynamic Test Generation and Explicit-State Model Checking -Shreyas Ravindra

Abstract Web script crashes and malformed dynamically generated webpages are common errors Current tools for webpage validation cannot handle the dynamically generated pages A dynamic test generation technique for the domain of dynamic Web applications is presented in this session The technique Utilizes – Combined concrete and symbolic execution – Explicit-state model checking

Introduction This paper extends dynamic test generation to the domain of web applications that dynamically create web (HTML) pages during execution, which are typically presented to the user in a browser. Our goal is to find two kinds of failures in web applications: – execution failures – HTML failures

Failures in PHP Programs Apollo targets two types of failures – Execution Failures – HTML Failures

Above prog contains three faults, which cause the following failures when the program – line 11: Execution failure – Line 23: Execution failure – Line 29: Malformed HTML

Algorithm

Algorithm(Cont.) Subroutine getConfig() is used to get new configurations.

Example executeSymbolic produces the following path constraint: NotSet(page)^ page2 !=1337 ^ login !=1 --(I) The algorithm now enters the foreach loop on line 16 NotSet(page) ^ page2 != 1337 ^ login =1-(II) NotSet(pageÞ ^ page2 = (III) Set(page) (IV)

Path Constraint Minimization Minimization algorithm attempts to find a shorter path constraint for a given bug report. For a Given Bug report b, the algorithm takes following steps 1.Intersects all the path constraints exposing b:failure (line 1). 2. The minimizer systematically removes one conjunct at a time (lines 3-6). 3. If one of these shorter path constraints does not expose b:failure, then the removed conjunct is required for exposing b:failure. 4.The set of all such required conjuncts determines the minimized path constraint.

Combined Concrete and Symbolic Execution with Explicit-State Model Checking : A typical PHP Web application is a client-server application in which data and control flows interactively between a server that runs PHP scripts and a client, which is usually a Web browser. Apollo implements a form of explicit-state software model checking. the algorithm presented in this section remembers and restores the state between executions of PHP scripts. This technique, known as state matching, is widely known in model checking and implemented in tools such as SPIN and JavaPath-Finder.

Interactive User Simulation Example

Algorithm II The algorithm tracks the state of the environment, and automatically discovers additional configurations based on an analysis of the output for available user options. The algorithm does the following two functions: 1.Tracks changes to the state of the environment (i.e., session state, cookies, and the database) 2.Performs an “on-the-fly” analysis of the output produced by the program to determine what user options it contains, with their associated PHP script

Algorithm II(Cont.)

There are four differences (underlined in the figure) with the simplified algorithm that was previously shown in Fig A configuration contains an explicit state of the environment (before the only state that was used was the initial state S0) in addition to the path constraint and the input (line 3). 2.Before the program is executed, the algorithm (method executeConcrete) will restore the environment to the state given in the configuration (line 7) and will return the new state of the environment after the execution.

Algorithm II(Cont.) 3. getConfigs() – finds new configurations, – it analyzes the output to find possible transitions from the new environment state (lines 24-27). analyzeOutput()— extracts parameter names and possible values for each parameter, and represents the extracted information as a path constraint. 4. The algorithm uses a set of configurations that are already in the queue (line 14) and it performs state matching in order to only explore new configurations (line 11).

Implementation: Apollo consists of three major components 1.Executor 2.Bug Finder 3.Input Generator

Implementation: INPUT Inputs – Program under test – Initial values for the environment Environment Consists of – Database – Cookies – Stored Session information The initial environment consists of – A database populated with some values – Username/Password pairs supplied by user for database authentication

Implementation: EXECUTOR Executor—executes a PHP script with a given input in a given state. The executor contains two subcomponents: – The Shadow Interpreter is a PHP interpreter that propagates and records path constraints and positional information associated with output. – The State Manager

Implementation: BUG FINDER The Bug Finder has the following subcomponents: The Oracle finds HTML failures in the output of the program. The Bug Report Repository stores all bug reports found during all executions. The Input Minimizer finds, for a given bug report, the smallest path constraint on the input parameters that results in inputs inducing the same failure as in the report.

Implementation: INPUT GENERATOR The Input Generator implements the algorithm The UI Option Analyzer analyzes the HTML output of each execution to convert the interactive user options into new inputs to execute

Implementation: INPUT GENERATOR The Symbolic Driver generates new path constraints from the constraints found during the execution. The Constraint Solver computes an assignment of values to input parameters that satisfies a given path constraint. The Value Generator generates values for parameters that are not otherwise constrained, using a combination of random value generation and constant values mined from the program source code.

EVALUATION: Q1. How many faults can Apollo find, and of what varieties? Q2. How effective is the fault detection technique of Apollo compared to alternative approaches in terms of the number and severity of discovered faults and the line coverage achieved? Q3. How effective is our minimization technique in reducing the size of input parameter constraints and failure-inducing inputs?

GENERATION STRATERGIES We use the following test input-generation strategies in the remainder of this section: – Apollo’s Input Generation – Randomized both strategies were executed inside the same experimental harness. This includes the Database Manager, which supplies usernames and passwords for database access, and the UI option analyzer.

METHODOLOGY To answer the first research question (Q1) we applied Apollo to the six subject programs and we classified the discovered failures into five groups based on their different failure characteristics: – Execution error – Execution warning – HTML error – HTML warning

METHODOLOGY To answer Q2, the coverage achieved and the number of faults found with the Randomized generation strategy was compared with apollo’s output.. Q3 was tested by exercising the input minimizer algorithm.

Results The graphs and tables below visualize how coverage and the number of failures found increases over time, when both techniques are given up to 20 minutes

Results - 2

Results -3

Results - 4 Comparison with Static Analysis – Minamide Vs. Apollo Path Constraint Minimization – Original Unminimized path Vs Minimized path

Threats to Validity Construct Validity: – Why do we count malformed HTML as a defect in dynamically generated webpages? – Why do we use line coverage as a qulity metric? Internal Validity – Did Apollo discover real, unseeded, and unknown faults? External Validity – Will our results generalize beyond the subject programs?

Limitations: 1.Simulating user inputs based on locally executed Java-Script 2.Limited tracking in native methods 3.Limited tracking of input parameters through the database 4.Limited sources of input parameters

Related Work An earlier version of this paper was presented at ISSTA The Apollo tool presented at ISSTA did not handle the problem of automatically simulating user interactions in Web applications The current paper also extends by providing a more extensive evaluation, which includes two new large Web applications, and by presenting a detailed classification of the faults found by Apollo.

Conclusions A technique for finding faults in PHP web application through Combined Concrete and Symbolic Execution The Work is novel in several respects – The tool not only detects runtime errors but uses HTML validater as a oracle to inspect Malformed HTML pages – PHP Specific issues has been addressed, like Interactive user input – Automated analysis to minimize the failure inducing inputs

Conclusions Apollo’s test generation strategy achieves over 50 percent line coverage Apollo found a total of 673 faults in these applications: – 72 execution problems – 601 cases of malformed HTML – Apollo also minimizes the size of failure-inducing inputs: The minimized inputs are up to 5:3 smaller than the unminimized ones

References Finding Bugs in Web Applications Using Dynamic Test Generation and Explicit-State Model Checking – Shay Artzi, Adam Kie _zun, Julian Dolby, Frank Tip, Danny Dig,Amit Paradkar, Senior Member, IEEE, and Michael D. Ernst

Q&A

Thank you