Wednesday, December 26, 2018

Introduction to C++

I am writing this article to share some information about C, C++ languages. You might read my last article which was about the History of C++. So here I’ll not explain about the history. Please go to the previous article in case you missed that one.
Comparison between C and C++
  • C++ is a superset of C i.e all features of C (if else, loop, functions, Arrays, Strings ) can be used in C++.
  • C++ programs can use existing C software libraries.
  • C follows top down approach programming(i.e first we will create main () and decide the flow of the program and then we create detailed programs/functions)
  • While C++ follows bottom up programming approach(first we create detailed functionality and in last we’ll create main by assembling all these detailed functionalities)
  • C adopts procedure-oriented programming
  • C++ adopts object-oriented programming
What is object-oriented programming
OOPs is a programming approach which revolves around the below concepts:
  • Object(set of data & methods which can act on that data)
  • Class
  • Encapsulation— an act of combining properties and methods related to the same object
  • Data hiding
  • Abstraction
  • Polymorphism
  • Inheritance
Classes & Objects:
  • The class is a blueprint of an object
  • The class is a description of the object’s property set and a set of operations
  • Creating a class is as good as defining a new data type
  • Class is a means to achieve encapsulation
  • An object is a runtime entity(Class don’t get memory, object are allocated memory)
  • An object is an instance of a class
Example :
class box
{
int l,b,h;
void setDimension(int x, int y , int z){ }
Void showDimension(){  }
};
box b1;
Here box is a class(datatype) & b1 is a object. How much memory will be allocated to b1 will depend on how we have defined box.
Why Do We Need Object-Oriented Programming?
Procedural Languages
C, Pascal, FORTRAN, and similar languages are procedural languages. That is, each statement in the language tells the computer to do something: Get some input, add these numbers, divide by six, display that output.
Division into Functions
When programs become larger, a single list of instructions becomes unwieldy. Few programmers can comprehend a program of more than a few hundred statements unless it is broken down into smaller units. For this reason the function was adopted as a way to make programs more comprehensible to their human creators. (The term function is used in C++ and C. In other languages the same concept may be referred to as a subroutine, a subprogram, or a procedure.) A procedural program is divided into functions,
The Object-Oriented Approach
The fundamental idea behind object-oriented languages is to combine into a single unit both data and the functions that operate on that data. Such a unit is called an object.
An object’s functions, called member functions in C++, typically provide the only way to access its data. If you want to read a data item in an object, you call a member function in the object. It will access the data and return the value to you. You can’t access the data directly. The data is hidden, so it is safe from accidental alteration. Data and its functions are said to be encapsulated into a single entity. Data encapsulation and data hiding are key terms in the description of object-oriented languages. If you want to modify the data in an object, you know exactly what functions interact with it: the member functions in the object. No other functions can access the data. This simplifies writing, debugging, and maintaining the program. A C++ program typically consists of a number of objects, which communicate with each other by calling one another’s member functions. What are called member functions in C++ are called methods in some other object-oriented (OO) languages (such as Smalltalk, one of the first OO languages). Also, data items are referred to as attributes or instance variables. Calling an object’s member function is referred to as sending a message to the object.
Characteristics of Object-Oriented Languages
  • Encapsulation: Act of combining properties and methods related to an object
  • Data hiding
  • Abstraction
  • Polymorphism
  • Inheritance
