SlideShare uma empresa Scribd logo
1 de 25
Baixar para ler offline
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

Mais conteúdo relacionado

Mais procurados

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
 

Mais procurados (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
 

Destaque

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
 

Destaque (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)
 

Semelhante a 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
 

Semelhante a 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
 

Último

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationRidwan Fadjar
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticscarlostorres15106
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubKalema Edgar
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebUiPathCommunity
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024BookNet Canada
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Manik S Magar
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationSlibray Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Scott Keck-Warren
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxhariprasad279825
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii SoldatenkoFwdays
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfAlex Barbosa Coqueiro
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 3652toLead Limited
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfAddepto
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxNavinnSomaal
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clashcharlottematthew16
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):comworks
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brandgvaughan
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsMiki Katsuragi
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationSafe Software
 

Último (20)

My Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 PresentationMy Hashitalk Indonesia April 2024 Presentation
My Hashitalk Indonesia April 2024 Presentation
 
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptxE-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
E-Vehicle_Hacking_by_Parul Sharma_null_owasp.pptx
 
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmaticsKotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
Kotlin Multiplatform & Compose Multiplatform - Starter kit for pragmatics
 
Unleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding ClubUnleash Your Potential - Namagunga Girls Coding Club
Unleash Your Potential - Namagunga Girls Coding Club
 
Dev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio WebDev Dives: Streamline document processing with UiPath Studio Web
Dev Dives: Streamline document processing with UiPath Studio Web
 
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
Transcript: New from BookNet Canada for 2024: BNC CataList - Tech Forum 2024
 
Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!Anypoint Exchange: It’s Not Just a Repo!
Anypoint Exchange: It’s Not Just a Repo!
 
Connect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck PresentationConnect Wave/ connectwave Pitch Deck Presentation
Connect Wave/ connectwave Pitch Deck Presentation
 
Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024Advanced Test Driven-Development @ php[tek] 2024
Advanced Test Driven-Development @ php[tek] 2024
 
Artificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptxArtificial intelligence in cctv survelliance.pptx
Artificial intelligence in cctv survelliance.pptx
 
"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko"Debugging python applications inside k8s environment", Andrii Soldatenko
"Debugging python applications inside k8s environment", Andrii Soldatenko
 
Unraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdfUnraveling Multimodality with Large Language Models.pdf
Unraveling Multimodality with Large Language Models.pdf
 
Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365Ensuring Technical Readiness For Copilot in Microsoft 365
Ensuring Technical Readiness For Copilot in Microsoft 365
 
Gen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdfGen AI in Business - Global Trends Report 2024.pdf
Gen AI in Business - Global Trends Report 2024.pdf
 
SAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptxSAP Build Work Zone - Overview L2-L3.pptx
SAP Build Work Zone - Overview L2-L3.pptx
 
Powerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time ClashPowerpoint exploring the locations used in television show Time Clash
Powerpoint exploring the locations used in television show Time Clash
 
CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):CloudStudio User manual (basic edition):
CloudStudio User manual (basic edition):
 
WordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your BrandWordPress Websites for Engineers: Elevate Your Brand
WordPress Websites for Engineers: Elevate Your Brand
 
Vertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering TipsVertex AI Gemini Prompt Engineering Tips
Vertex AI Gemini Prompt Engineering Tips
 
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry InnovationBeyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
Beyond Boundaries: Leveraging No-Code Solutions for Industry Innovation
 

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