SlideShare ist ein Scribd-Unternehmen logo
1 von 24
Introduction to Formal Methods
in Software Engineering
Inzemamul Haque
22 Nov 2016
Acknowledgement
• Dr. K.V. Raghavan and Dr. Deepak D’Souza for
the content from their course “Formal
Methods in Software Engineering”
Outline
• Motivation
• Definition
• Alloy
• Model-checking
Motivation
• Software projects fail [Barry Boehm, ICSE’06]
– 90% overrun on cost
– 121% overrun on schedule
– Delivers only 61%
• Finding and fixing bugs consume 50% of total
effort in software development
Causes of failure
• User requirements not specified properly
Causes of failure
• User requirements not specified properly
• Design does not meet user requirements
Causes of failure
• User requirements not specified properly
• Design does not meet user requirements
– More than 50% of all defects due to above two
reasons
Causes of failure
• User requirements not specified properly
• Design does not meet user requirements
– More than 50% of all defects due to above two
reasons
• Implementation errors
– Low-level errors such as null-pointer dereference ,
array index out of bounds
Causes of failure
• User requirements not specified properly
• Design does not meet user requirements
– More than 50% of all defects due to above two
reasons
• Implementation errors
– Low-level errors such as null-pointer dereference ,
array index out of bounds
– As software ages, size increases, hence complexity
increases
– Hence implementation errors increase with age
Causes of failure
• User requirements not specified properly
• Design does not meet user requirements
– More than 50% of all defects due to above two
reasons
• Implementation errors
– Low-level errors such as null-pointer dereference ,
array index out of bounds
– As software ages, size increases, hence complexity
increases
– Hence implementation errors increase with age
Using mathematical
techniques can help
Formal methods - definition
• Formal methods in software engineering are
mathematical techniques employed in
software development to make it more
reliable and robust
• Various tools based on these techniques have
been developed
Alloy
• Formal modelling of entities and associations
using sets and relations
• Modelling of constraints on the entities
• Analyzing the consistency of the model and
identifying the errors
Example – family relationships
• Relationships between “Person” entity
• Constraints:
– Every person has two parents
– Parents of any child are married
– Cannot marry a sibling or a parent
– Every person is married to at most one person
– a married to b implies b is married to a
– A man can only marry a woman and vice-versa
How Alloy works
• An Alloy model M is interpreted as a conjunctive
logical formula, fM
• Constraints enforced by signatures as well as facts
automatically become part of fM
• An instance or solution to the model is
– A finite universe U of atoms
– An assignment of subsets of U to the different
signatures
– An assignment of relations to different relations
such that it satisfies fM
Modelling notation to logical formula
• For example
“no p: Person | some p.spouse & p.parents”
becomes
Model-checking
• Model-checking can be used to check if an
initial design satisfies certain properties
• Given an abstract model like a state machine,
and a specification of behaviour (typically in
temporal logic), model checker tries to check
whether model satisfies the property
• If not provides a counter-example
Example
“nocreate” - Once a task has ended it is never created
again.
“nostarve” - Once a task is ready it eventually runs
“stateseq“ - Each task follows specified state motion
Temporal logic
• p: an atomic proposition
• X p: property p holds starting in next state
• F p: property p holds eventually in a future
state
• G p: property p holds at all future states
• U(p,q): property q holds eventually and p
holds till that time.
Model-checking
• Property P can be expressed as LTL formula, F
• Construct a “Buchi-automata”, A, for not F
• Take “product” of A with transition system of
the model, T
• Look for accepting path in this product
• If such a path exists, this is a counter-example
to the claim that T satisfies the property P
• If no such path exists, then T satisfies P
Buchi automata
Some model checkers
• SAL – developed by Stanford Research
Institute
• SLAM – developed by Microsoft Research
• BLAST – developed by University of California,
Berkeley
VCC
• Works on Hoare Logic

Weitere ähnliche Inhalte

Was ist angesagt?

