210 likes | 299 Views
A Self-Configuring Test Harness for Web Applications. Florida International University. School of Computing and Information Sciences. Jairo Pava School of Computing and Information Sciences Florida International University. Courtney Enoex School of Applied Sciences and Arts
E N D
A Self-Configuring Test Harness for Web Applications Florida International University School of Computing and Information Sciences Jairo Pava School of Computing and Information Sciences Florida International University Courtney Enoex School of Applied Sciences and Arts Southern Illinois University Yanelis Hernandez PhD Student Peter J. Clarke Research Mentor REU Summer Program 8/1/2008
Motivation 2 • Many web application technologies • No standard test script language • Complex web applications make testing difficult • Migration of technologies inefficient • Cost of software testing accounts for fifty to seventy-five percent of total development costs
Presentation Content 3 • Motivation • Objectives • Background • Problem Statement • Approach • Implementation • Results • Conclusions / Pending Work • Acknowledgements • Questions
Background 5 • Testing web application is necessary • Complex web applications make testing difficult • Regression testing points to code modification that make previously functional code to fail • Allows the ability to catch errors as they are introduced • Subtle changes in code can introduce errors
Literature Review 4 Testing Tools • Ruby on Rails [2] • Released in 2004 • Provides scaffolding, WEBrick, and Rake • Helpful tools are ready for use • PHPUnit [3] • Simple pass/fail reporting • Use with PHPUnit Database Extension • Compare (seeded) database contents with an expected dataset • An Integrated Self-Testing Framework for Autonomic Computing Systems • King, et al • Authors developed integrated testing for autonomic systems
Problem Statement 7 To develop a web application test harness that dynamically configures its test suite to generate and execute platform specific test scripts.
Approach 8 • FastBooks.com e-commerce web application • Web Technologies used • Ruby on Rails 1.2 • PHP 5 • Testing Tools • Ruby 1.2 • PHPUnit 3.2.21 • Code Coverage Analysis Tool • RCOV 0.8.0 • Xdebug 2.0.3
Approach 9
Approach 10
Implementation 11 CreateAction Parameters AssertAction Parameters InputAction Parameters TestCase(“TC001_ValidateBook_SunnyDay”) ProcedureEntry(“TC001_PE001”) CreateAction( Dict.ObjectType, “product”, parameters ) ProcedureEntry(“TC001_PE002”) InputAction( Dict.VarType, “price”, parameters ) ProcedureEntry(“TC001_PE003”) AssertAction( Dict.AssertTrue, “valid”, parameters ) Ruby on Rails Model AddCreateSyntax( Dict.ObjectType, “[VarName] = [ClassName].new([ParamList])”) AddInputSyntax( Dict.VarType, “[ObjectName].[VarName] = [VarValue]” ) AddAssertSyntax( Dict.AssertTrue, “assert [ObjectName].[VarName]?” )
Implementation 12 require File.dirname(__FILE__) + '/../test_helper' class ProductTest < Test::Unit::TestCase def test_positive_price product = Product.new(:title => "Book Title", :price => 0.00 ) product.price = 9.99 assert product.valid? end end
Implementation 13 CreateAction Parameters AssertAction Parameters InputAction Parameters TestCase(“TC001_ValidateBook_SunnyDay”) ProcedureEntry(“TC001_PE001”) CreateAction( Dict.ObjectType, “product”, parameters ) ProcedureEntry(“TC001_PE002”) InputAction( Dict.VarType, “price”, parameters ) ProcedureEntry(“TC001_PE003”) AssertAction( Dict.AssertTrue, “valid”, parameters ) PHPUnit Model AddCreateSyntax( Dict.ObjectType, “$this -> [varName] = new [ClassName]([paramList]);” ) AddInputSyntax( Dict.VarType, “$this -> [ObjectName] -> [VarName]( [VarValue] );” ) AddAssertSyntax( Dict.AssertTrue, “$this -> assert( $this -> [ObjectName] -> [varName]( ) );” )
Implementation 14 require once "phpunit.php" require once "product.php" class productTest extends TestCase { function test_positive_price() { $this -> product = new Product(“Book Title", 0.00); $this -> product -> price( 9.99 ); $this -> assert( $this -> product -> valid() ); } }
Implementation 15 Ruby on Rails 1.2 RCOV 0.8.0 PHPUnit 3.2.21 Xdebug 2.0.3
Evaluation 16 • Accurate detection of web technologies by monitor • Correct selection of model for test script generation • Proper syntax of platform specific test script • Successful execution in testing tool
Limitations and Future Work 17 • Test script generation needs improvement • Abstract syntax trees • Increase support for different types of testing • More web technology support • Easier integration of web technology models
Conclusions 18 • Utilize concepts of autonomic computing to reduce human interaction • Automatically test web applications • Determine code coverage • Interpret results • More efficient migration of web application test scripts • Standard test script language • Improve quality of test cases developed
Acknowledgements 19 National Science Foundation, Grant # IIS-0552555, Research Experience for Undergraduates: Autonomic Computing at FIU Florida International University Dr. Masoud Milani Yanelis Hernandez, Tariq M. King Dr. Peter Clarke Dr. Tao Li, Dr. Raju Rangaswami, Dr. Masoud Sadjadi
References 20 • [1] PHPUnit • http://www.phpunit.de/ • [2] PHP • http://www.php.net • [3] Ruby on Rails • http://www.rubyonrails.org/ • [4] Xdebug • http://www.xdebug.org/ • [5] RCOV • http://www.asp.net • [6] Software Debugging, Testing, and Verification • IBM Systems Journal 2002 • [7] An Integrated Self-Testing Framework for Autonomic Computing Systems • Tariq M. King, Alain E. Ramirez, Rodolfo Cruz, Peter J. Clarke
End 21 Questions? Comments?