Job Search

what where  
job title, keywords or company
city, state or zip jobs by job search

Java

 OOPs
Object oriented programming
Java, C#, Ruby, Python, and Perl follows this

Java with Selenium has more use.

What is Classes
Class -a Class is a group of objects that have common property.
Its is a template or blueprint from which objects are crated

Object
an entity that has a state and behavior is known as an object ex


Constructor in java is a special type of method because it needs to fulfill following two conditions
1) Name of the constructor should be same as that of the class.
2) It should not have a return type.
  1. mercedes is a car> mercedes is an object of class car
In Eclipse
First create Package> Project>class

java
int integer -cant be name, has to be a value, always integer
int length = 201;
int breadth = 125;

int is called data types
length and breadth are called data variables-as they can store any value
to store name of car in variable

every line has to end in variable

Convention of declaring variables
Camel casing convention

If we have to declare variable
First character has to be small and first letter of second word has to be capital
so if we have to declare your car name, i.e first word of first word is small
so write
String carName = "Mercedes";
If we declare variable color
String color = "I have a mercedes of white color"

There is more data type called (to store one character) example bmw has model #360 or mercedes wide 270
>>>If one character has to be stored , we store in one variable of char and store in single quotes

if one variable has to be stored then it stored in char
String store many variables but char for one character to be stored
so we will write
char model = 'x';
(also char stored in single quotes

>>>if we have to store decible, then declare variable called
double breadth = 124.57;
 difference between integer and decimal
if it involves dot then we have to use data type double
Also available float so we can also write
float breadth = 1245.56f;
If number belongs to float category, we write f after number.
float can store upto 4 digits
 meaning-when we declare or write double breadth then space declared is big
float breath is declared, then space created inside memory is small
If # of digits after decible are many then we declare as double
if # of digits after decible are less then we can declare as float

what is Boolean
Boolean is something that can have only two values
true or false
like
boolean isMercedesCostly = true;
boolean canIBuyIt = false;

these are datatype that we have to deal in java
there is something like creating our own datatype
int/string/char/double/float and boolean

package demo;

public class Calculator {
    public void add( int a, int b);
    System.out.println(a+b);
    public static void main(Static[]args){
        Calculator basicCal = new Calculator;
        basicCal.add(10,20);
  
      
    }

}

Constructor in java is a special type of method
it need to fullfill
1) name of the constructor should be same as class
2) it should not have return type

return of multiplacation of two numbers is int
return of addition or two numbers is double
return of favourite actore type is string
what is void return type
its a void return type

that is used to initializes the object.
Java constructor is invoked at the time of object creation.
it constructs the values i.e.
  provides that data for the object that is why this is called constructor

sHAPES
App consist of calculating area
back end behind to cacluate area
say 4 x 1 sent to programme to calculate area
 variable at class level called as field
it outside method than called as field

every method followed by ( )

