SlideShare a Scribd company logo
OOPS Concepts : Variable
Presented by
Nilesh Sawardekar
Variable
Forget about programming, let’s consider some scenarios in real
world. When we say “Object”, which things first come to your mind. Well,
sudden question from me may confuse you. Now ask yourself which
objects you have in your home. You may have chairs, sofa, TV, Washing
Machine and lot more.
Let’s take one object from things which you have at home, TV.
Can you tell me which Brand, Color, Model No., Size, Price of your
TV? And also I like to know whether your TV is smart TV?
 Category: LED
 Brand: Samsung
 Color: Black
 Model No.: xyz
 Size: 55 inch
 Smart TV: Yes
 Price: 85,000
So, it means we can categories TV in Brand, Color, Model No., Size, Price, Smart_TV, right?
Let’s take universal example of TV, you can find TV in,
• Brand: Samsung, Sony, Haier, Videocon, LG etc.
• Color: Black, Silver, White, Red etc.
• Model No.: 32LJ522D, 24LH454A, UN32J525DAFXZA etc.
• Size: 26, 32, 42, 44, 55 etc
• Smart_Tv: Yes, No
• Price: 85000, 100000, 25000 etc
Here, we say brand, color, model_no are alphanumeric. Size is numeric, price is
decimal and smart_tv as Boolean.
In programming word alphanumeric, numeric, decimal and Boolean are called as datatype.
Brand, Color, Model No., Size, Price, Smart_TV are Variables.
Alphanumeric values are defined as “string”, numeric as int, decimal, float, money, double in
programming world.
Syntax for variable declaration is,
<data_type> <variable_name>;
We can initialize variables in following way and its value can be change later.
string water_unit = “ltr”; int taksh_age = 3;
If you are tester
• While doing Data Flow Testing, variables take important part.
• Because, It mainly focuses on the points at which values assigned to the
variables and the point at which these values are used by concentrating
on both points, data flow can be tested.
• Data flow testing uses the control flow graph to detect illogical things
that can interrupt the flow of data.
• So you would like to check things which are explained in next slide.
 A variable that is declared but never used within the program.
On most of IDE like Microsoft studio, you may find that few variables are declared but they are in
gray color. When you take your cursor on it, message will pop up with “Variable never used.”
▫ A variable that is used but never declared.
This problem is most of time when we use multiple classes. For few compiler,
ordering of classes do matters.
▫ A variable that is declared multiple times before it is used.
Developers sometimes, declare same variable multiple times. This happen
when code get lengthy. Most of time developers intialise same variable for
multiple times.
▫ Deallocating a variable before it is used.
This can be seen in array. Deallocation sometimes tends memory leak. So you
have handle this very carefully.
▫ Whether variables have given proper name.
Most of the times project moves from one developer to other developer. This can be
the case when junior submit code to senior or developer left the job and other developers handles
it. So giving proper name to variable is very important. E.g., suppose there is variable with name
student_name have to be declared. In this case if suppose developer XYZ, declare it as using his or
her speaking language as vidyarthi_nav , and if this project is handed over to other developer ABC
then that time ABC may not understand what is vidyarthi_nav . So, giving proper name to variable is
more important.
▫ Whether variables have given proper data types.
It’s very important to use proper data type for variables. Common mistakes are done
when int values are declared as float or double. String is but char data type is enough.
Thank You
• To learn,
▫ *Android*iOS*C#, C, C++*Asp .net MVC*SQL*PHP*Java*Advance
Java*Javascript*Jquery*WCF*WPF*Angular JS*Python*React native
▫ Digital marketing and SEO on live projects.
▫ Microsoft CRM 365.
You can contact me by call or What’s App on +91 9819991929
www.codewithnilesh.com

More Related Content

PPTX
Coding standards
PDF
Exception handling in Ruby
PDF
11 ml system design
PDF
Diffing Shotgun Surgery and Divergent Change smells in the two editions of Re...
PPT
codingtechniques1.ppt
PDF
Control structure repetition Tito Lacbayen
PPSX
Data types, Variables, Expressions & Arithmetic Operators in java
PPTX
Handling Data in Algorithm
Coding standards
Exception handling in Ruby
11 ml system design
Diffing Shotgun Surgery and Divergent Change smells in the two editions of Re...
codingtechniques1.ppt
Control structure repetition Tito Lacbayen
Data types, Variables, Expressions & Arithmetic Operators in java
Handling Data in Algorithm

