SlideShare a Scribd company logo
1 of 13
Software
Construction
(Software Testing)
Learning Goals for Today
• Develop a test suite for some code after looking at it. (White-box
testing.)
• What are your initial questions? (Have you written some already?)
• Should I analyse the specification carefully, as in black-box testing, to
discover “what the code should be doing”?
• Does white-box testing have an advantage, over black-box testing, in
testing “what the program is not intended to do”?
• Should I carefully test interfaces, exceptions, or error returns, or should
I concentrate on confirming the correctness of functional “internal”
behaviour?
• Start to develop your own “principled approach” to software
testing.
D3
2
White-Box Testing
• “This strategy derives test data from an examination of the
program’s logic
• “(and often, unfortunately, at the neglect of the
specification).”
• What is the overall strategy or “gold standard” for white-box
testing?
• “Causing every statement in the program to execute at least
once”?
• No… this is “highly inadequate”.
D3
3
Test phases
• Acceptance Testing – this checks if the overall system is
functioning as required.
• Unit testing – this is basically testing of a single function,
procedure, class.
• Integration testing – this checks that units tested in isolation
work properly when put togheter.
• System testing – here the emphasis is to ensure that the whole
system can cope with real data, monitor system performance,
test the system’s error handling and recovery routines.
• Regression Testing – this checks that the system preserves its
functionality after maintenance and/or evolution tasks.
4
Unit Testing
• Unit Tests are tests written by the developers to test
functionality as they write it.
• Each unit test typically tests only a single class, or a small cluster
of classes.
• Unit tests are typically written using a unit testing framework,
such as JUnit (automatic unit tests).
• Target errors not found by Unit testing:
- Requirements are mis-interpreted by developer.
- Modules don’t integrate with each other
5
6
Testing based on the coverage of the executed program (source)
code.
Different coverage criteria:
• statement coverage
• path coverage
• condition coverage
• definition-use coverage
• …..
It is often the case that it is not possible to cover all code. For instance:
- for the presence of dead code (not executable code)
- for the presence of not feasible path in the CFG
- etc.
Unit testing: a white-box approach
projec
AcceptanceTesting
• Acceptance Tests are specified by the customer and analyst to
test that the overall system is functioning as required (Do
developers build the right system?).
• Acceptance tests typically test the entire system, or some large
chunk of it.
• When all the acceptance tests pass for a given user story (or use
case, or textual requirement), that story is considered complete.
• At the very least, an acceptance test could consist of a script of
user interface actions and expected results that a human can run.
• Ideally acceptance tests should be automated, either using the
unit testing framework (Junit), or a separate acceptance testing
framework (Fitnesse).
7
AcceptanceTesting
• Used to judge if the product is acceptable to the customer
• Coarse grained tests of business operations
• Scenario/Story-based (contain expectations)
• Simple:
• Happy paths (confirmatory)
• Sad paths
• Alternative paths (deviance)
8
9
1.describe the system using a Use-Cases Diagram
* a use-case of that diagram represents a functionality
implemented by the system
2.detail each use-case with a textual description of, e.g., its pre-
post conditions and flow of events
* events are related to: (i) the interactions between system
and user; and (ii) the expected actions of the system
* a flow of events is composed of basic and alternate flows
3.define all instances of each use-case (scenarios) executing the
system for realizing the functionality
4.define, at least, one test case for each scenario
5.(opt) define additional test cases to test the interaction between
use-cases.
Acceptance testing: a black-box approach
projec
10
Different approaches can be used:
- Random values:
- for each input parameter we randomly select the values
- Tester Experience:
- for each input we use our experience to select relevant values to test
- Domain knowledge:
- we use requirements information or domain knowledge information to
identify relevant values for inputs
How to select input values? (1)
projec
11
- Combinatorial testing:
- test all possible combination of the inputs is often impossible
e.g., method(a:int,b:int,c:int) .. how many
combinations?
with 10 values per input: 10
3
=1000
with 100 values per input: 1003
=1000000
- selection of relevant combinations is important
- Pairwise testing (aka 2-way): cover all combinations for
each pair of inputs
<a,b> <a,c> <b,c> = 10
2
+ 10
2
+10
2
=300
don’t care about the value of the third input
How to select input values? (3)
projec
IterativeSoftwaredevelopment
12
+ system
increment
Prioritized
functionalities
Write
acceptanc
e tests
Execute
acceptanc
e tests
Write
and
execute
unit
tests
“At different points in the process”
“Executed after the development”
“Written before”
Acceptancevs Unit Testing
13
The motivation of unit testing is finding faults.
The motivation of acceptance testing is demonstrating
working functionalities.
Written and executed during the development.
Written before the development and executed after.
Written using a unit testing framework.
Written using an acceptance testing framework (also unit
testing framework).
Starting point: new capability (to add a new
module/function or class/method).
Starting point: User stories, User needs, Use Cases, Textual
Requirements, …
Used to find faults in individual modules or units
(individual programs, functions, procedures, web
pages, menus, classes, …) of source code. Used for
documentation (low level)
Used to verify that the implementation is complete and
correct. Used for Integration, System, and regression
testing. Used to indicate the progress in the development
phase. (Usually as %). Used as a contract. Used for
documentation (high level)
(extreme programming) When unit tests pass, write
another test that fails.
(extreme programming) When acceptance tests pass, stop
coding. The job is done.
Written by developers.
Written by Customer and Analyst.
Unit Tests
Acceptance Tests
In theory:

