SlideShare a Scribd company logo
1 of 10
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

Similar to Oops concepts variables and How to handle variable in testing

Game Development with TouchDevelop
Game Development with TouchDevelopGame Development with TouchDevelop
Game Development with TouchDevelopSage Franch
 
The D language comes to help
The D language comes to helpThe D language comes to help
The D language comes to helpPVS-Studio
 
Basics of Programming - A Review Guide
Basics of Programming - A Review GuideBasics of Programming - A Review Guide
Basics of Programming - A Review GuideBenjamin Kissinger
 
Presentation 2nd
Presentation 2ndPresentation 2nd
Presentation 2ndConnex
 
Bigger Unit Test Are Better
Bigger Unit Test Are BetterBigger Unit Test Are Better
Bigger Unit Test Are BetterPeter Schuler
 
Grails Worst Practices
Grails Worst PracticesGrails Worst Practices
Grails Worst PracticesBurt Beckwith
 
60 terrible tips for a C++ developer
60 terrible tips for a C++ developer60 terrible tips for a C++ developer
60 terrible tips for a C++ developerAndrey Karpov
 
Code Quality Makes Your Job Easier
Code Quality Makes Your Job EasierCode Quality Makes Your Job Easier
Code Quality Makes Your Job EasierTonya Mork
 
powerpoint 1-19.pdf
powerpoint 1-19.pdfpowerpoint 1-19.pdf
powerpoint 1-19.pdfJuanPicasso7
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDavide Mauri
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is ImportaintSana Nasar
 
Java Programming For Android
Java Programming For AndroidJava Programming For Android
Java Programming For AndroidTechiNerd
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java MayaTofik
 
Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRodrigo Urubatan
 
2013 - Andrei Zmievski: Machine learning para datos
2013 - Andrei Zmievski: Machine learning para datos2013 - Andrei Zmievski: Machine learning para datos
2013 - Andrei Zmievski: Machine learning para datosPHP Conference Argentina
 
Python breakdown-workbook
Python breakdown-workbookPython breakdown-workbook
Python breakdown-workbookHARUN PEHLIVAN
 
A sweet taste of clean code and software design
A sweet taste of clean code and software designA sweet taste of clean code and software design
A sweet taste of clean code and software designKfir Bloch
 
classVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptxclassVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptxssusere336f4
 

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

Game Development with TouchDevelop
Game Development with TouchDevelopGame Development with TouchDevelop
Game Development with TouchDevelop
 
BDD Primer
BDD PrimerBDD Primer
BDD Primer
 
The D language comes to help
The D language comes to helpThe D language comes to help
The D language comes to help
 
Basics of Programming - A Review Guide
Basics of Programming - A Review GuideBasics of Programming - A Review Guide
Basics of Programming - A Review Guide
 
Presentation 2nd
Presentation 2ndPresentation 2nd
Presentation 2nd
 
Bigger Unit Test Are Better
Bigger Unit Test Are BetterBigger Unit Test Are Better
Bigger Unit Test Are Better
 
Grails Worst Practices
Grails Worst PracticesGrails Worst Practices
Grails Worst Practices
 
60 terrible tips for a C++ developer
60 terrible tips for a C++ developer60 terrible tips for a C++ developer
60 terrible tips for a C++ developer
 
Code Quality Makes Your Job Easier
Code Quality Makes Your Job EasierCode Quality Makes Your Job Easier
Code Quality Makes Your Job Easier
 
powerpoint 1-19.pdf
powerpoint 1-19.pdfpowerpoint 1-19.pdf
powerpoint 1-19.pdf
 
Dapper: the microORM that will change your life
Dapper: the microORM that will change your lifeDapper: the microORM that will change your life
Dapper: the microORM that will change your life
 
Understanding Why Testing is Importaint
Understanding Why Testing is ImportaintUnderstanding Why Testing is Importaint
Understanding Why Testing is Importaint
 
Java Programming For Android
Java Programming For AndroidJava Programming For Android
Java Programming For Android
 
Modern_2.pptx for java
Modern_2.pptx for java Modern_2.pptx for java
Modern_2.pptx for java
 
Rubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDDRubyconf2016 - Solving communication problems in distributed teams with BDD
Rubyconf2016 - Solving communication problems in distributed teams with BDD
 
Java Fx
Java FxJava Fx
Java Fx
 
2013 - Andrei Zmievski: Machine learning para datos
2013 - Andrei Zmievski: Machine learning para datos2013 - Andrei Zmievski: Machine learning para datos
2013 - Andrei Zmievski: Machine learning para datos
 
Python breakdown-workbook
Python breakdown-workbookPython breakdown-workbook
Python breakdown-workbook
 
A sweet taste of clean code and software design
A sweet taste of clean code and software designA sweet taste of clean code and software design
A sweet taste of clean code and software design
 
classVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptxclassVII_Coding_Teacher_Presentation.pptx
classVII_Coding_Teacher_Presentation.pptx
 

Recently uploaded

Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Celine George
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for BeginnersSabitha Banu
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfMr Bounab Samir
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementmkooblal
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfUjwalaBharambe
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsanshu789521
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxOH TEIK BIN
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptxVS Mahajan Coaching Centre
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 

Recently uploaded (20)

OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...OS-operating systems- ch04 (Threads) ...
OS-operating systems- ch04 (Threads) ...
 
Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17Computed Fields and api Depends in the Odoo 17
Computed Fields and api Depends in the Odoo 17
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
9953330565 Low Rate Call Girls In Rohini Delhi NCR
9953330565 Low Rate Call Girls In Rohini  Delhi NCR9953330565 Low Rate Call Girls In Rohini  Delhi NCR
9953330565 Low Rate Call Girls In Rohini Delhi NCR
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Full Stack Web Development Course for Beginners
Full Stack Web Development Course  for BeginnersFull Stack Web Development Course  for Beginners
Full Stack Web Development Course for Beginners
 
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdfLike-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
Like-prefer-love -hate+verb+ing & silent letters & citizenship text.pdf
 
Hierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of managementHierarchy of management that covers different levels of management
Hierarchy of management that covers different levels of management
 
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdfFraming an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
Framing an Appropriate Research Question 6b9b26d93da94caf993c038d9efcdedb.pdf
 
Presiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha electionsPresiding Officer Training module 2024 lok sabha elections
Presiding Officer Training module 2024 lok sabha elections
 
Solving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptxSolving Puzzles Benefits Everyone (English).pptx
Solving Puzzles Benefits Everyone (English).pptx
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Tilak Nagar Delhi reach out to us at 🔝9953056974🔝
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)ESSENTIAL of (CS/IT/IS) class 06 (database)
ESSENTIAL of (CS/IT/IS) class 06 (database)
 
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions  for the students and aspirants of Chemistry12th.pptxOrganic Name Reactions  for the students and aspirants of Chemistry12th.pptx
Organic Name Reactions for the students and aspirants of Chemistry12th.pptx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 

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

  1. 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.
  2. Lesson descriptions should be brief.
  3. 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.