Similar to Oops concepts variables and How to handle variable in testing (20)

PPTX
PLF-Lesson tsu lecture time 2 units-2.pptx
PPTX
Intro to programing with java-lecture 3
DOCX
C programming perso notes
PPTX
Variables and Operators.pptxStores data for a calculated value in your progra...
PDF
CSC111-Chap_02.pdf
PDF
PPTX
Object oriented programming1 Week 1.pptx
PDF
Lecture02 java
PPT
presentation of java fundamental
DOCX
PPT
Basic of java 2
PPTX
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
PPTX
High quality program element that are founf in programming logic and design
PPTX
c++ computer programming language datatypes ,operators,Lecture 03 04
PPTX
2 Program Design Methodology
PDF
java-basics-1.pdf jfjf hjghjgkj df jfjf hjghjgkj df jfjf hjghjgkj df jfjf hjg...
DOCX
Notes 07 - Primitive Variables.docx
PPT
02. Data Type and Variables
PDF
Programming in Java: Storing Data
PDF
Lesson 4 - Data and Variables.pdf
PLF-Lesson tsu lecture time 2 units-2.pptx
Intro to programing with java-lecture 3
C programming perso notes
Variables and Operators.pptxStores data for a calculated value in your progra...
CSC111-Chap_02.pdf
Object oriented programming1 Week 1.pptx
Lecture02 java
presentation of java fundamental
Basic of java 2
Farrell_Programming Logic and Design slides_10e_ch02_PowerPoint.pptx
High quality program element that are founf in programming logic and design
c++ computer programming language datatypes ,operators,Lecture 03 04
2 Program Design Methodology
java-basics-1.pdf jfjf hjghjgkj df jfjf hjghjgkj df jfjf hjghjgkj df jfjf hjg...
Notes 07 - Primitive Variables.docx
02. Data Type and Variables
Programming in Java: Storing Data
Lesson 4 - Data and Variables.pdf
Ad

Recently uploaded (20)