Decision making
Decision is made using IF statment
so
public demo;
public class DecisionMaking{
    public static void main(String[]args){
     if (mealAtHome.equals("Something Tasty")){
System.out.printlm("I ill ofer a small Pizza for snaks" );
}
else {
System.out.println("Order a main course meal");
}
int money = 25;


Press control and forward slash to get // lines
 You can't compare strings and integers in same

IF integers have to be compared then wehave to use
Int money = 25

&& is and in java
and is both have to satify together


If more conditions then we use switch case statement


or is

||

switchcase
public static void main(String[]args){
String day ="Monday"
switch(day){
case "Monday":
System.out.println("I will wear white today");
break:

default statement always come at bottom

what is abstract class and interface
its a theoretical concept
this is something we wont be using in selenium but important for interview

security class was giving message that all department will get 3 messages
we discussed this in message overriding

message still remains similar

all the employees should get message that all emplyess will get 5 messages
hr will get 4
accounts will get 3
securiy will get 2

we actually going to override message in all the child classnow
it will be declatedin parent classes and also overridgen in child lasses
in this we create abrstract class

when we declere as abstract then class that declare thosuldbe declare as abstract class
so after public, write abstract class
public abstract class Management {
when we declare method as abstract, then we declaing than method will be dicussed in child class
so lets see
lets create a child class

to make extended class of child class we writ
public class IT extends Management {
 @overrise
public void message () {
System.out.println(

now go to hr class
public class HR extends Management{
public void message (){
System. out.println("All the employess

now accounts
public class Accounts extends Management{
@override


now to security
public class Security extends Management{

lets create object of child classes

Ram.message(); (in this we calling message from IT class as RAMbelongs to IT class
 John.message();
Sam.message();
Bob.message();

what is diff
abstract can contain abstract method
normal class can't hold abstract method
asbtract class can have normal and abstract method

message is -next month onwrds, employess get to attnd two extra day in office
this message to accounts and security dept only
how we can do this

message is similar .condition is to convey to two child classes

 we don't want message to it and hr
if we put in parent class than it will be visible toitand hr
only accout and securiy dept
what we can dohere
we can't place meessage in management.

second, we can create one more parent class , which is parent to security and accounts only
butproblem, wecan't create two parent classes
multiple parents are not allowed in java

Concept of interfacein java. It gives functionally ofparent class but its not a class
its a interface
so we wont creat a another class. rather we create interaface between

diff between interface and class
interface cannot contain normal message
interface can alwAYS CONTAIN ABSCRACT MESSAGE
c WITH A IS ABSTRCT CLASS
public class Accounts extends Management implements Management2{
public class Security extends Manageemnt implements Management 2{


what is diff between abstract and interface
anwser
abstract class can have abstract and normal
interface can only have abstract method only

Interface in Selenium
Method of inheritance(
if we need to be change implementation for one class then method overriding
If we need to change implementation for all classes . In this override in all child classes.
we created this class as ABSTRACT class.
over view
we don't write just overview

interface used as this gives same option as parent class
Java says if we want to have finctional that given by parent.
Java gives option to create interface
its similar to having uncle and ant /
this interface lets you make message that can be extended to two child classes
in real life, we can have one patern but multiple uncesl
same way interface can be many

how to create interface
we have to declare message so
public void message 2();
it can let you declare create method..and these are implitely abstract
they are by default abstract
These

Called polyphormesium
One paretn clsscan be represted by more than one childclass

Selenium
how to create a class in eclipse
how to call a method
how to use if/else
howtouse for/loop

S.# Step Selenum Syntex
1. Open the browser    webDriver driver=  new FirefoxDrive();
first req is mozilla fire installed

If we need to negatite to web application then we must write
driver.get("http://www.facebook.com")

after website open
we need to take some action..
various things that we see that we interact
Selenium all these things on website are called webelements
how we will write write or click on boxes.
or how to interact, we need to know concept of locaters.
if you understand locaters, you understand complete selenium
Please practice so things don't skip from mind
coming to 3rd point

take action on web elements
wew ill disccuss concept of locaters
driver.findElement(By.id("email")).sendkeys("abc@gmail.com")
we are giving a command to web element whose id is email
So find Element on webpage, by id, whose Id is email

Send keys emulates  and writes abc@gmail.com

driver.findElement(By.id("email")).sendkeys("abc@gmail.com")
 we can use firebug addon

when id and name both not there,then we use selenenium gives option to
by putting tag.class

Collections
grouping similar things
set of rules to group similar things together is called collections

List-Set-Map
collectionFramework
We will create class called ArrayListDemo
main and enter gets you
public static main void(String[]arays}

when we created calculator, we wrote
public void add (int a, int b)

Array size is fixed
array list-size is dynamic
array list is efficient in retrieving data.
if we have to modify data in future, then linked list better
HashSet does not maintain insertion order
it does not maintain order in same order\
also if any duplicate value, hashset dont display
duplicate values not allowed in hashset

HashMap
its bit different.


Name Phone #
String Int
Key   Value
Left side always Key
right side always Value
Hash Map receives value in Key format
HashMap<String, Integer> td = new HashMap<>();
td.put
























Selenium

Selenium is one of most popular open source automated testing tools available in market.

stable test> stable application
automation testing
process of validating and verifying whether software programme works as expected using autmated tool

Selenium comprises of three components
Latest version of Selenium is 3.0.1
Came in OCT 2016
Earlier was 2.531
Which had IED/RC/Webdriver and GRID

RC is removed

IDE (integrated development environment)
  1. made only for firefox
  2. firefox plugin
  3. records and playback user interaction with browser
  4. use it to create simple scripts or explanatory testing
  5. dont use in end to end projects
  6. addon.mozilla.org to download
  7. windows and mac have same procedure to install
  8. commands used are called Selenese


2) Web driver
prerequisite is java
Actual component due to which its known
No UIE
we have to give commands in java
Core and advanced java and we will use core java

3) Grid

Class-A class is a group of objects that have a common properties.
it is a template or blueprint from which objects are created

object
an entity that has state and behavior is known as an object
eg bmw, pizza, burger etc


Selenium 3
seleniumhq.org
in download section,

whats difference between Assert and VErify in Selenium IDE?
A-Assert does not complete the test execution of script of the test fails
on the other hand, verify always complete the test execution , irrespective
of the fact, that test case is passing or failing.







Unit Testing :Tutorial 4


Unit testing of software applications is done during the development (coding) of an application.
The objective of unit testing is to isolate a section of code and verify its correctness. In procedural programming a unit may be an individual function or procedure
The goal of unit testing is to isolate each part of the program and show that the individual parts are correct. Unit testing is usually performed by the developer.

Why do Unit Testing? Why it is important?

Sometimes software developers attempt to save time by doing minimal unit testing. This is a myth because skimping on unit testing leads to higher defect fixing costs during system testing, integration testing and even beta testing after the application is completed. Proper unit testing done during the development stage saves both time and money in the end.






Building unit Test Cases

Unit testing is commonly automated, but may still be performed manually. The IEEE does not favor one over the other. A manual approach to unit testing may employ a step-by-step instructional document.
Under the automated approach-
  • A developer could write another section of code in the application just to test the function. They would later comment out and finally remove the test code when the application is done.
  • They could also isolate the function to test it more rigorously. This is a more thorough unit testing practice that involves copy and pasting the function to its own testing environment to other than its natural environment. Isolating the code helps in revealing unnecessary dependencies between the code being tested and other units or data spaces in the product. These dependencies can then be eliminated.

A coder may use a Unit Test Framework to develop automated test cases. Using an automation framework, the developer codes criteria into the test to verify the correctness of the unit. During execution of the test cases, the framework logs those that fail any criterion. Many frameworks will also automatically flag and report in a summary these failed test cases. Depending upon the severity of a failure, the framework may halt subsequent testing.






Building unit Test Cases

Unit testing is commonly automated, but may still be performed manually. The IEEE does not favor one over the other. A manual approach to unit testing may employ a step-by-step instructional document.
Under the automated approach-
  • A developer could write another section of code in the application just to test the function. They would later comment out and finally remove the test code when the application is done.
  • They could also isolate the function to test it more rigorously. This is a more thorough unit testing practice that involves copy and pasting the function to its own testing environment to other than its natural environment. Isolating the code helps in revealing unnecessary dependencies between the code being tested and other units or data spaces in the product. These dependencies can then be eliminated.

A coder may use a Unit Test Framework to develop automated test cases. Using an automation framework, the developer codes criteria into the test to verify the correctness of the unit. During execution of the test cases, the framework logs those that fail any criterion. Many frameworks will also automatically flag and report in a summary these failed test cases. Depending upon the severity of a failure, the framework may halt subsequent testing.

 Mock Objects

Unit testing relies on mock objects being created to test sections of code that are not yet part of a complete application. Mock objects fill in for the missing parts of the program. For example, you might have a function that needs variables or objects that are not created yet. In unit testing, those will be accounted for in the form of mock objects created solely for the purpose of the unit testing done on that section of code.

Unit Testing Tools

There are several automated tools available to assist with unit testing. We will provide a few examples below:
  • Rational Software – Rational Software by IBM has a unit test feature known as “Rational Test Realtime”. The software contains a complete range of testing tools for much more than just unit testing. It is used for Ada, Java, C and C++. It creates unit tests by reverse engineering the software.  Operating systems it supports include Windows, Linux, Solaris, HP-UX and AIX. Go to http://www-01.ibm.com/software/rational/ to learn more.
  • JavaScript Assertion Unit– Also known asjsAsserUnit,this Freeware JavaScript unit testing tool can be used on any platform that supports JavaScript. It is available at http://jsassertunit.sourceforge.net/docs/index.html
  • CUT – CUT is a Freeware unit test tool for C, C++ and Objective C. It is great for embedded software testing frameworks and desktop applications on Linux and Windows operating systems. Learn more at sourceforge.net by going to http://sourceforge.net/projects/cut/.
  • Dotunit – Dotunit is a .net framework Freeware unit testing tool. Part of Junit on the Microsoft .net framework, Dotunit is used for automating unit testing on windows systems. This is another tool from sourceforge.net, so look for it at: http://dotunit.sourceforge.net/

Those are just a few of the available unit testing tools. There are lots more, especially for C languages and Java, but you are sure to find a unit testing tool for your programming needs regardless of the language you use.

Extreme Programming & Unit Testing

Unit testing in Extreme Programming involves the extensive use of testing frameworks. A unit test framework is used in order to create automated unit tests. Unit testing frameworks are not unique to extreme programming, but they are essential to it. Below we look at some of what extreme programming brings to the world of unit testing:
  • Tests are written before the code
  • Rely heavily on testing frameworks
  • All classes in the applications are tested
  • Quick and easy integration is made possible

 Unit Testing Myth

It requires time and I am always overscheduled
My code is rock solid! I do not need unit tests.

Myths by their very nature are false assumptions.  These assumptions lead to a viscous cycle as follows –

Truth is
Unit testing increase the speed of development.
Programmers think that integration testing will catch all errors and do not unit test. Once units are integrated, very simple errors which could have very easily found and fixed in unit tested take very long time to be traced and fixed.

Unit Testing benefits

  • Developers looking to learn what functionality is provided by a unit and how to use it can look at the unit tests to gain a basic understanding of the unit API.
  • Unit testing allows the programmer to refactor code at a later date, and make sure the module still works correctly (i.e. Regression testing). The procedure is to write test cases for all functions and methods so that whenever a change causes a fault, it can be quickly identified and fixed.
  • Due to the modular nature of the unit testing, we can tests parts of project without waiting for others to be completed.

Unit Testing Limitations

  • Unit testing can’t be expected to catch every error in a program. It is not possible to evaluate all execution paths even in the most trivial programs
  • Unit testing by its very nature focuses on a unit of code. Hence it can’t catch integration errors or broad system level errors.

Its recommended unit testing be used in conjunction with other testing activities.
  

Unit testing best practices

  • Unit Test cases should be independent. In case of any enhancements or change in requirements, unit test cases should not be affected.
  • Test only one code at a time.
  • Follow clear and consistent naming conventions for your unit tests
  • In case of change in code in any module, ensure there is a corresponding unit test case for the module and the module passes the tests before changing the implementation
  • Bugs identified during unit testing must be fixed before proceeding to the next phase in SDLC
  • Adopt a “test as you code” approach. The more code you write without testing the more paths you have to check for errors.
 Summary
As you can see, there can be a lot involved in unit testing. It can be complex or rather simple depending on the application being tested and the testing strategies, tools and philosophies used. Unit testing is always necessary on some level. That is a certainty.

Enhanced by Zemanta

SDLC , STLC & V-Model: Testing Tutorial

Waterfall Model

This tutorial explains in detail the Software/System Development Life Cycle (SDLC) like the Waterfall cycle & Iterative cycle like RAID & Agile. It then proceeds to explain the V-Model of testing and STLC(Software Test Life Cycle).



  

Video Transcript with Key Takeaways Highlighted:

  • Suppose, you are assigned a task, to develop a custom software for a client.
  • Each block below represents a step required to develop the software.
  • Irrespective of your technical background, try and make an educated guess about the sequence of steps you will follow, to achieve the task
  • The correct sequence would be.
  • Gather as much information as possible about the details & specifications of the desired software from the client. This is nothing but the Requirements gathering stage.
  • Plan the programming language like java , php , .net ; database like oracle , mysql etc which would be suited for the project. also some high level functions & architecture. This is the Design Stage.
  • Actually code the software. This is the Built Stage.
  • Next you ,Test the software to verify that it is built as per the specifications given by the client. This is the TEST stage.
  • Once your software product is ready , you may to do some code changes to accommodate enhancements requested by the client. This would be Maintenance stage.
  • All these levels constitute the waterfall method of software development lifecycle.As you may observe, that testing in the model starts only after implementation is done.
  • But if you are working in large project, where the systems are complex,  its easy to miss out key details in the requirements phase itself. In such cases , an entirely wrong product will be delivered to the client. You will have to start a fresh with the project
  • Or if you manage to note the requirements correctly but make serious mistakes in design and architecture of you software you will have to redesign the entire software to correct the error.
  • Assessments of thousands of projects have shown that defects introduced during requirements & design make up close to half of the total number of defects
  • Also, the costs of fixing a defect increases  across the development life cycleThe earlier in life cycle a defect is detected, the cheaper it is to fix it. As the say, "A stitch in time saves a nine"
  • To address this concern , the V model of testing was developed where for every phase , in the Development life cycle there is a corresponding Testing phase
  • The left side of the model is Software Development Life Cycle - SDLC
  • The right side of the model is Software Test Life Cycle - STLC
  • The entire figure looks like a V , hence the name V - model
  • You a find a few stages different from the waterfall model.
  • These differences , along with the details of each testing phase will be discussed in later tutorial
  • Apart from V model , there are iterative development models , where development is carried in phases , with each phase adding a functionality to the software.
  • Each phase comprises of, its own independent set of development and testing activities.
  • Good examples of Development lifecycles following iterative method are Rapid Application Development, Agile Development
  • Before we close this software testing training a few pointers -
  • You must note that, there are numerous development life cycle models. Development model selected for a project, depends on the aims and goals of that project
  • Testing is not a stand-alone activity and it has to adopt with the development model chosen for the project.
  • In any model, testing should performed at all levels i.e. right from requirements until maintenance.



Enhanced by Zemanta

Fundamental Principles of Software Testing




Video Transcript with Key Takeaways Highlighted:

  • Consider a scenario where you are moving a file from folder A to Folder B.Think of all the possible ways you can test this.
  • Apart from the usual scenarios, you can also test the following conditions
  • Trying to move the file when it is Open
  • You do not have the security rights to paste the file in Folder B
  • Folder B is on a shared drive and storage capacity is full.
  • Folder B already has a file with the same name, infact the list is endless
  • Or suppose you have 15 input fields to test ,each having 5 possible values , the number of combinations to be tested would be 5^15
  • If you were to test the entire possible combinations project EXECUTION TIME & COSTS will rise exponentially.
  • Hence, one of the testing principle states that EXHAUSTIVE testing is not possibleInstead we need optimal amount of testing based on the risk assessment of the application.
  • And the million dollar question is, how do you determine this risk ?
  • To answer this lets do an exercise
  • In your opinion, Which operations is most likely to cause your Operating system to fail?
  • I am sure most of you would have guessed, Opening 10 different application all at the same time.
  • So if you were testing this Operating system you would realize that defects are likely to be found in   multi-tasking and needs to be tested thoroughly which brings us to our next principle Defect Clustering which states that a small number of modules contain most of the defects detected.
  • By experience you can identify such risky modules.But this approach has its own problems
  • If the same tests are repeated over and over again , eventually the same test cases will no longer find new bugs
  • This is the another principle of testing called “Pesticide Paradox”
  • To overcome this, the test cases need to be regularly reviewed & revised , adding new & different test cases to help find more defects.
  • But even after all this sweat & hard work in testing, you can never claim you product is bug free. To drive home this point , lets see this video of public launch of Windows 98
  • You think a company like MICROSOFT would not have tested their OS thoroughly & would risk their reputation just to see their OS crashing during its public launch!
  • Hence, testing principle states that - Testing shows presence of defects i.e. Software Testing reduces the probability of undiscovered defects remaining in the software but even if no defects are found, it is not a proof of correctness.
  • But what if , you work extra hard , taking all precautions & make your software product 99% bug free .And the software does not meet the needs & requirements of the clients.
  • This leads us to our next principle, which states that-
  • Absence of Error is a Fallacy i.e. Finding and fixing defects does not help if the system build is unusable and does not fulfill the users needs & requirements
  • To fix this problem , the next principle of testing states that
  • Early Testing - Testing should start as early as possible in the Software Development Life Cycle. so that any defects in the requirements or design phase are captured as well more on this principle in a later training tutorial.
  • And the last principle of testing states that the Testing is context dependent which basically means that the way you test a e-commerce site will be different from the way you test a commercial off the shelf application

Summary of the Seven Testing Principles

Principle 1
Testing shows presence of defects
Principle 2
Exhaustive testing is impossible
Principle 3
Early Testing
Principle 4
Defect Clustering
Principle 5
Pesticide Paradox
Principle 6
Testing is context dependent
Principle 7
Absence of errors - fallacy




Enhanced by Zemanta

Introduction to Software Testing & its Importance : Tutorial 1




Video Transcript with Key Takeaways Highlighted:
  • Software testing is a process used to identify the correctness, completeness, and quality of developed computer software. It includes a set of activities conducted with the intent of finding errors in software so that it could be corrected before the product is released to the end users.
  • In simple words, software testing is an activity to check whether the actual results match the expected results and to ensure that the software system is defect free.
  • Why is testing is important?
  • This isChinaAirlines Airbus A300 crashing due to a software bug on April 26, 1994 killing 264 innocent lives
  • Software bugs can potentially cause monetary and human loss, history is full of such examples
  • In 1985,Canada's Therac-25 radiation therapy machine malfunctioned due to software bug and delivered lethal radiation doses to patients ,leaving 3 people dead and critically injuring 3 others
  • In April of 1999 ,a software bug caused the failure of a $1.2 billion military satellite launch, the costliest accident in history
  • In may of 1996, a software bug caused the bank accounts of 823 customers of a major U.S. bank to be credited with 920 million US dollars
  • As you see, testing is important because software bugs could be expensive or even dangerous
  • As Paul Elrich puts it - "To err is human, but to really foul things up you need a computer."


Enhanced by Zemanta