More Related Content

Similar to Lecture (Software Testing).pptx

lec-11 Testing.ppt
lec-11 Testing.pptlec-11 Testing.ppt
lec-11 Testing.pptdebjani12
 
Software testing introduction
Software testing introductionSoftware testing introduction
Software testing introductionSriman Eshwar
 
Introduction to software testing
Introduction to software testingIntroduction to software testing
Introduction to software testingASIT Education
 
Class9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdfClass9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdfFarjanaParvin5
 
Software testing
Software testingSoftware testing
Software testingBala Ganesh
 
Introduzione allo Unit Testing
Introduzione allo Unit TestingIntroduzione allo Unit Testing
Introduzione allo Unit TestingStefano Ottaviani
 
Software testing part
Software testing partSoftware testing part
Software testing partPreeti Mishra
 
Chapter 3 SOFTWARE TESTING PROCESS
Chapter 3 SOFTWARE TESTING PROCESSChapter 3 SOFTWARE TESTING PROCESS
Chapter 3 SOFTWARE TESTING PROCESSst. michael
 
Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Taymoor Nazmy
 
softwaretesting-140721025833-phpapp02.pptx
softwaretesting-140721025833-phpapp02.pptxsoftwaretesting-140721025833-phpapp02.pptx
softwaretesting-140721025833-phpapp02.pptxSHAMSHADHUSAIN9
 
Software testing & its technology
Software testing & its technologySoftware testing & its technology
Software testing & its technologyHasam Panezai
 
Software engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designSoftware engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designMaitree Patel
 
Object Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesObject Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesPunjab University
 
Software Testing
Software TestingSoftware Testing
Software TestingAdroitLogic
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsQuontra Solutions
 
UNIT DEVELOPMENT AND TESTING IN AUTOMOTIVE AREA
UNIT DEVELOPMENT AND TESTING IN AUTOMOTIVE AREAUNIT DEVELOPMENT AND TESTING IN AUTOMOTIVE AREA
UNIT DEVELOPMENT AND TESTING IN AUTOMOTIVE AREAMarius Crisan
 

Similar to Lecture (Software Testing).pptx (20)

lec-11 Testing.ppt
lec-11 Testing.pptlec-11 Testing.ppt
lec-11 Testing.ppt
 
Software testing introduction
Software testing introductionSoftware testing introduction
Software testing introduction
 
Introduction to software testing
Introduction to software testingIntroduction to software testing
Introduction to software testing
 