TERMS:
Objects
When you approach a programming problem in an object-oriented language, you no longer ask how the problem will be divided into functions, but how it will be divided into objects.
Classes
In OOP we say that objects are members of classes.
Analogy: Almost all computer languages have built-in data types. For instance, a data type int, meaning integer, is predefined in C++. You can declare as many variables of type int as you need in your program:
int day;
int count;
int divisor;
int answer;
In a similar way, you can define many objects of the same class. A class serves as a plan, or blueprint. It specifies what data and what functions will be included in objects of that class. Defining the class doesn’t create any objects, just as the mere existence of data type int doesn’t create any variables.
A class is thus a description of a number of similar objects. This fits our non-technical understanding of the word class. Prince, Sting, and Madonna are members of the rock musician class. There is no one person called “rock musician,” but specific people with specific names are members of this class if they possess certain characteristics. An object is often called an “instance” of a class.
Inheritance
Classes divided into subclasses. Suppose the animal class is divided into mammals, amphibians, insects, birds, and so on. The vehicle class is divided into cars, trucks, buses, motorcycles, and so on.
The principle in this sort of division is that each subclass shares common characteristics with the class from which it’s derived. Cars, trucks, buses, and motorcycles all have wheels and a motor; these are the defining characteristics of vehicles. In addition to the characteristics shared with other members of the class, each subclass also has its own particular characteristics: Buses, for instance, have seats for many people, while trucks have space for hauling heavy loads.
inheritance

An OOP class can become a parent of several subclasses. In C++ the original class is called the base class; other classes can be defined that share its characteristics, but add their own as well. These are called derived classes. Don’t confuse the relation of objects to classes, on the one hand, with the relation of a base class to derived classes, on the other. Objects, which exist in the computer’s memory, each embody the exact characteristics of their class, which serves as a template. Derived classes inherit some characteristics from their base class, but add new ones of their own.
Reusability
Once a class has been written, created, and debugged, it can be distributed to other programmers for use in their own programs. This is called reusability. It is similar to the way a library of functions in a procedural language can be incorporated into different programs. However, in OOP, the concept of inheritance provides an important extension to the idea of reusability. A programmer can take an existing class and, without modifying it, add additional features and capabilities to it. This is done by deriving a new class from the existing one. The new class will inherit the capabilities of the old one, but is free to add new features of its own.
Creating New Data Types
One of the benefits of objects is that they give the programmer a convenient way to construct new data types. Suppose you work with two-dimensional positions (such as x and y coordinates, or latitude and longitude) in your program. You would like to express operations on these positional values with normal arithmetic operations, such as
position1 = position2 + origin
where the variables position1, position2, and origin each represent a pair of independent numerical quantities. By creating a class that incorporates these two values, and declaring position1, position2, and origin to be objects of this class, we can, in effect, create a new data type.
Polymorphism and Overloading
The = (equal) and + (plus) operators, used in the position arithmetic shown above, don’t act the same way they do in operations on built-in types such as int. The objects position1 and so on are not predefined in C++ but are programmer-defined objects of class Position. How do the = and + operators know how to operate on objects? The answer is that we can define new behaviors for these operators. These operations will be member functions of the Position class. Using operators or functions in different ways, depending on what they are operating on, is called polymorphism (one thing with several distinct forms). When an existing operator, such as + or =, is given the capability to operate on a new data type, it is said to be overloaded. Overloading is a kind of polymorphism; it is also an important feature of OOP.
C++ and C
C++ is derived from the C language. Strictly speaking, it is a superset of C: Almost every correct statement in C is also a correct statement in C++, although the reverse is not true. The most important elements added to C to create C++ concern classes, objects, and object-oriented programming. (C++ was originally called “C with classes.”) However, C++ has many other new features as well, including an improved approach to input/output (I/O) and a new way to write comments.
Reference – I get the above informative content from a trainer of RedBush Technologies. It is the best training institute, provide C++ training in Gurgaon along with many other programming languages. You may contact for Selenium too, as it is the best selenium training institute in Gurgaon.

Tuesday, December 25, 2018

History of C++

Till now, I write about the selenium i.e. selenium training program. It is about RedBush Technologies. It is the best selenium training institute in Gurgaon. Today, I am writing about C++. The history of C++ is as below.
C++ was developed by Bjarne Stroustrup. In 1978 he started creating C++ and in 1979 he launches the first version of C++. Initially, there were some enhancements in C language & it was known as C with classes.


