Concepts Flashcards
What are the 5 stages in a software development lifecycle (SDLC)
1 requirements analysis 2 design 3 development 4 testing 5 Maintenance
Statistically automation is in average _________ more beneficial than manual testing
5
Automated testing provides a___________ feedback that everything in our product works properly.
continuous
Automation testing is used for functional or non-functional testing?
Non functional
What are non functional testing types
Performance Stress Load Endurance Scalability Volume Usability
What is the structure of an automated script
Find an element Perform some action on the element Verify the expected result
How do we locate the elements?
Look into the HTML source code and identify HTML attributes like Id, class, CSS, Selectors, Xpaths….
what is type coercion?
JS automatically figures out which one of the variable it has to convert and does it. ‘Tariq26’.
console.log(name + age) example of type coercion
tariq52
console.log(age + age) example of no type coercion
104
undefined variable
when a variable is defined but no value is assigned
var lastName = prompt(‘what is the last name?’);
alert(‘John is a thirty six year old driver. Is he married? false’)
var ageTariq = 50;
ageTariq = 5*5+10;
console.log(ageTariq);
Is ageTariq =50 or 35 and why?
it is 35 because of operator precedence
var ageTariq = 25;
ageTariq *= 2;
What is the output?
50
if (23 == ‘23’)
true or false?
True as == does type coercion
if (23 === ‘23’)
true or fasle
false as === does not do type coercion
whats the sexier method of writing
x = x * 2
x = x + 2
x = x - 2
x *= 2
x *= 2
x *- 2
Ternary Operator
var drink = age >=18 ? ‘beer’ : ‘juice’
condition age>=18 is evaluated before either beer or juice value is assigned to drink.
Why is important to use the Break statement in a switch case?
otherwise, the switch statement will continuously poll for a result
var job = ‘teacher’;
switch (job) {
case = ‘teacher’:
case = instructor’:
console.log(‘John teaches kids how to code’);
Break;
console.log will be printed for both job is equal to teacher and Instructor
if var Height = 0
is it classed as a defined or undefined variable?
undefined….
var height =23;
if (height == ‘23’) {
console.log(‘The == operator does type coercion’);
] else
console.log(‘The == operator does not do type coercion};
The == operator does type coercion
DRY
Don’t Repeat Yourself
do we need a ‘break’ statement in Switch when used inside a function?
nope, no need as the function will break automatically when a condition is met in switch.
A statement is a complete line of code that performs some ____________
action
An expression is any section of the code that evaluates to a _______
Value.
How do we display a defined array?
//String array of fruits defined
String[] fruits ={“Apple”, “banana”, “pear”, “kiwi};
//assign fruits to a new string variable ‘fruit’ and print it
for (String fruit:fruits) {
System.put.println(string);
}
are both array definitions of intArray valid?
int intArray[];
or
int[] intArray;
An array declaration has two components: the type and the name. type declares the element type of the array. The element type determines the data type of each element that comprises the array.
In this case, only a reference of intArray is created. The size isn’t defined yet.
Expalin the comments
int intArray[];
intArray = new int[20];
int[] intArray = new int[20];
//declaring array
// allocating memory to array
// combining both statements in one
What are the 3 elements of a variable?
type of variable
name of variable
inital value of variable