Programming Knowledge for Software Testers

Computer Programming Knowledge for Automated Testing

Programming Knowledge for Software Testers

Programming Knowledge for Software Testers is mandatory for Automated Testers, Programming Knowledge for Software Developers and Programming Knowledge for Database Developers. UFT (Formerly QTP) uses VBScript for writing Automated Test Scripts and Selenium uses either Java or C#.NET or Python or Perl or Ruby or PHP for writing Selenium Test Cases.

Nowadays programming knowledge is essential for every Software professional,

For Software developers Programming knowledge is mainstream so it is mandatory,

For Software Testers who wants to use automation tools (Ex: UFT/QTP or Selenium etc…) it is important,

For Database Developers also it is important (ex: In Oracle RDBMS they use Procedure Language),

For System Administrators/Network Administrators also programming knowledge is important (ex: In Shell scripting they use programming features/logic).

So Programming knowledge is important for every Software professional.

Software Testing:

Software Testing can be done in two ways,

1) Manual Testing
(Testing Computer Software, Mobile Software manually without using any tool or program)

2) Test Automation / Automated Testing
(Testing Computer Software, Mobile Software using any automation tool or program)

If we follow Manual Testing then Programming knowledge is optional or not required, just understanding requirements, writing test cases, executing test cases, finding defects and reporting.

Understanding, Reasoning, Documentation, Executing and Reporting these are the important skills for Manual Testing.

If it is Test Automation or Automated Testing apart from Manual Testing knowledge Programming knowledge also required.

You take any automation tool UFT or RFT or Selenium etc.. They use any one the programming languages to enhance Test cases.

UFT uses VBScript for writing Test Scripts,

Selenium Supports various Programming languages (Java, C#, Python, Perl, PHP, Ruby) you can use any one supported programming language.

You take any programming language or Scripting Language 80% skeleton is same. Syntax may vary from one language to another and some features may vary from one language to another.

For Example,

1) In VBScript every If statement should close with End IF Statement, but in Java if condition enclosed with {}.

2) In C Language no Object concept but Function is there for code reusability, in Java we use Object for code reusability. Functions and Methods both are same in purpose (*some difference is there).

If you learn any one programming language then learning other programming language is very easy, why because most of the Programming concepts are common in purpose, Syntax may vary and some features may vary from one language to another.

Important Languages:

C Language – It is Structure Programming Language

Java – Object Oriented programming Language

VBScript – Object based Scripting Language

Programming Fundamentals and Features for Testers

1) Comments

> To make the Code Readable
> To make the Code disable from Execution.

Note: Writing comments is not mandatory but best practice (Coding standard).

2) Data Types

A Data Type is a classification of the type of data that a variable or object can hold in computer programming.

Example:

Character,

Integer,

String

Float

Boolean etc…

3) Modifiers

Modifiers are used to set access levels.

4) Variables

Variable is a named memory location to store temporary data within a program.

5) Operators

Operators are used to perform Mathematical, Comparison and Logical Operations.

Categories of Operators:

i) Arithmetic Operators

ii) Relational Operators

iii) Assignment Operators

iv) Logical Operators etc…
—————————————-
Flow Control Conditional Statements
Loop Statements

6) Conditional Statements

Ex: if statement
———————–
Types of Conditions

i) Single Condition (Positive/Negative)

ii) Compound Condition (Positive/Negative)

iii) Nested Condition (Positive/Negative)
—————————————
Usage of Conditional Statements

i) Execute a block of statements when a condition is true.

ii) Execute a block of statements when a condition is true, otherwise execute another block of statements.

iiii) Execute a block of statements when a Compound condition is true, otherwise execute another block of statements.

iv) Decide among several alternates (Else if)

v) Execute a block of statements when more than one condition is true (Nested if).
Etc…

7) Loop Statements

Used for Repetitive execution.

Ex: for loop, while loop etc…

8) Arrays

> Generally, Array is a collection of similar type of elements.

> In Java, Array is an Object that contains elements of similar data type.

> In C language Array is variable only and VBScript also Array is just variable (two type of variables in VBScript 1) Scalar variables 2) array Variables)

> Array is index based, index starts from zero.

9) IO (Input and Output) Operations

> Read data using Input devices.

> Display output on the Console.

> Read data from files / write data

10) Functions, Methods

Methods are also known as Functions.

> In Structured Programming (Ex: C Language) we use Functions (Built-in and User defined)

> In Object Oriented Programming (Ex: Java Language) we use Methods (Built-in and User defined)

11) Regular Expressions

It is a formula for matching patterns, A Regular expression defines search pattern for Strings.

Constant matching

india.doc – india.doc

Pattern matching

i*.

ia…..
ib….
.
.
india.doc

12) Exception Handling

In Computer Programming, Exception is an abnormal condition.

> An exception is an event that occurs during the execution of a program that disturbs the normal flow of instructions.

> The Exception handling is one of the powerful mechanisms to handle Run-time errors.

13) File Handling

Handling Drives, Folders, Flat files, Excel files, Database files etc…

14) Coding Standards etc…

Above are the common programming concepts and you can find some other concepts in Computer programming.

For example OOPS concepts in Java,

Java Object Oriented Programming System (OOPS) concepts.

Four fundamentals of OOPS

1) Inheritance

2) Polymorphism

3) Abstraction

4) Encapsulation

Java for Selenium Videos

Java Tutorial 1
(Overview of Java Programming Language)

Java Tutorial 2
(Introduction to Java and Java Environment Setup)

Java Tutorial 3
(Java Program Structure, Comments in Java, Java Data Types)

Java Tutorial 4
(Java Modifiers, Variables and Operators Part-1)

Java Tutorial 5
(Java Operators Part-2 and Conditional Statements)

Java Tutorial 6
(Java Loop Statements, String Handling)

Java Tutorial 7
(Java Arrays, Java Input and Output)

Java Tutorial 8
(Java Exception Handling, File Handling)

Java Tutorial 9
(User Defined Methods in Java)

Java Tutorial 10
(Java Built in Methods)

Java Tutorial 11
(Java Inheritance and Polymorphism)

Java Tutorial 12
(Java Abstraction and Encapsulation)
—————————————-

Follow me on social media: