SlideShare ist ein Scribd-Unternehmen logo
1 von 25
Downloaden Sie, um offline zu lesen
Project FoX: A Tool That Offers
  Automated Testing Using a
       Formal Approach
          Ivo Neskovic
Agenda
•   Software Engineering: What could go wrong?
•   Formal Methods
•   Project FoX
•   Case Study: The buffer system
•   Conclusions and Future Work
•   Bibliography
The Problem of Software Engineering
• Faulty systems are a common notion nowadays.
• SE is an engineering discipline, yet lacking the
  engineering formality.
• Subjective and informal testing.
• Impossible to prove that the system:
  – Does what it is supposed to do.
  – Does not do what it is not supposed to do.
• Needs structured and precise system designs.
Formal Methods
•   The applied mathematics of computer systems engineering, used to
    specify and model the behaviour of a system and mathematically verify
    that the system design and implementation satisfy functional and safety
    properties.
•   Specification Languages:
     –   Abstract State Machines
     –   Generalized State Machines
     –   Communicating Sequential Processes
     –   Specification and Description Language
     –   Petri Nets
     –   Temporal Logic of Actions
     –   B and event – B method
     –   Z
Formal Methods at a Trial
• Benefits:
   – Specification may be used as a basis for proving the presence or lack
     of certain properties in the design and by inference in the developed
     system.
   – Mathematical proof of correctness (Theorem proving).
   – Model checking (Proving desired properties in a design).
   – Formal Testing.
• Used mainly for safety critical systems such as aerospace
  engineering.
• Criticism:
   – Expensive and time consuming approach (though questionable).
   – Lack of tooling support.
Incorporating Formal Methods in the
        Development Cycle
Project FoX
•   Produce the complete set of test cases from a formal specification.
•   Execute the tests on the systems implementation.
•   Locate errors and non-equivalences and report them to the user.
•   Developed in Java for Java.
•   Compatible with Java Standard Edition, Enterprise Edition, Mobile
    Edition.
•   Can be extend to work in conjunction with popular Java frameworks.
•   Operates on compiled bytecode with the addition of a few specific
    annotations.
•   Utilizes the test drivers of JUnit.
•   FoX provides a bridge between regular Java developers and the benefits
    of complete positive and negative testing, proven to find all faults.
Using Project FoX
• Two artefacts necessary:
   – Formal specification of the system.
   – The system’s implementation.
Buffer Case Study – Description
•   Simple buffer in a factory.
•   Accepts parts, any parts.
•   Parts have a name and an ID.
•   The buffer has a capacity of 2.
•   The buffer can be empty, partially
    full or completely full.
•   Supports adding and removing
    items.
•   If the capacity is reached, no
    additional items can be placed in
    the buffer unless and item is
    removed firsts.
Buffer Case Study – Formal
                    Specification
•   Modelled as a Generalized State
    Machine (stream X-Machine).
•   A theoretical model of computing,
    pioneered by Samuel Eilenberg
    in1974 (X-Machine).
•   Separates flow control from
    processing.
•   Flow control is abstracted to a level
    suitable for representation as a finite
    state machine.
•   Complex data structures are modelled
    as an infinite memory.
•   Able to model both static (data) and
    dynamic (control) parts of a system.
Buffer Case Study – Formal
             Specification (cont.)
• Simple buffer in a factory.
< xMachine name = " Buffer " >

• The buffer can be empty, partially full or completely full.
< states >
   < state initialState = " true " > empty </ state >
   < state > non_empty </ state >
   < state > full </ state >
</ states >
Buffer Case Study – Formal
               Specification (cont.)
• Accepts parts, any parts.
< input name = " part " ref = " BufferObject " / >

• The buffer has a capacity of 2.
< types >
   < builtInType name = " capacity " type = " integer " / >
   < builtInType name = " buffer " type = " set: BufferObject " / >
</ types >
< memory >
   < memoryBlock ref = " buffer " initialValue = " null " / >
   < memoryBlock ref = " capacity " initialValue = " 2 " / >
</ memory >
Buffer Case Study – Formal
                Specification (cont.)
• Parts have a name and an ID.
< types >
   < complexType name = " ItemType " >
      < attributes >
         < builtInType name = " type " type = " string " / >
      </ attributes >
   </ complexType >
   < complexType name = " BufferObject " >
      < attributes >
         < complexType name = " type " ref = " ItemType " / >
         < builtInType name = " itemId " type = " integer " / >
      </ attributes >
   </ complexType >
< /type >
Buffer Case Study – Formal
                Specification (cont.)
• Supports adding and removing items.               < transitions >
< functions >                                          < transition >
   < function name = " add_part " >                        < startingState >
       < guard >                                                empty
          !buffer. contains ( part ) && buffer .           </ startingState >
    size () + 1 < capacity . value ()                      < appliedFunction >
       </ guard >                                               add_part
       < body > buffer . add ( part ) ; </ body >          </ appliedFunction >
       < output > Part Added </ output >                   < endingState >
   </ function >                                                non_empty
   ...                                                     </ endingState >
</ functions >                                         </ transition >
                                                       ...
                                                    </ transitions>
Buffer Case Study – Implementation
public class BufferObject {           public class ItemType {
    private int itemId;                   private String type;
    private ItemType type;
                                          public ItemType(String type) {
    public BufferObject(int itemId,           this.type = type;
     ItemType type) {
                                          }
        this.itemId = itemId;
                                      }
        this.type = type;
    }
}
Buffer Case Study – Implementation
• @Xmachine - annotating the class representing the system modeled
  with the specification.
• XMachineModel – a class representing the model, containing a number
  of useful helper methods.

@XMachine(inputType = "BufferObject",
sampleInputs = {
     "integer: 10, ItemType: (string:Box)",
     "integer: 17, ItemType: (string:HeavyBox)",
     "integer: 25, ItemType: (string:ReallyHeavyBox)"
})
public class Buffer extends XMachineModel {
Buffer Case Study – Implementation
• @XMMemoryBlock – a field level annotation, associating Java data
  structures with their specification equivalents.

@XMMemoryBlock(name = "buffer")
private List<BufferObject> buffer;
@XMMemoryBlock(name = "capacity")
private int capacity;


public Buffer() {
    super("Buffer");
    buffer = new LinkedList<BufferObject>();
    capacity = 2;
}
Buffer Case Study – Implementation
• @XMFunction – a method level annotation, referencing the
  modeled functions implementations.
• reportOutcome( outcome: String) – one of the many helper
  methods of the XMachineModel class.

@XMFunction(name = "add_part")
public void addPart(BufferObject part) {
  if (!buffer.contains(part) && buffer.size() + 1 <
      capacity) {
      buffer.add(part);
      reportOutcome("Part Added");
  }
Buffer Case Study – Executing Fox
Buffer Case Study – Executing FoX
             (implanted error)
if (!buffer.contains(part) && buffer.size() + 1 <
      capacity) {
    buffer.add(part);
    capacity++;
    reportOutcome("Part Added");
}
Buffer Case Study – Generated Test
                  Cases
•   Tests report the sequence of inputs used for the specific scenario, the
    sequence of expected outputs and the actual output.
•   Outcome is reported to the user via the usual JUnit red / green
    notifications.

<tests>
   …
   <test testID=”2”>
      <input>[ itemId: 17 type: HeavyBox, itemId: 10 type: Box]</input>
      <expectedOutput>
         [ Part Added, Part Added – Become Full ]
      </expectedOutput>
      <output>[ Part Added, Part Added – Become Full ]</output>
   </test>
   …
</tests>
Conclusions and Future Work
• FoX enables developers to leverage the already
  proven theories for formal testing.
• Provides a fully automated testing process, ranging
  from complete test set generation (satisfying some
  design for test conditions), to test preparation and
  execution.
• Operates on any Java based software system,
  being transparent to it's underlining technologies.
• Provides complete positive and complete negative
  testing.
Conclusions and Future Work (cont.)
• Next steps:
  – Thorough evaluation.
  – An additional tool to make the specification step easier
    and closer to the developer, aiming to “hide” the formality
    as much as possible.
  – NetBeans and Eclipse integration.
  – A standalone X-Machine IDE providing additional related
    functionalities.
  – Branch out to other languages and frameworks (eg. C#
    and .NET).
Bibliography
•   S. Eilenberg, Automate, Languages and Machines, Vol. A. Academic Press,
    London, 1974.
•   M. Holcombe, “X-Machines as a basis for dynamic system specification,”
    Software Engineering Journal, vol. 3(2), pp. 69-76, 1988.
•   F. Ipate and M. Holcombe, “Specification and Testing using Generalized
    Machines: a Presentation and a Case Study,” Softw. Test. Verif. Reliab, vol. 8,
    pp. 61-81, 1998.
•   M. Holcombe and F. Ipate, Correct Systems: Building a Business Process
    Solution. Springer, Applied Computing Series, November 1998.
•   G. Eleftherakis and A. Cowling, “An Agile Formal Development Methodology,” in
    1st South Eastern European workshop on Formal Methods (SEEFM 03),
    (Thessaloniki), pp. 36-47, Nov. 2002. Agile Formal Methods: Practical, Rigorous
    Methods for a changing world.
•   P. Kefalas, G. Eleftherakis, and E. Kehris, “Communicating X-Machines: a
    practical approach for formal and modular specification of large systems,”
    Information and Software Technology, vol. 45, pp. 269-280, Apr. 2003.
Thank you
• Contact:
  – ivo.neskovic@gmail.com
  – http://twitter.com/trumpets

Weitere ähnliche Inhalte

Was ist angesagt?

NUnit Features Presentation
NUnit Features PresentationNUnit Features Presentation
NUnit Features PresentationShir Brass
 
Functional Java 8 - Introduction
Functional Java 8 - IntroductionFunctional Java 8 - Introduction
Functional Java 8 - IntroductionŁukasz Biały
 
Actions in QTP
Actions in QTPActions in QTP
Actions in QTPAnish10110
 
Qtp 92 Tutorial
Qtp 92 TutorialQtp 92 Tutorial
Qtp 92 Tutorialsasidhar
 
Learning on Deep Learning
Learning on Deep LearningLearning on Deep Learning
Learning on Deep LearningShelley Lambert
 
Basics of QTP Framework
Basics of QTP FrameworkBasics of QTP Framework
Basics of QTP FrameworkAnish10110
 
QTP Slides Presentation.
QTP Slides Presentation.QTP Slides Presentation.
QTP Slides Presentation.tjdhans
 
Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Hong Le Van
 
Data Base Testing Interview Questions
Data Base Testing Interview QuestionsData Base Testing Interview Questions
Data Base Testing Interview QuestionsRita Singh
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profilerIhor Bobak
 
Finding Bugs Faster with Assertion Based Verification (ABV)
Finding Bugs Faster with Assertion Based Verification (ABV)Finding Bugs Faster with Assertion Based Verification (ABV)
Finding Bugs Faster with Assertion Based Verification (ABV)DVClub
 
Hp Quick Test Professional
Hp Quick Test ProfessionalHp Quick Test Professional
Hp Quick Test Professionalsunny.deb
 
When assertthat(you).understandUnitTesting() fails
When assertthat(you).understandUnitTesting() failsWhen assertthat(you).understandUnitTesting() fails
When assertthat(you).understandUnitTesting() failsMartin Skurla
 

Was ist angesagt? (20)

NUnit Features Presentation
NUnit Features PresentationNUnit Features Presentation
NUnit Features Presentation
 
Functional Java 8 - Introduction
Functional Java 8 - IntroductionFunctional Java 8 - Introduction
Functional Java 8 - Introduction
 
Actions in QTP
Actions in QTPActions in QTP
Actions in QTP
 
Junit
JunitJunit
Junit
 
L06 process design
L06 process designL06 process design
L06 process design
 
Qtp 92 Tutorial
Qtp 92 TutorialQtp 92 Tutorial
Qtp 92 Tutorial
 
Java SE 8 best practices
Java SE 8 best practicesJava SE 8 best practices
Java SE 8 best practices
 
Java tutorials
Java tutorialsJava tutorials
Java tutorials
 
Learning on Deep Learning
Learning on Deep LearningLearning on Deep Learning
Learning on Deep Learning
 
Basics of QTP Framework
Basics of QTP FrameworkBasics of QTP Framework
Basics of QTP Framework
 
Java 8 by example!
Java 8 by example!Java 8 by example!
Java 8 by example!
 
QTP Slides Presentation.
QTP Slides Presentation.QTP Slides Presentation.
QTP Slides Presentation.
 
Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++Test driven development and unit testing with examples in C++
Test driven development and unit testing with examples in C++
 
Data Base Testing Interview Questions
Data Base Testing Interview QuestionsData Base Testing Interview Questions
Data Base Testing Interview Questions
 
JUnit Presentation
JUnit PresentationJUnit Presentation
JUnit Presentation
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
Gallio Crafting A Toolchain
Gallio Crafting A ToolchainGallio Crafting A Toolchain
Gallio Crafting A Toolchain
 
Finding Bugs Faster with Assertion Based Verification (ABV)
Finding Bugs Faster with Assertion Based Verification (ABV)Finding Bugs Faster with Assertion Based Verification (ABV)
Finding Bugs Faster with Assertion Based Verification (ABV)
 
Hp Quick Test Professional
Hp Quick Test ProfessionalHp Quick Test Professional
Hp Quick Test Professional
 
When assertthat(you).understandUnitTesting() fails
When assertthat(you).understandUnitTesting() failsWhen assertthat(you).understandUnitTesting() fails
When assertthat(you).understandUnitTesting() fails
 

Andere mochten auch

Web 2.0 tools Isabella Craig
Web 2.0 tools Isabella CraigWeb 2.0 tools Isabella Craig
Web 2.0 tools Isabella Craigissy63
 
Social Media to Situational Awareness; Value in not so many words
Social Media to Situational Awareness; Value in not so many wordsSocial Media to Situational Awareness; Value in not so many words
Social Media to Situational Awareness; Value in not so many wordsmwhite1ca
 
Autonomic Computing: Vision or Reality
Autonomic Computing: Vision or RealityAutonomic Computing: Vision or Reality
Autonomic Computing: Vision or RealityIvo Neskovic
 
2011 p5-math-sa1-mgs
2011 p5-math-sa1-mgs2011 p5-math-sa1-mgs
2011 p5-math-sa1-mgsAnna Lee
 
Improving Classroom Dynamics: Click’N’Gage, a Mobile Audience Response System
Improving Classroom Dynamics: Click’N’Gage, a Mobile Audience Response SystemImproving Classroom Dynamics: Click’N’Gage, a Mobile Audience Response System
Improving Classroom Dynamics: Click’N’Gage, a Mobile Audience Response SystemIvo Neskovic
 
Russian revolutions 2014 (wiki)
Russian revolutions 2014 (wiki)Russian revolutions 2014 (wiki)
Russian revolutions 2014 (wiki)Lauren Rivard
 

Andere mochten auch (8)

Web 2.0 tools Isabella Craig
Web 2.0 tools Isabella CraigWeb 2.0 tools Isabella Craig
Web 2.0 tools Isabella Craig
 
Social Media to Situational Awareness; Value in not so many words
Social Media to Situational Awareness; Value in not so many wordsSocial Media to Situational Awareness; Value in not so many words
Social Media to Situational Awareness; Value in not so many words
 
WWI Background
WWI BackgroundWWI Background
WWI Background
 
Autonomic Computing: Vision or Reality
Autonomic Computing: Vision or RealityAutonomic Computing: Vision or Reality
Autonomic Computing: Vision or Reality
 
El docente de hoy
El docente de hoyEl docente de hoy
El docente de hoy
 
2011 p5-math-sa1-mgs
2011 p5-math-sa1-mgs2011 p5-math-sa1-mgs
2011 p5-math-sa1-mgs
 
Improving Classroom Dynamics: Click’N’Gage, a Mobile Audience Response System
Improving Classroom Dynamics: Click’N’Gage, a Mobile Audience Response SystemImproving Classroom Dynamics: Click’N’Gage, a Mobile Audience Response System
Improving Classroom Dynamics: Click’N’Gage, a Mobile Audience Response System
 
Russian revolutions 2014 (wiki)
Russian revolutions 2014 (wiki)Russian revolutions 2014 (wiki)
Russian revolutions 2014 (wiki)
 

Ähnlich wie Project FoX: A Tool That Offers Automated Testing Using a Formal Approach

Into The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsInto The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsOrtus Solutions, Corp
 
API Performance Testing
API Performance TestingAPI Performance Testing
API Performance Testingrsg00usa
 
AADL: Architecture Analysis and Design Language
AADL: Architecture Analysis and Design LanguageAADL: Architecture Analysis and Design Language
AADL: Architecture Analysis and Design LanguageIvano Malavolta
 
Unit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - KenyaUnit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - KenyaErick M'bwana
 
Testware Hierarchy for Test Automation
Testware Hierarchy for Test AutomationTestware Hierarchy for Test Automation
Testware Hierarchy for Test AutomationGregory Solovey
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologieselliando dias
 
Junit in mule
Junit in muleJunit in mule
Junit in muleF K
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo javeed_mhd
 
Formal Verification
Formal VerificationFormal Verification
Formal VerificationIlia Levin
 
Automated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesAutomated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesTao Xie
 
Unit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step TrainingUnit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step TrainingRam Awadh Prasad, PMP
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesTriTAUG
 
HP Quick Test Professional
HP Quick Test ProfessionalHP Quick Test Professional
HP Quick Test ProfessionalVitaliy Ganzha
 

Ähnlich wie Project FoX: A Tool That Offers Automated Testing Using a Formal Approach (20)

Into The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applicationsInto The Box 2018 | Assert control over your legacy applications
Into The Box 2018 | Assert control over your legacy applications
 
Java 8 Feature Preview
Java 8 Feature PreviewJava 8 Feature Preview
Java 8 Feature Preview
 
API Performance Testing
API Performance TestingAPI Performance Testing
API Performance Testing
 
AADL: Architecture Analysis and Design Language
AADL: Architecture Analysis and Design LanguageAADL: Architecture Analysis and Design Language
AADL: Architecture Analysis and Design Language
 
Modern Python Testing
Modern Python TestingModern Python Testing
Modern Python Testing
 
Junit_.pptx
Junit_.pptxJunit_.pptx
Junit_.pptx
 
JS Essence
JS EssenceJS Essence
JS Essence
 
Unit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - KenyaUnit testing and mocking in Python - PyCon 2018 - Kenya
Unit testing and mocking in Python - PyCon 2018 - Kenya
 
Testware Hierarchy for Test Automation
Testware Hierarchy for Test AutomationTestware Hierarchy for Test Automation
Testware Hierarchy for Test Automation
 
Comparative Development Methodologies
Comparative Development MethodologiesComparative Development Methodologies
Comparative Development Methodologies
 
Junit in mule
Junit in muleJunit in mule
Junit in mule
 
Junit in mule
Junit in muleJunit in mule
Junit in mule
 
Junit in mule
Junit in muleJunit in mule
Junit in mule
 
Junit in mule demo
Junit in mule demo Junit in mule demo
Junit in mule demo
 
Formal Verification
Formal VerificationFormal Verification
Formal Verification
 
Automated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and ChallengesAutomated Developer Testing: Achievements and Challenges
Automated Developer Testing: Achievements and Challenges
 
Unit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step TrainingUnit Testng with PHP Unit - A Step by Step Training
Unit Testng with PHP Unit - A Step by Step Training
 
May: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and ChallengesMay: Automated Developer Testing: Achievements and Challenges
May: Automated Developer Testing: Achievements and Challenges
 
Unit tests and TDD
Unit tests and TDDUnit tests and TDD
Unit tests and TDD
 
HP Quick Test Professional
HP Quick Test ProfessionalHP Quick Test Professional
HP Quick Test Professional
 

Kürzlich hochgeladen

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...Neo4j
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024The Digital Insurer
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsMaria Levchenko
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreternaman860154
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)Gabriella Davis
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slidevu2urc
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Scriptwesley chun
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024Rafal Los
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonetsnaman860154
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessPixlogix Infotech
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024Results
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerThousandEyes
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking MenDelhi Call girls
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Servicegiselly40
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CVKhem
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024The Digital Insurer
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?Antenna Manufacturer Coco
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityPrincipled Technologies
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024The Digital Insurer
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Igalia
 

Kürzlich hochgeladen (20)

Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...Workshop - Best of Both Worlds_ Combine  KG and Vector search for  enhanced R...
Workshop - Best of Both Worlds_ Combine KG and Vector search for enhanced R...
 
Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024Axa Assurance Maroc - Insurer Innovation Award 2024
Axa Assurance Maroc - Insurer Innovation Award 2024
 
Handwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed textsHandwritten Text Recognition for manuscripts and early printed texts
Handwritten Text Recognition for manuscripts and early printed texts
 
Presentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreterPresentation on how to chat with PDF using ChatGPT code interpreter
Presentation on how to chat with PDF using ChatGPT code interpreter
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)
 