Class9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdfClass9_SW_Testing_Strategies.pdf
Class9_SW_Testing_Strategies.pdf
 
Software testing
Software testingSoftware testing
Software testing
 
Black & White Box testing
Black & White Box testingBlack & White Box testing
Black & White Box testing
 
software testing
software testingsoftware testing
software testing
 
Introduzione allo Unit Testing
Introduzione allo Unit TestingIntroduzione allo Unit Testing
Introduzione allo Unit Testing
 
Different Types Of Testing
Different Types Of TestingDifferent Types Of Testing
Different Types Of Testing
 
Software testing part
Software testing partSoftware testing part
Software testing part
 
Slides chapters 13-14
Slides chapters 13-14Slides chapters 13-14
Slides chapters 13-14
 
Chapter 3 SOFTWARE TESTING PROCESS
Chapter 3 SOFTWARE TESTING PROCESSChapter 3 SOFTWARE TESTING PROCESS
Chapter 3 SOFTWARE TESTING PROCESS
 
Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--Software Engineering Lec 10 -software testing--
Software Engineering Lec 10 -software testing--
 
softwaretesting-140721025833-phpapp02.pptx
softwaretesting-140721025833-phpapp02.pptxsoftwaretesting-140721025833-phpapp02.pptx
softwaretesting-140721025833-phpapp02.pptx
 
Software testing & its technology
Software testing & its technologySoftware testing & its technology
Software testing & its technology
 
Software engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit designSoftware engineering Testing technique,test case,test suit design
Software engineering Testing technique,test case,test suit design
 
Object Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slidesObject Oriented Testing(OOT) presentation slides
Object Oriented Testing(OOT) presentation slides
 
Software Testing
Software TestingSoftware Testing
Software Testing
 
Automated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra SolutionsAutomated Software Testing Framework Training by Quontra Solutions
Automated Software Testing Framework Training by Quontra Solutions
 
UNIT DEVELOPMENT AND TESTING IN AUTOMOTIVE AREA
UNIT DEVELOPMENT AND TESTING IN AUTOMOTIVE AREAUNIT DEVELOPMENT AND TESTING IN AUTOMOTIVE AREA
UNIT DEVELOPMENT AND TESTING IN AUTOMOTIVE AREA
 

More from skknowledge

Lecture 13 DNS_DHCP.pptx
Lecture 13 DNS_DHCP.pptxLecture 13 DNS_DHCP.pptx
Lecture 13 DNS_DHCP.pptxskknowledge
 
CN-OSI-TCP-Models-001.pdf
CN-OSI-TCP-Models-001.pdfCN-OSI-TCP-Models-001.pdf
CN-OSI-TCP-Models-001.pdfskknowledge
 
Simulation-Language.pptx
Simulation-Language.pptxSimulation-Language.pptx
Simulation-Language.pptxskknowledge
 
University-of-Okara (2nd Tentative Merit List).pdf
University-of-Okara (2nd Tentative Merit List).pdfUniversity-of-Okara (2nd Tentative Merit List).pdf
University-of-Okara (2nd Tentative Merit List).pdfskknowledge
 
Tentative finalterm spring 2023 datesheet.pdf
Tentative finalterm spring 2023 datesheet.pdfTentative finalterm spring 2023 datesheet.pdf
Tentative finalterm spring 2023 datesheet.pdfskknowledge
 
module2-choosingatopic-131220102444-phpapp02 (1).pdf
module2-choosingatopic-131220102444-phpapp02 (1).pdfmodule2-choosingatopic-131220102444-phpapp02 (1).pdf
module2-choosingatopic-131220102444-phpapp02 (1).pdfskknowledge
 
Lec # 13 Firewall.pptx
Lec # 13 Firewall.pptxLec # 13 Firewall.pptx
Lec # 13 Firewall.pptxskknowledge
 
Lec # 7 Symmetric and asymmetric cryptography.pptx
Lec # 7 Symmetric and asymmetric cryptography.pptxLec # 7 Symmetric and asymmetric cryptography.pptx
Lec # 7 Symmetric and asymmetric cryptography.pptxskknowledge
 