Software requirement specification
Software requirement specificationSoftware requirement specification
Software requirement specificationshiprashakya2
 
Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Ramakant Soni
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specificationAman Adhikari
 
Software process and project metrics
Software process and project metricsSoftware process and project metrics
Software process and project metricsIndu Sharma Bhardwaj
 
process models- software engineering
process models- software engineeringprocess models- software engineering
process models- software engineeringArun Nair
 
Uml deployment diagram
Uml deployment diagramUml deployment diagram
Uml deployment diagramAsraa Batool
 
Software myths | Software Engineering Notes
Software myths | Software Engineering NotesSoftware myths | Software Engineering Notes
Software myths | Software Engineering NotesNavjyotsinh Jadeja
 
Software Devlopment Life Cycle
Software Devlopment Life CycleSoftware Devlopment Life Cycle
Software Devlopment Life CycleVivek Gupta
 
Designing Techniques in Software Engineering
Designing Techniques in Software EngineeringDesigning Techniques in Software Engineering
Designing Techniques in Software Engineeringkirupasuchi1996
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case DiagramAshesh R
 
Software quality assurance
Software quality assuranceSoftware quality assurance
Software quality assuranceEr. Nancy
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignMotaz Saad
 

Was ist angesagt? (20)

Software requirement specification
Software requirement specificationSoftware requirement specification
Software requirement specification
 
White box testing
White box testingWhite box testing
White box testing
 
unit testing and debugging
unit testing and debuggingunit testing and debugging
unit testing and debugging
 
Collaboration diagram- UML diagram
Collaboration diagram- UML diagram Collaboration diagram- UML diagram
Collaboration diagram- UML diagram
 
Software requirement and specification
Software requirement and specificationSoftware requirement and specification
Software requirement and specification
 
Behavioural modelling
Behavioural modellingBehavioural modelling
Behavioural modelling
 
Unit 5
Unit 5Unit 5
Unit 5
 
Software process and project metrics
Software process and project metricsSoftware process and project metrics
Software process and project metrics
 
process models- software engineering
process models- software engineeringprocess models- software engineering
process models- software engineering
 
Uml deployment diagram
Uml deployment diagramUml deployment diagram
Uml deployment diagram
 
Formal Methods
Formal MethodsFormal Methods
Formal Methods
 
Software myths | Software Engineering Notes
Software myths | Software Engineering NotesSoftware myths | Software Engineering Notes
Software myths | Software Engineering Notes
 
Software Devlopment Life Cycle
Software Devlopment Life CycleSoftware Devlopment Life Cycle
Software Devlopment Life Cycle
 
Software quality assurance
Software quality assuranceSoftware quality assurance
Software quality assurance
 
Designing Techniques in Software Engineering
Designing Techniques in Software EngineeringDesigning Techniques in Software Engineering
Designing Techniques in Software Engineering
 
Use Case Diagram
Use Case DiagramUse Case Diagram
Use Case Diagram
 
Analysis modeling
Analysis modelingAnalysis modeling
Analysis modeling
 
Software quality assurance
Software quality assuranceSoftware quality assurance
Software quality assurance
 
Structured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and DesignStructured Vs, Object Oriented Analysis and Design
Structured Vs, Object Oriented Analysis and Design
 
Software Design Concepts
Software Design ConceptsSoftware Design Concepts
Software Design Concepts
 

Ähnlich wie Introduction to formal methods

'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015 'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015 Georgina Tilby
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Praveen Penumathsa
 
MDD and the Tautology Problem: Discussion Notes.
MDD and the Tautology Problem: Discussion Notes.MDD and the Tautology Problem: Discussion Notes.
MDD and the Tautology Problem: Discussion Notes.Bob Binder
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented SoftwarePraveen Penumathsa
 
Ambiguous Requirements – Translating the message from C-level to implementation
Ambiguous Requirements – Translating the message from C-level to implementationAmbiguous Requirements – Translating the message from C-level to implementation
Ambiguous Requirements – Translating the message from C-level to implementationGeorgina Tilby
 
