Podcast
Questions and Answers
Which scripting technique focuses primarily on separating data from scripts for varied test runs?
Which scripting technique focuses primarily on separating data from scripts for varied test runs?
- Keyword driven testing
- Linear scripting
- Data driven scripting (correct)
- Structured scripting
What is a characteristic of structured scripting?
What is a characteristic of structured scripting?
- It allows decision-making using control statements like 'if-else'. (correct)
- It enables simple record and playback without control structures.
- It depends on external files for its operations.
- It defines shared behaviors across multiple scripts.
In the context of shared scripting, what does modularity imply?
In the context of shared scripting, what does modularity imply?
- Common functionalities can be reused across different scripts. (correct)
- The script acts as a large, monolithic entity with no separation.
- Scripts can only interact within a single application.
- Scripts must be fully independent with no shared components.
Which technique utilizes external data files to define both test data and operation sequences?
Which technique utilizes external data files to define both test data and operation sequences?
What is a potential drawback of linear scripting?
What is a potential drawback of linear scripting?
What is the main focus of data driven scripting?
What is the main focus of data driven scripting?
Which scripting technique would be best suited for applications requiring frequent modifications to shared behaviors?
Which scripting technique would be best suited for applications requiring frequent modifications to shared behaviors?
Which of the following describes the purpose of keyword driven testing?
Which of the following describes the purpose of keyword driven testing?
What is the primary function of a compiler in programming?
What is the primary function of a compiler in programming?
Which of the following is NOT a client-side scripting language?
Which of the following is NOT a client-side scripting language?
What role does client-side scripting play in web development?
What role does client-side scripting play in web development?
What was the original name of JavaScript before its rebranding?
What was the original name of JavaScript before its rebranding?
How does an interpreter differ from a compiler?
How does an interpreter differ from a compiler?
Which statement accurately reflects the use of JavaScript in web development?
Which statement accurately reflects the use of JavaScript in web development?
When a browser requests a webpage, what does the server provide?
When a browser requests a webpage, what does the server provide?
What is the function of CSS in web development?
What is the function of CSS in web development?
What is the primary purpose of creational design patterns?
What is the primary purpose of creational design patterns?
What benefit do design patterns provide during software development?
What benefit do design patterns provide during software development?
Which classification of design patterns focuses on the organization of classes and objects?
Which classification of design patterns focuses on the organization of classes and objects?
What is a distinguishing feature of object-creation patterns?
What is a distinguishing feature of object-creation patterns?
Which of the following statements about behavioral patterns is true?
Which of the following statements about behavioral patterns is true?
How do structural class-creation patterns differ from structural object-patterns?
How do structural class-creation patterns differ from structural object-patterns?
What is the main reason for reusing design patterns in software design?
What is the main reason for reusing design patterns in software design?
Which design pattern category is least likely to be used for enhancing functionality through object composition?
Which design pattern category is least likely to be used for enhancing functionality through object composition?
What does the $this keyword refer to in PHP?
What does the $this keyword refer to in PHP?
How can the value of the $name property be changed outside the class?
How can the value of the $name property be changed outside the class?
What is the role of the extends keyword in PHP?
What is the role of the extends keyword in PHP?
What is required to define a user-defined function in PHP?
What is required to define a user-defined function in PHP?
What does passing an argument to a function in PHP resemble?
What does passing an argument to a function in PHP resemble?
Which statement is true regarding the Strawberry class in relation to the Fruit class?
Which statement is true regarding the Strawberry class in relation to the Fruit class?
Which of the following is an essential characteristic of functions in PHP?
Which of the following is an essential characteristic of functions in PHP?
What must occur for a user-defined function to execute?
What must occur for a user-defined function to execute?
What is the purpose of the CREATE DATABASE statement in MySQL?
What is the purpose of the CREATE DATABASE statement in MySQL?
Which attribute ensures a column can only hold positive numbers and zero in MySQL?
Which attribute ensures a column can only hold positive numbers and zero in MySQL?
What must be true about the SQL query when inserting data into a MySQL database using MySQLi?
What must be true about the SQL query when inserting data into a MySQL database using MySQLi?
What is the function of the WHERE clause in a MySQL SELECT statement?
What is the function of the WHERE clause in a MySQL SELECT statement?
What does the ORDER BY clause do in a MySQL query?
What does the ORDER BY clause do in a MySQL query?
In which scenario would you use the AUTO INCREMENT attribute in a MySQL table?
In which scenario would you use the AUTO INCREMENT attribute in a MySQL table?
Which of the following is NOT a rule for inserting data into a MySQL table?
Which of the following is NOT a rule for inserting data into a MySQL table?
Which column setting would you use to ensure that each row in a table has a unique identifier?
Which column setting would you use to ensure that each row in a table has a unique identifier?
Flashcards are hidden until you start studying
Study Notes
Design Patterns
- Design patterns categorize into 3 sub-classifications: Creational, Structural, and Behavioral patterns
- Creational patterns focus on object creation based on specific criteria and controlled instantiation.
- Structural patterns are about organizing classes and objects into larger structures, offering new functionality.
- Behavioral patterns identify and implement common communication patterns between objects.
- Design patterns improve code readability for programmers familiar with them
- Design patterns help prevent subtle issues leading to major software issues.
Creational Patterns
- Abstract Factory - provides an interface for creating families of related objects. Ensures consistency within a family.
- Builder - separates the construction of a complex object from its representation
- Factory Method defines an interface for creating objects. Allows subclasses to decide which class to instantiate.
- Prototype: specifies the kinds of objects to create using a prototypical instance. Creates new objects by copying this prototype.
- Singleton: ensures that a class has only one instance and provides a global point of access.
Structural Patterns
- Adapter: converts the interface of a class into another interface clients expect. Enables incompatible classes to work together.
- Bridge: Decouples an abstraction from its implementation. Allows both to vary independently
- Composite: composes objects into tree structures to represent part-whole hierarchies. Lets clients treat individual objects and compositions uniformly.
- Decorator: dynamically adds responsibilities to an object. Provides a flexible alternative to subclassing for extending functionality.
- Facade: provides a simplified interface to a complex subsystem
- Flyweight: shares objects to support large numbers of fine-grained objects efficiently. Uses sharing to support large numbers of fine-grained objects efficiently
- Proxy: provides a surrogate or placeholder for another object to control access to it.
PHP - The '$this' Keyword
- Refers to the current object
- Only available inside methods
- Allows access and manipulation of object properties and methods within the object's context
PHP - Inheritance
- A child class inherits properties and methods from a parent class using the
extends
keyword. - Inherited classes can have their own properties and methods in addition to those inherited.
- Inheritance allows code reuse and creates a hierarchy of classes.
PHP - User-Defined Functions
- Functions are reusable blocks of code that perform specific tasks
- Defined using the
function
keyword followed by the function name and parentheses. - Code within the function is executed only when the function is called.
- Can accept arguments (inputs) and return values (outputs)
Scripting Techniques for Test Automation
- Linear scripting: simple record and playback of user actions. Can be redundant and inflexible.
- Structured scripting: incorporates control structures like
if-else
,for
andwhile
loops for decision-making and iteration. - Shared scripting: Develops reusable scripts for common functionality across different tests. Enhances modularity and code reuse.
- Data-driven scripting: Separates test data from the script, stored in external data files. Provides flexibility to adjust test data without modifying the script.
- Keyword-driven testing: Uses keywords to represent test actions and stores them in external data files. Requires a library for interpretation.
Client-Side Scripting
- Client-side scripting executes code in the user's browser (client) without needing server interaction.
- This speeds up website performance and reduces server load.
- Examples include JavaScript, HTML, and CSS.
- JavaScript is widely used for dynamic web page elements, user interaction, and validation.
Javascript
- Initially called
LiveScript
. - Released with Netscape 2.0 in 1995.
- Server-side JavaScript frameworks are also available.
MySQLi
- MySQLi is a PHP extension for interacting with MySQL databases.
Opening a Connection to MySQL
- The
mysqli_connect()
function establishes a connection to a MySQL server.
Creating a MySQL Database
- The
CREATE DATABASE
statement creates a new database.
Creating a MySQL Table
- The
CREATE TABLE
statement creates a new table within a database. - It defines columns, their data types, and optional attributes like
NOT NULL
,DEFAULT
,AUTO_INCREMENT
, andPRIMARY KEY
.
Inserting Data Into MySQL
- The
INSERT INTO
statement adds new records to a table. - String values are enclosed in single quotes.
- Numeric values are not quoted.
- The word
NULL
is not quoted.
Selecting Data From MySQL
- The
SELECT
statement retrieves data from a table.
Filtering Data with WHERE Clause
- The
WHERE
clause filters selected data based on specified conditions.
Ordering Data with ORDER BY Clause
- The
ORDER BY
clause sorts the retrieved data in ascending or descending order. - The default order is ascending.
Studying That Suits You
Use AI to generate personalized quizzes and flashcards to suit your learning preferences.