Histor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slideHistor y of HAM Radio presentation slide
Histor y of HAM Radio presentation slide
 
Automating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps ScriptAutomating Google Workspace (GWS) & more with Apps Script
Automating Google Workspace (GWS) & more with Apps Script
 
The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024The 7 Things I Know About Cyber Security After 25 Years | April 2024
The 7 Things I Know About Cyber Security After 25 Years | April 2024
 
How to convert PDF to text with Nanonets
How to convert PDF to text with NanonetsHow to convert PDF to text with Nanonets
How to convert PDF to text with Nanonets
 
Advantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your BusinessAdvantages of Hiring UIUX Design Service Providers for Your Business
Advantages of Hiring UIUX Design Service Providers for Your Business
 
A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024A Call to Action for Generative AI in 2024
A Call to Action for Generative AI in 2024
 
How to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected WorkerHow to Troubleshoot Apps for the Modern Connected Worker
How to Troubleshoot Apps for the Modern Connected Worker
 
08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men08448380779 Call Girls In Friends Colony Women Seeking Men
08448380779 Call Girls In Friends Colony Women Seeking Men
 
CNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of ServiceCNv6 Instructor Chapter 6 Quality of Service
CNv6 Instructor Chapter 6 Quality of Service
 
Real Time Object Detection Using Open CV
Real Time Object Detection Using Open CVReal Time Object Detection Using Open CV
Real Time Object Detection Using Open CV
 
Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024Tata AIG General Insurance Company - Insurer Innovation Award 2024
Tata AIG General Insurance Company - Insurer Innovation Award 2024
 
