Automation Using Selenium Webdriver

Sunday 31 July 2016

Java Encapsulation Exampe

Encapsulation:
--------------
Encapsulation means putting together all the variables (instance variables) and the methods into a single unit called Class. It also means hiding data and methods within an Object. Encapsulation provides the security that keeps data and methods safe from inadvertent changes.

encapsulation in java
We can create a fully encapsulated class in java by making all the data members of the class private. Now we can use setter and getter methods to set and get the data in it..


package oopsconcept;
public class Mobile {    
    private String manufacturer;
    private String operating_system;
    public String model;
    private int cost;
    //Constructor to set properties/characteristics of object
    Mobile(String man, String o,String m, int c){
        this.manufacturer = man;
        this.operating_system=o;
        this.model=m;
        this.cost=c;
    }
    //Method to get access Model property of Object
    public String getModel(){
        return this.model;
    }
    // We can add other method to get access to other properties
}

Advantage of Encapsulation in java:
---------    ------------     -----
By providing only setter or getter method, you can make the class read-only or write-only.

It provides you the control over the data. Suppose you want to set the value of id i.e. greater than 100 only, you can write the logic inside the setter method.

Simple example of encapsulation in java:
---------       ----------     ---------
public class Student{
private String name;
 
public String getName(){
return name;
}
public void setName(String name){
this.name=name
}
}

class Test{
public static void main(String[] args){
Student s=new Student();
s.setname("jagan");
System.out.println(s.getName());
}
}
Output:jagan


Manual Testing FAQ

What Is Regression Testing Explain It with Example?
When a bug is fixed by the development team than testing the other features of the applications which might be affected due to the bug fix is known as regression testing.

Regression testing is always done to verify that modified code does not break the existing functionality of the application and works within the requirements of the system.
Regression Testing Example - Real and Practical

Example of regression testing with its process is explained below:

For Example there are three Modules in the Project named Admin Module, Personal Information, and Employment Module and suppose bug occurs in the Admin Module like on Admin Module existing User is not able to login with valid login credentials so this is the bug.

Now Testing team sends the above - mentioned Bug to the Development team to fix it and when development team fixes the Bug and hand over to Testing team than testing team checks that fixed bug does not affect the remaining functionality of the other modules (Admin, PI, Employment) and also the functionality of the same module (Admin) so this is known as the process of regression testing done by Software Testers.

Smoke testing:


Example:

Let us assume that there is an application like ‘Student Details’ which has 5 important components like Login page, Adding student details, Saving the details, Updating it and Deleting it. As a part of smoke testing we will test the login page with valid input. After login we will test the addition, saving, updating and deleting of records. If all the 5 critical components work fine then the build is stable enough to proceed with detailed testing. This is known as Smoke testing.

What is Agile Methodology?

Agile as the name specifies something that to be done faster or quickly. On testing and development point of view Agile is completely a new methodology to speed up your testing and development activity. As the requirements change frequently and we need to complete the testing or development for the change request as quick as possible. In this situation agile methodology comes forward. Agile methodology should be performed from the starting of the project and should carry out till the project go live. Even some times this methodology carry forward for some more time until the project becomes stable. . There are many processes comes under Agile methodology but out of them tow are very important-

Scrum and Sprint.

Scrum Meeting:

Scrum is a kind of short time meeting done every day and we discuss about every day work. Its not like a general meeting but we fully focus on the whole day development and testing work. Also in this meeting we discuss about the daily work and priority modules. We plan for –

Total time duration: In scrum meeting we decide the total time duration for each sprint to test and develop. On daily basis we track the progress of each task assigned.

Identifying the risk: Another plan that we make in scrum meeting is to identify the risks. Risks like which tasks are more complicated or which task could have probability to be failed or which task could have more bugs etc.

Cost: This is another priority that we discuss in Scrum meeting that how much cost will be to develop or test any task. If development time or testing time will be exceeded will affect the expected or allocated cost. So we discuss how to balance time and cost.

Resources: How many resources required to test or develop each task is also an important factor that are discussed in scrum meeting.

There are some other topics as well like potential of the work, backlogs etc. are also a part of discussion that should be happen in scrum meeting.

In Scrum meeting generally we used to have one scrum master who decides how smoothly project development and testing are going on.

agile

Sprint Planning:

Sprint is nothing but its a part of scrum meeting where we decide which module should be developed or tested first. The piece of task is called sprint. In scrum meeting we set our sprint planning. Once sprint planning is done we discuss on daily basis about the progress of particular sprint and sprint backlog in sprint meeting. Backlog is nothing but a list of tasks to be completed and assigned to the individual. The progress of the sprint is discussed in scrum meeting. We analyze how many sprints are developed and how many sprints are still pending. Sprint which takes the long time as expected are divided into small sprints to speed up the work. Work on each sprint is completely based on priority.




Manual Testing FAQ