aquacultureppt-180518113938 (2).docx
aquacultureppt-180518113938 (2).docxaquacultureppt-180518113938 (2).docx
aquacultureppt-180518113938 (2).docxskknowledge
 
culturedpearls-190715204035.pdf
culturedpearls-190715204035.pdfculturedpearls-190715204035.pdf
culturedpearls-190715204035.pdfskknowledge
 
Lecture (User Interface Design).ppt
Lecture (User Interface Design).pptLecture (User Interface Design).ppt
Lecture (User Interface Design).pptskknowledge
 
lecture (USABILITY and USER INTERFACE DESIGN).ppt
lecture (USABILITY and USER INTERFACE DESIGN).pptlecture (USABILITY and USER INTERFACE DESIGN).ppt
lecture (USABILITY and USER INTERFACE DESIGN).pptskknowledge
 

More from skknowledge (13)

Lecture 13 DNS_DHCP.pptx
Lecture 13 DNS_DHCP.pptxLecture 13 DNS_DHCP.pptx
Lecture 13 DNS_DHCP.pptx
 
CN-OSI-TCP-Models-001.pdf
CN-OSI-TCP-Models-001.pdfCN-OSI-TCP-Models-001.pdf
CN-OSI-TCP-Models-001.pdf
 
Simulation-Language.pptx
Simulation-Language.pptxSimulation-Language.pptx
Simulation-Language.pptx
 
University-of-Okara (2nd Tentative Merit List).pdf
University-of-Okara (2nd Tentative Merit List).pdfUniversity-of-Okara (2nd Tentative Merit List).pdf
University-of-Okara (2nd Tentative Merit List).pdf
 
Chapter 1.ppt
Chapter 1.pptChapter 1.ppt
Chapter 1.ppt
 
Tentative finalterm spring 2023 datesheet.pdf
Tentative finalterm spring 2023 datesheet.pdfTentative finalterm spring 2023 datesheet.pdf
Tentative finalterm spring 2023 datesheet.pdf
 
module2-choosingatopic-131220102444-phpapp02 (1).pdf
module2-choosingatopic-131220102444-phpapp02 (1).pdfmodule2-choosingatopic-131220102444-phpapp02 (1).pdf
module2-choosingatopic-131220102444-phpapp02 (1).pdf
 
Lec # 13 Firewall.pptx
Lec # 13 Firewall.pptxLec # 13 Firewall.pptx
Lec # 13 Firewall.pptx
 
Lec # 7 Symmetric and asymmetric cryptography.pptx
Lec # 7 Symmetric and asymmetric cryptography.pptxLec # 7 Symmetric and asymmetric cryptography.pptx
Lec # 7 Symmetric and asymmetric cryptography.pptx
 
aquacultureppt-180518113938 (2).docx
aquacultureppt-180518113938 (2).docxaquacultureppt-180518113938 (2).docx
aquacultureppt-180518113938 (2).docx
 
culturedpearls-190715204035.pdf
culturedpearls-190715204035.pdfculturedpearls-190715204035.pdf
culturedpearls-190715204035.pdf
 
Lecture (User Interface Design).ppt
Lecture (User Interface Design).pptLecture (User Interface Design).ppt
Lecture (User Interface Design).ppt
 
lecture (USABILITY and USER INTERFACE DESIGN).ppt
lecture (USABILITY and USER INTERFACE DESIGN).pptlecture (USABILITY and USER INTERFACE DESIGN).ppt
lecture (USABILITY and USER INTERFACE DESIGN).ppt
 

Recently uploaded

DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage examplePragyanshuParadkar1
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerAnamika Sarkar
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxDeepakSakkari2
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIkoyaldeepu123
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxJoão Esperancinha
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfROCENODodongVILLACER
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVRajaP95
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.eptoze12
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfAsst.prof M.Gokilavani
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .Satyam Kumar
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidNikhilNagaraju
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHC Sai Kiran
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionDr.Costas Sachpazis
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024hassan khalil
 