Object Oriented Analysis
Object Oriented AnalysisObject Oriented Analysis
Object Oriented AnalysisAMITJain879
 
kinga-phd-proposal.ppt
kinga-phd-proposal.pptkinga-phd-proposal.ppt
kinga-phd-proposal.pptssuser03e52f
 
How to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingHow to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingTechWell
 
Introduction to Software Engineering and Software Process Models
Introduction to Software Engineering and Software Process ModelsIntroduction to Software Engineering and Software Process Models
Introduction to Software Engineering and Software Process Modelssantoshkawade5
 
Generic Software Process Models
Generic Software Process ModelsGeneric Software Process Models
Generic Software Process ModelsEducation Front
 
FutureOfTesting2008
FutureOfTesting2008FutureOfTesting2008
FutureOfTesting2008vipulkocher
 
Pressman ch-22-process-and-project-metrics
Pressman ch-22-process-and-project-metricsPressman ch-22-process-and-project-metrics
Pressman ch-22-process-and-project-metricsSeema Kamble
 
Software process models
Software process modelsSoftware process models
Software process modelsMalik WaQas
 
JAVA 2013 IEEE DATAMINING PROJECT Comparable entity mining from comparative q...
JAVA 2013 IEEE DATAMINING PROJECT Comparable entity mining from comparative q...JAVA 2013 IEEE DATAMINING PROJECT Comparable entity mining from comparative q...
JAVA 2013 IEEE DATAMINING PROJECT Comparable entity mining from comparative q...IEEEGLOBALSOFTTECHNOLOGIES
 
Comparable entity mining from comparative questions
Comparable entity mining from comparative questionsComparable entity mining from comparative questions
Comparable entity mining from comparative questionsIEEEFINALYEARPROJECTS
 

Ähnlich wie Introduction to formal methods (20)

'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015 'A critique of testing' UK TMF forum January 2015
'A critique of testing' UK TMF forum January 2015
 
Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram Generating test cases using UML Communication Diagram
Generating test cases using UML Communication Diagram
 
MDD and the Tautology Problem: Discussion Notes.
MDD and the Tautology Problem: Discussion Notes.MDD and the Tautology Problem: Discussion Notes.
MDD and the Tautology Problem: Discussion Notes.
 
Testing of Object-Oriented Software
Testing of Object-Oriented SoftwareTesting of Object-Oriented Software
Testing of Object-Oriented Software
 
DITEC - Software Engineering
DITEC - Software EngineeringDITEC - Software Engineering
DITEC - Software Engineering
 
testing
testingtesting
testing
 
ppt2.pptx
ppt2.pptxppt2.pptx
ppt2.pptx
 
Ambiguous Requirements – Translating the message from C-level to implementation
Ambiguous Requirements – Translating the message from C-level to implementationAmbiguous Requirements – Translating the message from C-level to implementation
Ambiguous Requirements – Translating the message from C-level to implementation
 
Object Oriented Analysis
Object Oriented AnalysisObject Oriented Analysis
Object Oriented Analysis
 
kinga-phd-proposal.ppt
kinga-phd-proposal.pptkinga-phd-proposal.ppt
kinga-phd-proposal.ppt
 
Presentation delex
Presentation delexPresentation delex
Presentation delex
 
How to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated TestingHow to Actually DO High-volume Automated Testing
How to Actually DO High-volume Automated Testing
 
Introduction to Software Engineering and Software Process Models
Introduction to Software Engineering and Software Process ModelsIntroduction to Software Engineering and Software Process Models
Introduction to Software Engineering and Software Process Models
 
Generic Software Process Models
Generic Software Process ModelsGeneric Software Process Models
Generic Software Process Models
 
FutureOfTesting2008
FutureOfTesting2008FutureOfTesting2008
FutureOfTesting2008
 