What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?What Are The Drone Anti-jamming Systems Technology?
What Are The Drone Anti-jamming Systems Technology?
 
Boost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivityBoost PC performance: How more available memory can improve productivity
Boost PC performance: How more available memory can improve productivity
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
Raspberry Pi 5: Challenges and Solutions in Bringing up an OpenGL/Vulkan Driv...
 

Project FoX: A Tool That Offers Automated Testing Using a Formal Approach

  • 1. Project FoX: A Tool That Offers Automated Testing Using a Formal Approach Ivo Neskovic
  • 2. Agenda • Software Engineering: What could go wrong? • Formal Methods • Project FoX • Case Study: The buffer system • Conclusions and Future Work • Bibliography
  • 3. The Problem of Software Engineering • Faulty systems are a common notion nowadays. • SE is an engineering discipline, yet lacking the engineering formality. • Subjective and informal testing. • Impossible to prove that the system: – Does what it is supposed to do. – Does not do what it is not supposed to do. • Needs structured and precise system designs.
  • 4. Formal Methods • The applied mathematics of computer systems engineering, used to specify and model the behaviour of a system and mathematically verify that the system design and implementation satisfy functional and safety properties. • Specification Languages: – Abstract State Machines – Generalized State Machines – Communicating Sequential Processes – Specification and Description Language – Petri Nets – Temporal Logic of Actions – B and event – B method – Z
  • 5. Formal Methods at a Trial • Benefits: – Specification may be used as a basis for proving the presence or lack of certain properties in the design and by inference in the developed system. – Mathematical proof of correctness (Theorem proving). – Model checking (Proving desired properties in a design). – Formal Testing. • Used mainly for safety critical systems such as aerospace engineering. • Criticism: – Expensive and time consuming approach (though questionable). – Lack of tooling support.
  • 6. Incorporating Formal Methods in the Development Cycle
  • 7. Project FoX • Produce the complete set of test cases from a formal specification. • Execute the tests on the systems implementation. • Locate errors and non-equivalences and report them to the user. • Developed in Java for Java. • Compatible with Java Standard Edition, Enterprise Edition, Mobile Edition. • Can be extend to work in conjunction with popular Java frameworks. • Operates on compiled bytecode with the addition of a few specific annotations. • Utilizes the test drivers of JUnit. • FoX provides a bridge between regular Java developers and the benefits of complete positive and negative testing, proven to find all faults.
  • 8. Using Project FoX • Two artefacts necessary: – Formal specification of the system. – The system’s implementation.
  • 9. Buffer Case Study – Description • Simple buffer in a factory. • Accepts parts, any parts. • Parts have a name and an ID. • The buffer has a capacity of 2. • The buffer can be empty, partially full or completely full. • Supports adding and removing items. • If the capacity is reached, no additional items can be placed in the buffer unless and item is removed firsts.
  • 10. Buffer Case Study – Formal Specification • Modelled as a Generalized State Machine (stream X-Machine). • A theoretical model of computing, pioneered by Samuel Eilenberg in1974 (X-Machine). • Separates flow control from processing. • Flow control is abstracted to a level suitable for representation as a finite state machine. • Complex data structures are modelled as an infinite memory. • Able to model both static (data) and dynamic (control) parts of a system.
  • 11. Buffer Case Study – Formal Specification (cont.) • Simple buffer in a factory. < xMachine name = " Buffer " > • The buffer can be empty, partially full or completely full. < states > < state initialState = " true " > empty </ state > < state > non_empty </ state > < state > full </ state > </ states >
  • 12. Buffer Case Study – Formal Specification (cont.) • Accepts parts, any parts. < input name = " part " ref = " BufferObject " / > • The buffer has a capacity of 2. < types > < builtInType name = " capacity " type = " integer " / > < builtInType name = " buffer " type = " set: BufferObject " / > </ types > < memory > < memoryBlock ref = " buffer " initialValue = " null " / > < memoryBlock ref = " capacity " initialValue = " 2 " / > </ memory >
  • 13. Buffer Case Study – Formal Specification (cont.) • Parts have a name and an ID. < types > < complexType name = " ItemType " > < attributes > < builtInType name = " type " type = " string " / > </ attributes > </ complexType > < complexType name = " BufferObject " > < attributes > < complexType name = " type " ref = " ItemType " / > < builtInType name = " itemId " type = " integer " / > </ attributes > </ complexType > < /type >
  • 14. Buffer Case Study – Formal Specification (cont.) • Supports adding and removing items. < transitions > < functions > < transition > < function name = " add_part " > < startingState > < guard > empty !buffer. contains ( part ) && buffer . </ startingState > size () + 1 < capacity . value () < appliedFunction > </ guard > add_part < body > buffer . add ( part ) ; </ body > </ appliedFunction > < output > Part Added </ output > < endingState > </ function > non_empty ... </ endingState > </ functions > </ transition > ... </ transitions>
  • 15. Buffer Case Study – Implementation public class BufferObject { public class ItemType { private int itemId; private String type; private ItemType type; public ItemType(String type) { public BufferObject(int itemId, this.type = type; ItemType type) { } this.itemId = itemId; } this.type = type; } }
  • 16. Buffer Case Study – Implementation • @Xmachine - annotating the class representing the system modeled with the specification. • XMachineModel – a class representing the model, containing a number of useful helper methods. @XMachine(inputType = "BufferObject", sampleInputs = { "integer: 10, ItemType: (string:Box)", "integer: 17, ItemType: (string:HeavyBox)", "integer: 25, ItemType: (string:ReallyHeavyBox)" }) public class Buffer extends XMachineModel {
  • 17. Buffer Case Study – Implementation • @XMMemoryBlock – a field level annotation, associating Java data structures with their specification equivalents. @XMMemoryBlock(name = "buffer") private List<BufferObject> buffer; @XMMemoryBlock(name = "capacity") private int capacity; public Buffer() { super("Buffer"); buffer = new LinkedList<BufferObject>(); capacity = 2; }
  • 18. Buffer Case Study – Implementation • @XMFunction – a method level annotation, referencing the modeled functions implementations. • reportOutcome( outcome: String) – one of the many helper methods of the XMachineModel class. @XMFunction(name = "add_part") public void addPart(BufferObject part) { if (!buffer.contains(part) && buffer.size() + 1 < capacity) { buffer.add(part); reportOutcome("Part Added"); }
  • 19. Buffer Case Study – Executing Fox
  • 20. Buffer Case Study – Executing FoX (implanted error) if (!buffer.contains(part) && buffer.size() + 1 < capacity) { buffer.add(part); capacity++; reportOutcome("Part Added"); }
  • 21. Buffer Case Study – Generated Test Cases • Tests report the sequence of inputs used for the specific scenario, the sequence of expected outputs and the actual output. • Outcome is reported to the user via the usual JUnit red / green notifications. <tests> … <test testID=”2”> <input>[ itemId: 17 type: HeavyBox, itemId: 10 type: Box]</input> <expectedOutput> [ Part Added, Part Added – Become Full ] </expectedOutput> <output>[ Part Added, Part Added – Become Full ]</output> </test> … </tests>
  • 22. Conclusions and Future Work • FoX enables developers to leverage the already proven theories for formal testing. • Provides a fully automated testing process, ranging from complete test set generation (satisfying some design for test conditions), to test preparation and execution. • Operates on any Java based software system, being transparent to it's underlining technologies. • Provides complete positive and complete negative testing.
  • 23. Conclusions and Future Work (cont.) • Next steps: – Thorough evaluation. – An additional tool to make the specification step easier and closer to the developer, aiming to “hide” the formality as much as possible. – NetBeans and Eclipse integration. – A standalone X-Machine IDE providing additional related functionalities. – Branch out to other languages and frameworks (eg. C# and .NET).
  • 24. Bibliography • S. Eilenberg, Automate, Languages and Machines, Vol. A. Academic Press, London, 1974. • M. Holcombe, “X-Machines as a basis for dynamic system specification,” Software Engineering Journal, vol. 3(2), pp. 69-76, 1988. • F. Ipate and M. Holcombe, “Specification and Testing using Generalized Machines: a Presentation and a Case Study,” Softw. Test. Verif. Reliab, vol. 8, pp. 61-81, 1998. • M. Holcombe and F. Ipate, Correct Systems: Building a Business Process Solution. Springer, Applied Computing Series, November 1998. • G. Eleftherakis and A. Cowling, “An Agile Formal Development Methodology,” in 1st South Eastern European workshop on Formal Methods (SEEFM 03), (Thessaloniki), pp. 36-47, Nov. 2002. Agile Formal Methods: Practical, Rigorous Methods for a changing world. • P. Kefalas, G. Eleftherakis, and E. Kehris, “Communicating X-Machines: a practical approach for formal and modular specification of large systems,” Information and Software Technology, vol. 45, pp. 269-280, Apr. 2003.
  • 25. Thank you • Contact: – ivo.neskovic@gmail.com – http://twitter.com/trumpets