Recently uploaded (20)

POWER SYSTEMS-1 Complete notes examples
POWER SYSTEMS-1 Complete notes  examplesPOWER SYSTEMS-1 Complete notes  examples
POWER SYSTEMS-1 Complete notes examples
 
DATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage exampleDATA ANALYTICS PPT definition usage example
DATA ANALYTICS PPT definition usage example
 
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube ExchangerStudy on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
Study on Air-Water & Water-Water Heat Exchange in a Finned Tube Exchanger
 
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Serviceyoung call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
young call girls in Rajiv Chowk🔝 9953056974 🔝 Delhi escort Service
 
Biology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptxBiology for Computer Engineers Course Handout.pptx
Biology for Computer Engineers Course Handout.pptx
 
EduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AIEduAI - E learning Platform integrated with AI
EduAI - E learning Platform integrated with AI
 
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
🔝9953056974🔝!!-YOUNG call girls in Rajendra Nagar Escort rvice Shot 2000 nigh...
 
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptxDecoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
Decoding Kotlin - Your guide to solving the mysterious in Kotlin.pptx
 
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
VICTOR MAESTRE RAMIREZ - Planetary Defender on NASA's Double Asteroid Redirec...
 
Risk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdfRisk Assessment For Installation of Drainage Pipes.pdf
Risk Assessment For Installation of Drainage Pipes.pdf
 
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IVHARMONY IN THE NATURE AND EXISTENCE - Unit-IV
HARMONY IN THE NATURE AND EXISTENCE - Unit-IV
 
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCRCall Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
Call Us -/9953056974- Call Girls In Vikaspuri-/- Delhi NCR
 
Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.Oxy acetylene welding presentation note.
Oxy acetylene welding presentation note.
 
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdfCCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
CCS355 Neural Network & Deep Learning UNIT III notes and Question bank .pdf
 
Churning of Butter, Factors affecting .
Churning of Butter, Factors affecting  .Churning of Butter, Factors affecting  .
Churning of Butter, Factors affecting .
 
main PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfidmain PPT.pptx of girls hostel security using rfid
main PPT.pptx of girls hostel security using rfid
 
Introduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECHIntroduction to Machine Learning Unit-3 for II MECH
Introduction to Machine Learning Unit-3 for II MECH
 
young call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Serviceyoung call girls in Green Park🔝 9953056974 🔝 escort Service
young call girls in Green Park🔝 9953056974 🔝 escort Service
 
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective IntroductionSachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
Sachpazis Costas: Geotechnical Engineering: A student's Perspective Introduction
 
Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024Architect Hassan Khalil Portfolio for 2024
Architect Hassan Khalil Portfolio for 2024
 