C was developed by Dennis Ritchie & in 1983 it was given a name as C++.
  • C++ is not the first object-oriented programming language. C++’s oops aspect is inspired by a computer simulation language called Simula67 (Simula67 is the world’s first object-oriented programming language).
  • Java is written in C++.
  • Major operating systems of modern times are written in C++
  • C++ is the world’s 4th most used programming language

I'll share some more C++ content soon.

Wednesday, December 19, 2018

10 Reasons Why You Should Learn Selenium

On the off chance that you’re perusing this blog, the odds are that you either need to kick-begin your profession in the IT field or you need to develop from being a manual tester to turning into an automation tester. In any case, you are at the correct place since YOU have to learn Selenium.
You may likewise need to know, how to begin a profession in testing, and if Selenium is the correct track to begin. In the event that such inquiries hold on, don’t stress on the grounds that, in this blog, I will give you 10 persuading reasons why you ought to learn Selenium.


Top 10 motivations to learn Selenium are:
  1. Open source
  2. No OS/ browser demands
  3. Multi-Language Support
  4. Availability of Frameworks
  5. Strong presence in the DevOps lifecycle
  6. Easy integration
  7. Parallel & distributed testing
  8. No dependency on GUI based systems
  9. Flexibility while designing test cases
  10. Demand for Selenium testers
I’ll explain these points in my next post.
If you are looking for Selenium Training (Automation Training), you may opt to RedBush Technologies. It is the best selenium training institute in Gurgaon.

Thursday, December 13, 2018

Don’t Automate Every Test

100% Test Coverage is beyond the realm of imagination since there can be a huge number of mixes. We generally execute a subset of possible tests. A similar rule applies to automated testing.
To make an automated script, it requires time and exertion, and going for “automating Each Test”, we require a lot of resource and time, which in many cases is beyond the realm of imagination.
Rather, utilize a Risk-based way to deal with figure out which tests should be automated. To get the most incentive out of automation, just automate the most important business cases and scenarios.
Likewise, a high number of automated tests adds maintenance cost and hard to maintain.
Another note to keep remember is that not all tests can be automated. A few tests are extremely unpredictable in nature and require numerous downstream system checking and can be conflicting. In these cases, it is best to leave these checks for manual testing.
Follow my blog for more such posts. In case, you are looking for selenium training, you can opt RedBush Technologies.

Wednesday, December 5, 2018

Software Testing Need

Software testing is the place everything comes down to. The present universe of innovation is totally commanded by machines, and their behavior is controlled by the software driving it. Will the machines act precisely as we need them to? Every-time? All over the place? The response to these inquiries lies in software testing.



Toward the day’s end, it is the software application’s prosperity rate which will control your business development. A similar thing can be said for web applications in light of the fact that most organizations today are totally dependent on the web.
Take, for instance, any internet business organization. Be it Amazon or E-Bay or Flipkart, they depend on the client movement on their sites and activity on their mobile applications for business.
Envision, if something calamitous happens like the costs of various items being topped off at 10$, all as a result of a little bug in a “not all that effectively comprehensible” some portion of the code. At that point what should be possible, and how might we avoid it in the future?
By testing the code before deployment right? So, that is the requirement for software testing.
Here I’ll like to introduce you with Selenium testing tool. It is the best automation testing tool available in open source testing tools. You may ask, what is Selenium? To get the answer you can visit this blog. It has many articles about selenium.
Before I go any further, let me clear out that, Software testing is of two sorts: Manual Testing and Automation Testing. Selenium was established as an automation testing tool to overcome the disadvantages/restrictions of Manual testing. Along these lines, in the following area of this what is selenium blog, how about we comprehend the difficulties with manual testing.
To know more about software testing or selenium automation tool, please visit RedBus. It is the best selenium training institute in Gurgaon.

Introduction to C Language

C is a procedural programming language. It was at first created by Dennis Ritchie somewhere in the range of 1969 and 1973. It was essentia...