Today, QA Is Mostly Testing

Total Page:16

File Type:pdf, Size:1020Kb

Today, QA Is Mostly Testing Today, QA is mostly testing “50% of my company employees are testers, Modern Symbolic Execution: and the rest spends 50% of their time testing!” DART, EGT, CUTE, jCUTE, EXE, Bill Gates 1995 KLEE, CREST, CATG Cristian Cadar Koushik Sen Department of Computing EECS Department Imperial College London University of California, Berkeley 1 2 A Familiar Program: QuickSort A Familiar Program: QuickSort void quicksort (int[] a, int lo, int hi) { void quicksort (int[] a, int lo, int hi) { n Test QuickSort int i=lo, j=hi, h; int i=lo, j=hi, h; q int x=a[(lo+hi)/2]; int x=a[(lo+hi)/2]; Create an array q Initialize the elements of // partition // partition the array do { do { q Execute the program on while (a[i]<x) i++; while (a[i]<x) i++; this array while (a[j]>x) j--; if (i<=j) { while (a[j]>x) j--; if (i<=j) { n How much confidence h=a[i]; h=a[i]; a[i]=a[j]; a[i]=a[j]; do I have in this testing a[j]=h; a[j]=h; method? i++; i++; n Is my test suite j--; j--; *Complete*? } } } while (i<=j); } while (i<=j); n Can someone generate a small and *Complete* // recursion // recursion test suite for me? if (lo<j) quicksort(a, lo, j); if (lo<j) quicksort(a, lo, j); if (i<hi) quicksort(a, i, hi); if (i<hi) quicksort(a, i, hi); } } 3 4 1 Automated Test Generation Automated Test Generation n Studied since 70’s n Studied since 70’s q King 76, Myers 79 q King 76, Myers 79 n 30 years have passed, and yet no effective n 30 years have passed, and yet no effective solution solution n What Happened??? n What Happened??? q Program-analysis techniques were expensive q Automated theorem proving and constraint solving techniques were not efficient 5 6 Automated Test Generation Automated Test Generation n Studied since 70’s n Studied since 70’s q King 76, Myers 79 q King 76, Myers 79 n 30 years have passed, and yet no effective solution n 30 Question:years have passed,Can we anduse yet teachniques no effective n What Happened??? solutionfrom axiomatic semantics in q Program-analysis techniques were expensive Automated Test Generation? q Automated theorem proving and constraint solving n What Happened??? techniques were not efficient q Program-analysis techniques were expensive n In the recent years we have seen remarkable q Automated theorem proving and constraint solving progress in static program-analysis and techniques were not efficient constraint solving q SLAM, BLAST, ESP, Bandera, Saturn, MAGIC 7 8 2 Goal n Automated Unit Testing of real-world C and Java Programs q Generate test inputs Symbolic Execution q Execute unit under test on generated test inputs n so that all reachable statements are executed q Any assertion violation gets caught 9 10 Goal Execution Paths of a Program n Automated Unit Testing of real-world C and n Can be seen as a binary Java Programs tree with possibly infinite depth Y q Generate test inputs N q Computation tree q Execute unit under test on generated test inputs n Each node represents the Y n so that all reachable statements are executed execution of a “if then else” N Y N q Any assertion violation gets caught statement n Each edge represents the n Our Approach: N Y execution of a sequence of Y q Explore all execution paths of an Unit for all non-conditional statements possible inputs n Each path in the tree Y n Exploring all execution paths ensure that all reachable represents an equivalence statements are executed class of inputs N Y 11 12 3 Example of Computation Tree Example of Computation Tree int double (int v) { int double (int v) { return 2*v; return 2*v; } } void testMe (int x, int y) { void testMe (int x, int y) { N z==y Y N z==y Y z = double (y); z = double (y); x=0, y=1 if (z == x) { if (z == x) { if (x > y+10) { N x>y+10 Y if (x > y+10) { N x>y+10 Y x=0, y=0 ERROR; ERROR; } } x=22, y=11 } } ERROR ERROR } } 13 14 Computation Tree Computation Tree void testMe1(int x) { void testMe1(int x) { for (int j=0; j < 2; j++) { for (int j=0; j < 2; j++) { j < 2 Y if (x==j) { if (x==j) { printf(“Good\n”); printf(“Good\n”); x==j } } N Y } } } } j < 2 j < 2 How many feasible execution paths do you have in this Y Y program? ☐ 3 x==j x==j ☐ 4 N Y N ☐ 5 j < 2 j < 2 j < 2 ☐ more than 100 15 16 4 Computation Tree Computation Tree Repeated many times void testMe2(int x, unsigned int N) { void testMe2(int x, unsigned int N) { for (int j=0; j < N; j++) { for (int j=0; j < N; j++) { j < 2 if (x==j) { if (x==j) { printf(“Good\n”); printf(“Good\n”); x==j } } } } } } j < 2 j < 2 How many feasible execution paths do you have in this program? ☐ 3 x==j x==j ☐ 4 ☐ 5 j < 2 j < 2 j < 2 ☐ more than 100 17 18 Existing Approach I Random Testing Approach n Random testing testMe(int x){ int double (int v) { q generate random inputs if(x == 94389){ return 2*v; q execute the program on ERROR; } n Random Test Driver: generated inputs q random value for x and y } void testMe (int x, int y) { n Probability of reaching } an error can be z = double (y); astronomically small if (z == x) { n Probability of hitting Probability of reaching ERROR = 1/232 if (x > y+10) { ERROR is extremely low ERROR; } } } 19 20 5 Existing Approach II Concrete Execution n Symbolic Execution int double (int v) { x = 30, y = 15 q use symbolic values for input variables return 2*v; q execute the program } symbolically on symbolic input values void testMe (int x, int y) { q collect symbolic path z = double (y); constraints q use theorem prover to if (z == x) { check if a branch can be taken if (x > y+10) { ERROR; } } } 21 22 Concrete Execution Concrete Execution int double (int v) { x = 30, y = 15 int double (int v) { x = 30, y = 15 return 2*v; return 2*v; } x = 30, y = 15 } x = 30, y = 15 z = 30 z = 30 void testMe (int x, int y) { void testme (int x, int y) { z = double (y); z = double (y); z == x if (z == x) { if (z == x) { true if (x > y+10) { if (x > y+10) { ERROR; ERROR; } } } } } } 24 6 Concrete Execution Concrete Execution int double (int v) { x = 30, y = 15 int double (int v) { x = 30, y = 15 return 2*v; return 2*v; } x = 30, y = 15 } x = 30, y = 15 z = 30 z = 30 void testMe (int x, int y) { void testMe (int x, int y) { z = double (y); z == x z = double (y); z == x if (z == x) { true if (z == x) { true if (x > y+10) { if (x > y+10) { x > y + 10 x > y + 10 ERROR; ERROR; true true } } } } } } ERROR 25 26 Symbolic Execution Symbolic Execution int double (int v) { x = x0, y = y0 int double (int v) { x = x0, y = y0 true return 2*v; return 2*v; } } x = x0, y = y0 z = 2y0 void testMe (int x, int y) { void testMe (int x, int y) { z = double (y); z = double (y); if (z == x) { if (z == x) { if (x > y+10) { if (x > y+10) { ERROR; ERROR; } } } } } } 27 7 Symbolic Execution Symbolic Execution int double (int v) { x = x0, y = y0 int double (int v) { x = x0, y = y0 true true return 2*v; return 2*v; Check path feasibility } x = x0, y = y0 } x = x0, y = y0 using a SMT solver z = 2y0 z = 2y0 void testMe (int x, int y) { void testMe (int x, int y) { z = double (y); z = double (y); 2y0== x0 2y0== x0 2y0== x0 2y0== x0 if (z == x) { 2y0!= x0 if (z == x) { 2y0!= x0 if (x > y+10) { if (x > y+10) { ERROR; ERROR; } } } } } } Symbolic Execution Symbolic Execution int double (int v) { x = x0, y = y0 int double (int v) { x = x0, y = y0 true true return 2*v; return 2*v; Check path feasibility } x = x0, y = y0 } x = x0, y = y0 using a SMT solver z = 2y0 z = 2y0 void testMe (int x, int y) { void testMe (int x, int y) { z = double (y); z = double (y); 2y0== x0 2y0== x0 2y0== x0 2y0== x0 if (z == x) { 2y0!= x0 if (z == x) { 2y0!= x0 if (x > y+10) { if (x > y+10) { x = x0, y = y0 x = x0, y = y0 x0 > y0 + 10 x0 > y0 + 10 z = 2y0 z = 2y0 ERROR; 2y0== x0 && ERROR; 2y0== x0 && 2y == x && 2y == x && } 0 0 x0 > y0+10 } 0 0 x0 > y0+10 x <= y +10 x <= y +10 } 0 0 } 0 0 } } 31 32 8 Symbolic Execution Symbolic Execution int double (int v) { x = x0, y = y0 int double (int v) { x = x0, y = y0 Solve these constraints: true true return 2*v; return 2*v; (a.k.a. path constraints) } x = x0, y = y0 } x = x0, y = y0 to generate inputs for each path z = 2y0 z = 2y0 void testMe (int x, int y) { void testMe (int x, int y) { z = double (y); z = double (y); 2y0== x0 2y0== x0 2y0== x0 2y0== x0 if (z == x) { 2y0!= x0 if (z == x) { 2y0!= x0 if (x > y+10) { if (x > y+10) { x = x0, y = y0 x = x0, y = y0 x0 > y0 + 10 x0 > y0 + 10 z = 2y0 z = 2y0 ERROR; 2y0== x0 && ERROR; 2y0== x0 && 2y == x && 2y == x && } 0 0 x0 > y0+10 } 0 0 x0 > y0+10 x <= y +10 x <= y +10 } 0 0 } 0 0 x = x , y = y x = x , y = y 0 0 ERROR 0 0 ERROR } z = 2y0 } z = 2y0 33 34 Symbolic Execution Existing Approach II n Symbolic Execution testMe(int x){ int double (int v) { x = x0, y = y0 Solve these constraints: q use symbolic values for true if(pickEven(x) == 17) { return 2*v; (a.k.a.
Recommended publications
  • Python Guide Documentation 0.0.1
    Python Guide Documentation 0.0.1 Kenneth Reitz 2015 09 13 Contents 1 Getting Started 3 1.1 Picking an Interpreter..........................................3 1.2 Installing Python on Mac OS X.....................................5 1.3 Installing Python on Windows......................................6 1.4 Installing Python on Linux........................................7 2 Writing Great Code 9 2.1 Structuring Your Project.........................................9 2.2 Code Style................................................ 15 2.3 Reading Great Code........................................... 24 2.4 Documentation.............................................. 24 2.5 Testing Your Code............................................ 26 2.6 Common Gotchas............................................ 30 2.7 Choosing a License............................................ 33 3 Scenario Guide 35 3.1 Network Applications.......................................... 35 3.2 Web Applications............................................ 36 3.3 HTML Scraping............................................. 41 3.4 Command Line Applications....................................... 42 3.5 GUI Applications............................................. 43 3.6 Databases................................................. 45 3.7 Networking................................................ 45 3.8 Systems Administration......................................... 46 3.9 Continuous Integration.......................................... 49 3.10 Speed..................................................
    [Show full text]
  • CS 6311 – Programming Languages I – Fall 2006 Assignment #1 (100 Pts) Due: 7:00Pm, Monday 9/25/6
    Most of the solutions are from Edwin Rudolph (who did an outstanding job on the assignment) with a few modifications. CS 6311 – Programming Languages I – Fall 2006 Assignment #1 (100 pts) Due: 7:00pm, Monday 9/25/6 Directions: The answers to the following questions must be typed in Microsoft Word and submitted as a Word document by the due date. There are a total of 40 questions. 1. A system of instructions and data directly understandable by a computer’s central processing unit is known as what? (1 pt) Machine language. 2. What is the name of the category of programming languages whose structure is dictated by the von Neumann computer architecture? (1 pt) Imperative. 3. Although PL/I and Ada were designed to be multi-purpose languages, in fact PL/I was considered to be the “language to end all languages”, why is there such difficulty in creating a general purpose programming language applicable to a wide range of areas? (3 pts) The difficulty in creating an all purpose language lies in the fact that the variety of problems that we ask computers to solve do not all lend themselves to being easily or conveniently expressed in the same way. Numerical processing involves different types of tasks than string processing; a program which computes trajectories of a spacecraft probably does not require extensive string processing facilities, just as a program to search for patterns in news feeds does not require extensive mathematical facilities. Attempting to create languages which provide facilities for solving all types of problems is that the language suffers from a feature bloat, not only making it difficult for programmers to effectively use it, but also making it more difficult to implement compilers and/or translators for.
    [Show full text]
  • Debugging and Profiling on Intel® Xeon Phi™
    PRACE Summer School, CINECA 8 -11 July 2013 Debugging and Profiling on Intel® Xeon Phi™ Hans Pabst, July 2013 Software and Services Group Intel Corporation Agenda Debugging • Compiler Debug Features • GNU* Project Debugger • Intel® Inspector Profiling • Compiler Profiling Features • Intel® VTune™ Amplifier Demonstration 2 Copyright© 2013, Intel Corporation. All rights reserved. 10.07.2013 *Other brands and names are the property of their respective owners. Compiler Debug Features Static Analysis (SA): icc -diag-enable scn • Customize analysis level (and other adjustments) • Textual and Inspector based reports • Issue tracking via Inspector GUI Pointer Checker (PL): icc -check-pointers=rw • Further option adjustments possible • No ABI changes despite of bounds information • Intrinsics / API for custom memory allocation • Rigorous checks; failure behavior adjustable • Debugger integration 3 Copyright© 2013, Intel Corporation. All rights reserved. 10.07.2013 *Other brands and names are the property of their respective owners. Intel® Inspector: Static Analysis Analysis: 250 error types • Incorrect directives • Security errors Reports and collaboration • Choose your priority: - Minimize false errors - Maximize error detection • Hierarchical navigation • Share comments with team Code Complexity Metrics • Find code likely to be less reliable 4 Copyright© 2013, Intel Corporation. All rights reserved. 10.07.2013 *Other brands and names are the property of their respective owners. Agenda Debugging • Compiler Debug Features • GNU* Project Debugger
    [Show full text]
  • Python Tutorial by Bernd Klein
    Python Tutorial by Bernd Klein bodenseo © 2021 Bernd Klein All rights reserved. No portion of this book may be reproduced or used in any manner without written permission from the copyright owner. For more information, contact address: [email protected] www.python-course.eu Python Course Python Tutorial by Bernd Klein Strings.......................................................................................................................................10 Execute a Python script ............................................................................................................11 Start a Python program.............................................................................................................12 Loops ......................................................................................................................................136 Iterators and Iterables .............................................................................................................150 Coffee, Dictionary and a Loop ...............................................................................................171 Parameters and Arguments.....................................................................................................226 Global, Local and nonlocal Variables.....................................................................................237 Regular Expressions ...............................................................................................................305 Lambda, filter, reduce
    [Show full text]
  • Programming Languages Overview & Syntax
    Programming Languages Session 1 – Main Theme Programming Languages Overview & Syntax Dr. Jean-Claude Franchitti New York University Computer Science Department Courant Institute of Mathematical Sciences Adapted from course textbook resources Programming Language Pragmatics (3rd Edition) Michael L. Scott, Copyright © 2009 Elsevier 1 Agenda 1 Instructor and Course Introduction 2 Introduction to Programming Languages 3 Programming Language Syntax 4 Conclusion 2 Who am I? - Profile - 31 years of experience in the Information Technology Industry, including thirteen years of experience working for leading IT consulting firms such as Computer Sciences Corporation PhD in Computer Science from University of Colorado at Boulder Past CEO and CTO Held senior management and technical leadership roles in many large IT Strategy and Modernization projects for fortune 500 corporations in the insurance, banking, investment banking, pharmaceutical, retail, and information management industries Contributed to several high-profile ARPA and NSF research projects Played an active role as a member of the OMG, ODMG, and X3H2 standards committees and as a Professor of Computer Science at Columbia initially and New York University since 1997 Proven record of delivering business solutions on time and on budget Original designer and developer of jcrew.com and the suite of products now known as IBM InfoSphere DataStage Creator of the Enterprise Architecture Management Framework (EAMF) and main contributor to the creation of various maturity assessment methodology
    [Show full text]
  • Programming Language Basics
    Programming Languages and Software Development •Programming Languages •Program Structure •Problem Solving •Object-Oriented Programming •Reading for this class: Dawson, Chapter 1/2 What is a program? • It consists of two components: o Data (numbers, characters, true/false) o Steps • A program goes through a number of steps with pieces of data to achieve a result: o Printing text to screen o Collecting information o Performing calculations • Example: Long Division Programming Languages • Computer programmers write programs for computers using one or more programming languages • Some languages are better for one type of program or one style of user interface than for others • You may have heard of some programming languages: Basic, Lisp, C/C++, Java, Python, Assembly Language, and Others "Hello, World" Versions • Java: C: public class Hello { • #include <stdio.h> public static void main(String[] args) { #include <stdlib.h> System.out.println("Hello World"); } int main(void) } { • Basic: 10 PRINT "HELLO WORLD" printf("Hello, world\n"); • Fortran: PROGRAM HELLOWORLD return EXIT_SUCCESS; 10 FORMAT (1X,11HHELLO WORLD) } WRITE(6,10) • Scheme: END "HELLO WORLD" (display "Hello, World!") • Python: print ("Hello World") (newline) Source: http://c2.com/cgi/wiki?HelloWorldInManyProgrammingLanguages Programming Languages •A programming language specifies the words and symbols that we can use to write a program •A programming language employs a set of rules that dictate how the words and symbols can be put together to form valid program statements •A programming language has both syntax and semantics Syntax and Semantics • The syntax rules of a language define how we can put together symbols, reserved words, and identifiers to make a valid program • The semantics of a program statement define what that statement means (its purpose or role in a program) • A program that is syntactically correct is not necessarily logically (semantically) correct • A program will always do what we tell it to do, not what we meant to tell it to do Syntax vs.
    [Show full text]
  • Making Fortran Legacy Code More Functional
    Making Fortran Legacy Code More Functional ∗ Using the BGS Geomagnetic Field Modelling System as an Example Hans-Nikolai Vießmann Sven-Bodo Scholz Artjoms Šinkarovs Heriot-Watt University Heriot-Watt University Heriot-Watt University [email protected] [email protected] [email protected] Brian Bainbridge Brian Hamilton Simon Flower British Geological Survey British Geological Survey British Geological Survey [email protected] [email protected] [email protected] ABSTRACT 1. INTRODUCTION This paper presents an application case study of the British Geo- The lambda calculus’ Church-Rosser property suggests that func- logical Survey’s (BGS) Geomagnetic Field Modelling System code. tional programming languages should offer opportunities for effi- The program consists of roughly 20 000 lines of highly-tuned FOR- cient parallel execution. Research over the last four decades has TRAN MPI code that has a runtime of about 12 hours for a signal produced excellent results that demonstrate how this conceptual execution cycle on a cluster utilising approximately 100 CPU cores. advantage can be turned into real speedups on parallel hardware [15, The program contains a sequential bottleneck that executes on a 18, 26, 27, 32, 35]. Despite these advances, functional programming single node of the cluster and takes up to 50% of the overall runtime. has not yet made it into mainstream high-performance computing We describe an experiment in which we rewrote the bottleneck FOR- (HPC). TRAN code in SAC, to make use of auto-parallelisation provided There are many reasons for this, but the key issue is that the by the SAC compiler.
    [Show full text]
  • Introduction to Compiling and Debugging
    Introduction to Compiling and Debugging Drew Gustafson ([email protected]) Evan Bollig ([email protected]) MN Supercomputing Institute for Advanced Computational Research © 2009 Regents of the University of Minnesota. All rights reserved. Tutorial Summary •Building Software oCompiling and Linking oAutomated Build Systems •Debugging Code •Profiling •Hands-On MN Supercomputing Institute for Advanced Computational Research © 2009 Regents of the University of Minnesota. All rights reserved. Hands-on git clone https://github.umn.edu/msi/ tutorial_intro_compiling_debugging_fall2015.git MN Supercomputing Institute for Advanced Computational Research © 2009 Regents of the University of Minnesota. All rights reserved. Compiling and Linking Compiler Phases, Optimization Flags, Link Libraries, etc. MN Supercomputing Institute for Advanced Computational Research © 2009 Regents of the University of Minnesota. All rights reserved. What is a Compiler? A compiler is a program to turn human readable source code into a machine code “program” for execution. •Not all programming languages use compilers; the fastest executing ones do. •In the process of compiling, most compilers partially “optimize” code for faster, more efficient execution. Image source: http://en.wikipedia.org/wiki/File:Compiler.svg MN Supercomputing Institute for Advanced Computational Research © 2009 Regents of the University of Minnesota. All rights reserved. The Compilers Available @MSI Intel Compilers ○ Loaded with: module load intel ○ C compiler: icc ○ C++ compiler: icpc ○ Fortran
    [Show full text]
  • Introduction to Jython, Part 2: Programming Essentials
    Introduction to Jython, Part 2: Programming essentials Presented by developerWorks, your source for great tutorials ibm.com/developerWorks Table of Contents If you're viewing this document online, you can click any of the topics below to link directly to that section. 1. About this tutorial....................................................... 2 2. Object-oriented programming in Jython ............................ 5 3. Advanced object-oriented programming ........................... 13 4. Debugging Jython...................................................... 25 5. Java support in Jython ................................................ 29 6. Java thread support in Jython........................................ 34 7. Interfacing with Java services........................................ 40 8. Jython string processing .............................................. 46 9. Processing regular expressions ..................................... 54 10. File I/O in Jython...................................................... 58 11. A simple Swing GUI .................................................. 67 12. Wrap-up and resourcesFeedback ................................. 73 13. Appendices ............................................................ 76 Introduction to Jython, Part 2: Programming essentials Page 1 of 100 ibm.com/developerWorks Presented by developerWorks, your source for great tutorials Section 1. About this tutorial What is this tutorial about? This is the second installment in a two-part tutorial designed to introduce you to the
    [Show full text]
  • In the GNU Fortran Compiler
    Using GNU Fortran For gcc version 11.1.0 (GCC) The gfortran team Published by the Free Software Foundation 51 Franklin Street, Fifth Floor Boston, MA 02110-1301, USA Copyright c 1999-2021 Free Software Foundation, Inc. Permission is granted to copy, distribute and/or modify this document under the terms of the GNU Free Documentation License, Version 1.3 or any later version published by the Free Software Foundation; with the Invariant Sections being \Funding Free Software", the Front-Cover Texts being (a) (see below), and with the Back-Cover Texts being (b) (see below). A copy of the license is included in the section entitled \GNU Free Documentation License". (a) The FSF's Front-Cover Text is: A GNU Manual (b) The FSF's Back-Cover Text is: You have freedom to copy and modify this GNU Manual, like GNU software. Copies published by the Free Software Foundation raise funds for GNU development. i Short Contents 1 Introduction ::::::::::::::::::::::::::::::::::::::::: 1 Invoking GNU Fortran 2 GNU Fortran Command Options :::::::::::::::::::::::: 7 3 Runtime: Influencing runtime behavior with environment variables ::::::::::::::::::::::::::::::::::::::::::: 33 Language Reference 4 Fortran standards status :::::::::::::::::::::::::::::: 39 5 Compiler Characteristics :::::::::::::::::::::::::::::: 45 6 Extensions :::::::::::::::::::::::::::::::::::::::::: 51 7 Mixed-Language Programming ::::::::::::::::::::::::: 73 8 Coarray Programming :::::::::::::::::::::::::::::::: 89 9 Intrinsic Procedures ::::::::::::::::::::::::::::::::: 113 10 Intrinsic
    [Show full text]
  • Declare Namespace in Class Php
    Declare Namespace In Class Php Papaveraceous Ivor always scribblings his Ganesa if Ashby is hypertrophied or submerges decidedly. Philippian Ron Graecizing mathematically. Epistatic Lamont shire, his pimples effervesce anneals causelessly. But is designed to php namespace name must be overwritten in python languages have exposure to construct is better understand namespace comes to the named Class Ctest public Ctest void a testh ifndef rocketbotremotecontrolh define rocketbotremotecontrolh namespace test. We will acknowledge a method for that. This class declarations within opened in classes and declare the declaration when you! Tweeting the mantle to adopt old blog post show why PHP namespaces are flawed might. In short, interfaces, any reference to a class is relative time that namespace. These are php declare statement order of a conflict with php declare a folder names is only get your module cannot get to any namespaces are. Our classes in class declarations and declare in a declared only. Namespacing you avoid whitespace after the declaration and use of our php! How each use PHP Namespaces in WordPress Plugins Igor Beni. PHP Declaring sub-namespaces php Tutorial. An equivalent to declare statement. Lines should already contain trailing spaces. In the mix, do in class files are. It is through common PHP practice to use our same function for getter cum setter, the global variable remains unchanged. Although supported at namespace in one of classes is the root namespaces? PHP Namespaces for WordPress Developers Steve Grunwell. For preserve the applicationcomponentsGoogleMap class is declared within the namespace applicationcomponents Using namespaced classes requires PHP. But in classes in order to declare a declared.
    [Show full text]
  • Quantecon-Python-Programming.Pdf
    Python Programming for Economics and Finance Thomas J. Sargent & John Stachurski Sep 17, 2021 CONTENTS I Introduction to Python 3 1 About Python 5 1.1 Overview ................................................. 5 1.2 What’s Python? .............................................. 5 1.3 Scientific Programming .......................................... 7 1.4 Learn More ................................................ 15 2 Setting up Your Python Environment 17 2.1 Overview ................................................. 17 2.2 Anaconda ................................................. 17 2.3 Jupyter Notebooks ............................................ 18 2.4 Installing Libraries ............................................ 30 2.5 Working with Python Files ........................................ 31 2.6 Exercises ................................................. 32 3 An Introductory Example 35 3.1 Overview ................................................. 35 3.2 The Task: Plotting a White Noise Process ................................ 35 3.3 Version 1 ................................................. 36 3.4 Alternative Implementations ....................................... 40 3.5 Another Application ........................................... 44 3.6 Exercises ................................................. 45 3.7 Solutions ................................................. 47 4 Functions 53 4.1 Overview ................................................. 53 4.2 Function Basics .............................................. 54 4.3 Defining
    [Show full text]