PPTX
GDM (1) (1).pptx small presentation for students
PPTX
Cell Types and Its function , kingdom of life
PDF
STATICS OF THE RIGID BODIES Hibbelers.pdf
PDF
2.FourierTransform-ShortQuestionswithAnswers.pdf
PDF
Abdominal Access Techniques with Prof. Dr. R K Mishra
PDF
O7-L3 Supply Chain Operations - ICLT Program
PPTX
human mycosis Human fungal infections are called human mycosis..pptx
PPTX
Final Presentation General Medicine 03-08-2024.pptx
PDF
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
PDF
RMMM.pdf make it easy to upload and study
PDF
O5-L3 Freight Transport Ops (International) V1.pdf
PDF
Anesthesia in Laparoscopic Surgery in India
PPTX
Presentation on HIE in infants and its manifestations
PDF
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
PDF
Module 4: Burden of Disease Tutorial Slides S2 2025
PDF
Chinmaya Tiranga quiz Grand Finale.pdf
PDF
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
PPTX
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
PDF
Classroom Observation Tools for Teachers
PDF
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
GDM (1) (1).pptx small presentation for students
Cell Types and Its function , kingdom of life
STATICS OF THE RIGID BODIES Hibbelers.pdf
2.FourierTransform-ShortQuestionswithAnswers.pdf
Abdominal Access Techniques with Prof. Dr. R K Mishra
O7-L3 Supply Chain Operations - ICLT Program
human mycosis Human fungal infections are called human mycosis..pptx
Final Presentation General Medicine 03-08-2024.pptx
grade 11-chemistry_fetena_net_5883.pdf teacher guide for all student
RMMM.pdf make it easy to upload and study
O5-L3 Freight Transport Ops (International) V1.pdf
Anesthesia in Laparoscopic Surgery in India
Presentation on HIE in infants and its manifestations
The Lost Whites of Pakistan by Jahanzaib Mughal.pdf
Module 4: Burden of Disease Tutorial Slides S2 2025
Chinmaya Tiranga quiz Grand Finale.pdf
ANTIBIOTICS.pptx.pdf………………… xxxxxxxxxxxxx
Tissue processing ( HISTOPATHOLOGICAL TECHNIQUE
Classroom Observation Tools for Teachers
Chapter 2 Heredity, Prenatal Development, and Birth.pdf
Ad

Oops concepts variables and How to handle variable in testing

  • 1. OOPS Concepts : Variable Presented by Nilesh Sawardekar
  • 2. Variable Forget about programming, let’s consider some scenarios in real world. When we say “Object”, which things first come to your mind. Well, sudden question from me may confuse you. Now ask yourself which objects you have in your home. You may have chairs, sofa, TV, Washing Machine and lot more. Let’s take one object from things which you have at home, TV.
  • 3. Can you tell me which Brand, Color, Model No., Size, Price of your TV? And also I like to know whether your TV is smart TV?  Category: LED  Brand: Samsung  Color: Black  Model No.: xyz  Size: 55 inch  Smart TV: Yes  Price: 85,000 So, it means we can categories TV in Brand, Color, Model No., Size, Price, Smart_TV, right?
  • 4. Let’s take universal example of TV, you can find TV in, • Brand: Samsung, Sony, Haier, Videocon, LG etc. • Color: Black, Silver, White, Red etc. • Model No.: 32LJ522D, 24LH454A, UN32J525DAFXZA etc. • Size: 26, 32, 42, 44, 55 etc • Smart_Tv: Yes, No • Price: 85000, 100000, 25000 etc Here, we say brand, color, model_no are alphanumeric. Size is numeric, price is decimal and smart_tv as Boolean.
  • 5. In programming word alphanumeric, numeric, decimal and Boolean are called as datatype. Brand, Color, Model No., Size, Price, Smart_TV are Variables. Alphanumeric values are defined as “string”, numeric as int, decimal, float, money, double in programming world. Syntax for variable declaration is, <data_type> <variable_name>; We can initialize variables in following way and its value can be change later. string water_unit = “ltr”; int taksh_age = 3;
  • 6. If you are tester • While doing Data Flow Testing, variables take important part. • Because, It mainly focuses on the points at which values assigned to the variables and the point at which these values are used by concentrating on both points, data flow can be tested. • Data flow testing uses the control flow graph to detect illogical things that can interrupt the flow of data. • So you would like to check things which are explained in next slide.
  • 7.  A variable that is declared but never used within the program. On most of IDE like Microsoft studio, you may find that few variables are declared but they are in gray color. When you take your cursor on it, message will pop up with “Variable never used.”
  • 8. ▫ A variable that is used but never declared. This problem is most of time when we use multiple classes. For few compiler, ordering of classes do matters. ▫ A variable that is declared multiple times before it is used. Developers sometimes, declare same variable multiple times. This happen when code get lengthy. Most of time developers intialise same variable for multiple times. ▫ Deallocating a variable before it is used. This can be seen in array. Deallocation sometimes tends memory leak. So you have handle this very carefully.
  • 9. ▫ Whether variables have given proper name. Most of the times project moves from one developer to other developer. This can be the case when junior submit code to senior or developer left the job and other developers handles it. So giving proper name to variable is very important. E.g., suppose there is variable with name student_name have to be declared. In this case if suppose developer XYZ, declare it as using his or her speaking language as vidyarthi_nav , and if this project is handed over to other developer ABC then that time ABC may not understand what is vidyarthi_nav . So, giving proper name to variable is more important. ▫ Whether variables have given proper data types. It’s very important to use proper data type for variables. Common mistakes are done when int values are declared as float or double. String is but char data type is enough.
  • 10. Thank You • To learn, ▫ *Android*iOS*C#, C, C++*Asp .net MVC*SQL*PHP*Java*Advance Java*Javascript*Jquery*WCF*WPF*Angular JS*Python*React native ▫ Digital marketing and SEO on live projects. ▫ Microsoft CRM 365. You can contact me by call or What’s App on +91 9819991929 www.codewithnilesh.com

Editor's Notes

  • #3: How presentation will benefit audience: Adult learners are more interested in a subject if they know how or why it is important to them. Presenter’s level of expertise in the subject: Briefly state your credentials in this area, or explain why participants should listen to you.
  • #4: Lesson descriptions should be brief.
  • #5: Example objectives At the end of this lesson, you will be able to: Save files to the team Web server. Move files to different locations on the team Web server. Share files on the team Web server.