Pressman ch-22-process-and-project-metrics
Pressman ch-22-process-and-project-metricsPressman ch-22-process-and-project-metrics
Pressman ch-22-process-and-project-metrics
 
Software process models
Software process modelsSoftware process models
Software process models
 
JAVA 2013 IEEE DATAMINING PROJECT Comparable entity mining from comparative q...
JAVA 2013 IEEE DATAMINING PROJECT Comparable entity mining from comparative q...JAVA 2013 IEEE DATAMINING PROJECT Comparable entity mining from comparative q...
JAVA 2013 IEEE DATAMINING PROJECT Comparable entity mining from comparative q...
 
Comparable entity mining from comparative questions
Comparable entity mining from comparative questionsComparable entity mining from comparative questions
Comparable entity mining from comparative questions
 
Sanjay
SanjaySanjay
Sanjay
 

Kürzlich hochgeladen

Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZABSYZ Inc
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf31events.com
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Matt Ray
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmSujith Sukumaran
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Angel Borroy López
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanyChristoph Pohl
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identityteam-WIBU
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...Technogeeks
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作qr0udbr0
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Natan Silnitsky
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Hr365.us smith
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROmotivationalword821
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfStefano Stabellini
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaHanief Utama
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalLionel Briand
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprisepreethippts
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfDrew Moseley
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commercemanigoyal112
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsAhmed Mohamed
 

Kürzlich hochgeladen (20)

Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort ServiceHot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
Hot Sexy call girls in Patel Nagar🔝 9953056974 🔝 escort Service
 
Salesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZSalesforce Implementation Services PPT By ABSYZ
Salesforce Implementation Services PPT By ABSYZ
 
Sending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdfSending Calendar Invites on SES and Calendarsnack.pdf
Sending Calendar Invites on SES and Calendarsnack.pdf
 
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
Open Source Summit NA 2024: Open Source Cloud Costs - OpenCost's Impact on En...
 
Intelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalmIntelligent Home Wi-Fi Solutions | ThinkPalm
Intelligent Home Wi-Fi Solutions | ThinkPalm
 
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
Alfresco TTL#157 - Troubleshooting Made Easy: Deciphering Alfresco mTLS Confi...
 
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte GermanySuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
SuccessFactors 1H 2024 Release - Sneak-Peek by Deloitte Germany
 
Post Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on IdentityPost Quantum Cryptography – The Impact on Identity
Post Quantum Cryptography – The Impact on Identity
 
What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...What is Advanced Excel and what are some best practices for designing and cre...
What is Advanced Excel and what are some best practices for designing and cre...
 
英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作英国UN学位证,北安普顿大学毕业证书1:1制作
英国UN学位证,北安普顿大学毕业证书1:1制作
 
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
Taming Distributed Systems: Key Insights from Wix's Large-Scale Experience - ...
 
Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)Recruitment Management Software Benefits (Infographic)
Recruitment Management Software Benefits (Infographic)
 
How To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTROHow To Manage Restaurant Staff -BTRESTRO
How To Manage Restaurant Staff -BTRESTRO
 
Xen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdfXen Safety Embedded OSS Summit April 2024 v4.pdf
Xen Safety Embedded OSS Summit April 2024 v4.pdf
 
React Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief UtamaReact Server Component in Next.js by Hanief Utama
React Server Component in Next.js by Hanief Utama
 
Precise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive GoalPrecise and Complete Requirements? An Elusive Goal
Precise and Complete Requirements? An Elusive Goal
 
Odoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 EnterpriseOdoo 14 - eLearning Module In Odoo 14 Enterprise
Odoo 14 - eLearning Module In Odoo 14 Enterprise
 
Comparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdfComparing Linux OS Image Update Models - EOSS 2024.pdf
Comparing Linux OS Image Update Models - EOSS 2024.pdf
 
Cyber security and its impact on E commerce
Cyber security and its impact on E commerceCyber security and its impact on E commerce
Cyber security and its impact on E commerce
 
Unveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML DiagramsUnveiling Design Patterns: A Visual Guide with UML Diagrams
Unveiling Design Patterns: A Visual Guide with UML Diagrams
 

Introduction to formal methods

  • 1. Introduction to Formal Methods in Software Engineering Inzemamul Haque 22 Nov 2016
  • 2. Acknowledgement • Dr. K.V. Raghavan and Dr. Deepak D’Souza for the content from their course “Formal Methods in Software Engineering”
  • 3. Outline • Motivation • Definition • Alloy • Model-checking
  • 4. Motivation • Software projects fail [Barry Boehm, ICSE’06] – 90% overrun on cost – 121% overrun on schedule – Delivers only 61% • Finding and fixing bugs consume 50% of total effort in software development
  • 5. Causes of failure • User requirements not specified properly
  • 6. Causes of failure • User requirements not specified properly • Design does not meet user requirements
  • 7. Causes of failure • User requirements not specified properly • Design does not meet user requirements – More than 50% of all defects due to above two reasons
  • 8. Causes of failure • User requirements not specified properly • Design does not meet user requirements – More than 50% of all defects due to above two reasons • Implementation errors – Low-level errors such as null-pointer dereference , array index out of bounds
  • 9. Causes of failure • User requirements not specified properly • Design does not meet user requirements – More than 50% of all defects due to above two reasons • Implementation errors – Low-level errors such as null-pointer dereference , array index out of bounds – As software ages, size increases, hence complexity increases – Hence implementation errors increase with age
  • 10. Causes of failure • User requirements not specified properly • Design does not meet user requirements – More than 50% of all defects due to above two reasons • Implementation errors – Low-level errors such as null-pointer dereference , array index out of bounds – As software ages, size increases, hence complexity increases – Hence implementation errors increase with age Using mathematical techniques can help
  • 11. Formal methods - definition • Formal methods in software engineering are mathematical techniques employed in software development to make it more reliable and robust • Various tools based on these techniques have been developed
  • 12. Alloy • Formal modelling of entities and associations using sets and relations • Modelling of constraints on the entities • Analyzing the consistency of the model and identifying the errors
  • 13. Example – family relationships • Relationships between “Person” entity • Constraints: – Every person has two parents – Parents of any child are married – Cannot marry a sibling or a parent – Every person is married to at most one person – a married to b implies b is married to a – A man can only marry a woman and vice-versa
  • 14. How Alloy works • An Alloy model M is interpreted as a conjunctive logical formula, fM • Constraints enforced by signatures as well as facts automatically become part of fM • An instance or solution to the model is – A finite universe U of atoms – An assignment of subsets of U to the different signatures – An assignment of relations to different relations such that it satisfies fM
  • 15. Modelling notation to logical formula • For example “no p: Person | some p.spouse & p.parents” becomes
  • 16.
  • 17. Model-checking • Model-checking can be used to check if an initial design satisfies certain properties • Given an abstract model like a state machine, and a specification of behaviour (typically in temporal logic), model checker tries to check whether model satisfies the property • If not provides a counter-example
  • 18. Example “nocreate” - Once a task has ended it is never created again. “nostarve” - Once a task is ready it eventually runs “stateseq“ - Each task follows specified state motion
  • 19. Temporal logic • p: an atomic proposition • X p: property p holds starting in next state • F p: property p holds eventually in a future state • G p: property p holds at all future states • U(p,q): property q holds eventually and p holds till that time.
  • 20. Model-checking • Property P can be expressed as LTL formula, F • Construct a “Buchi-automata”, A, for not F • Take “product” of A with transition system of the model, T • Look for accepting path in this product • If such a path exists, this is a counter-example to the claim that T satisfies the property P • If no such path exists, then T satisfies P
  • 21.
  • 23. Some model checkers • SAL – developed by Stanford Research Institute • SLAM – developed by Microsoft Research • BLAST – developed by University of California, Berkeley
  • 24. VCC • Works on Hoare Logic

Hinweis der Redaktion

  1. Show demo after this slide