Lecture (Software Testing).pptx

  • 2. Learning Goals for Today • Develop a test suite for some code after looking at it. (White-box testing.) • What are your initial questions? (Have you written some already?) • Should I analyse the specification carefully, as in black-box testing, to discover “what the code should be doing”? • Does white-box testing have an advantage, over black-box testing, in testing “what the program is not intended to do”? • Should I carefully test interfaces, exceptions, or error returns, or should I concentrate on confirming the correctness of functional “internal” behaviour? • Start to develop your own “principled approach” to software testing. D3 2
  • 3. White-Box Testing • “This strategy derives test data from an examination of the program’s logic • “(and often, unfortunately, at the neglect of the specification).” • What is the overall strategy or “gold standard” for white-box testing? • “Causing every statement in the program to execute at least once”? • No… this is “highly inadequate”. D3 3
  • 4. Test phases • Acceptance Testing – this checks if the overall system is functioning as required. • Unit testing – this is basically testing of a single function, procedure, class. • Integration testing – this checks that units tested in isolation work properly when put togheter. • System testing – here the emphasis is to ensure that the whole system can cope with real data, monitor system performance, test the system’s error handling and recovery routines. • Regression Testing – this checks that the system preserves its functionality after maintenance and/or evolution tasks. 4
  • 5. Unit Testing • Unit Tests are tests written by the developers to test functionality as they write it. • Each unit test typically tests only a single class, or a small cluster of classes. • Unit tests are typically written using a unit testing framework, such as JUnit (automatic unit tests). • Target errors not found by Unit testing: - Requirements are mis-interpreted by developer. - Modules don’t integrate with each other 5
  • 6. 6 Testing based on the coverage of the executed program (source) code. Different coverage criteria: • statement coverage • path coverage • condition coverage • definition-use coverage • ….. It is often the case that it is not possible to cover all code. For instance: - for the presence of dead code (not executable code) - for the presence of not feasible path in the CFG - etc. Unit testing: a white-box approach projec
  • 7. AcceptanceTesting • Acceptance Tests are specified by the customer and analyst to test that the overall system is functioning as required (Do developers build the right system?). • Acceptance tests typically test the entire system, or some large chunk of it. • When all the acceptance tests pass for a given user story (or use case, or textual requirement), that story is considered complete. • At the very least, an acceptance test could consist of a script of user interface actions and expected results that a human can run. • Ideally acceptance tests should be automated, either using the unit testing framework (Junit), or a separate acceptance testing framework (Fitnesse). 7
  • 8. AcceptanceTesting • Used to judge if the product is acceptable to the customer • Coarse grained tests of business operations • Scenario/Story-based (contain expectations) • Simple: • Happy paths (confirmatory) • Sad paths • Alternative paths (deviance) 8
  • 9. 9 1.describe the system using a Use-Cases Diagram * a use-case of that diagram represents a functionality implemented by the system 2.detail each use-case with a textual description of, e.g., its pre- post conditions and flow of events * events are related to: (i) the interactions between system and user; and (ii) the expected actions of the system * a flow of events is composed of basic and alternate flows 3.define all instances of each use-case (scenarios) executing the system for realizing the functionality 4.define, at least, one test case for each scenario 5.(opt) define additional test cases to test the interaction between use-cases. Acceptance testing: a black-box approach projec
  • 10. 10 Different approaches can be used: - Random values: - for each input parameter we randomly select the values - Tester Experience: - for each input we use our experience to select relevant values to test - Domain knowledge: - we use requirements information or domain knowledge information to identify relevant values for inputs How to select input values? (1) projec
  • 11. 11 - Combinatorial testing: - test all possible combination of the inputs is often impossible e.g., method(a:int,b:int,c:int) .. how many combinations? with 10 values per input: 10 3 =1000 with 100 values per input: 1003 =1000000 - selection of relevant combinations is important - Pairwise testing (aka 2-way): cover all combinations for each pair of inputs <a,b> <a,c> <b,c> = 10 2 + 10 2 +10 2 =300 don’t care about the value of the third input How to select input values? (3) projec
  • 12. IterativeSoftwaredevelopment 12 + system increment Prioritized functionalities Write acceptanc e tests Execute acceptanc e tests Write and execute unit tests “At different points in the process” “Executed after the development” “Written before”
  • 13. Acceptancevs Unit Testing 13 The motivation of unit testing is finding faults. The motivation of acceptance testing is demonstrating working functionalities. Written and executed during the development. Written before the development and executed after. Written using a unit testing framework. Written using an acceptance testing framework (also unit testing framework). Starting point: new capability (to add a new module/function or class/method). Starting point: User stories, User needs, Use Cases, Textual Requirements, … Used to find faults in individual modules or units (individual programs, functions, procedures, web pages, menus, classes, …) of source code. Used for documentation (low level) Used to verify that the implementation is complete and correct. Used for Integration, System, and regression testing. Used to indicate the progress in the development phase. (Usually as %). Used as a contract. Used for documentation (high level) (extreme programming) When unit tests pass, write another test that fails. (extreme programming) When acceptance tests pass, stop coding. The job is done. Written by developers. Written by Customer and Analyst. Unit Tests Acceptance Tests In theory: