SlideShare a Scribd company logo
1 of 24
Download to read offline
PROJECT FOX
A TOOL THAT OFFERS AUTOMATED TESTING USING A FORMAL
APPROACH




Ivo Neskovic
CITY College Thessaloniki, an International Faculty of the University of Sheffield
462
AGENDA

> SOFTWARE ENGINEERING: WHAT COULD GO WRONG?
> FORMAL METHODS
> PROJECT FOX
> CASE STUDY: THE BUFFER SYSTEM
> CONCLUSIONS AND FUTURE WORK
> BIBLIOGRAPHY




                                               2
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.




                                                                            3
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

                                                                             4
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.




                                                                                  5
INCORPORATING FORMAL METHODS IN THE
DEVELOPMENT CYCLE




                                      6
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.




                                                                                   7
USING PROJECT FOX
> Two artefacts necessary:
  – Formal specification of the
     system.
  – The system's implementation.




                                   8
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 an item is removed first.




                                            9
BUFFER CASE STUDY – FORMAL
SPECIFICATION
> Modeled as a Generalized State
  Machine (stream X-Machine).
> A theoretical model of computing,
  pioneered by Samuel Eilenberg in
  1974 (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 modeled
  as an infinite memory.
> Able to model both static (data) and
  dynamic (control) parts of a system.
                                            10
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 >


                                                                11
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 >


                                                                       12
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 >                                                            13
BUFFER CASE STUDY – FORMAL
SPECIFICATION (cont.)
> Supports adding and removing items.
< functions >
    < function name = " add_part " >
        < guard >
            !buffer. contains ( part ) && buffer . size () + 1 < capacity . value ()
        </ guard >
        < body > buffer . add ( part ) ; </ body >
        < output > Part Added </ output >
    </ function >
    ...
</ functions >
< transitions >
    < transition >
        < startingState > empty </ startingState >
        < appliedFunction > add_part </ appliedFunction >
        < endingState > non_empty </ endingState >
    </ transition >
    ...
                                                                                       14
</ transitions>
BUFFER CASE STUDY – IMPLEMENTATION
public class ItemType {


    private String type;


    public ItemType(String type) {
        this.type = type;
    }
}


public class BufferObject {
    private int itemId;
    private ItemType type;


    public BufferObject(int itemId, ItemType type) {
        this.itemId = itemId;
        this.type = type;
    }
                                                       15
}
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)",
    "integer: 20, ItemType: (string:Dragon)",
    "integer: 17, ItemType: (string:Planeswalker)",
    "integer: 187, ItemType: (string:Nekrataal)",
    "integer: 23, ItemType: (string:Michael Jordan)"
})
                                                                          16
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;
}
                                                                                17
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");
    }
}
                                                                           18
BUFFER CASE STUDY – EXECUTING FOX




                                    19
BUFFER CASE STUDY – EXECUTING FOX
(implanted error)
if (!buffer.contains(part) && buffer.size() + 1 <   
        capacity) {
    buffer.add(part);
    capacity++;
    reportOutcome("Part Added");
}




                                                       20
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=”1”>
        <input>[ itemId: 187 type: Nekrataal ]</input>
        <expectedOutput>[ Part Added ]</expectedOutput>
        <output>[ Part Added ]</output>
    </test>
    <test testID=”2”>
        <input>[ itemId: 17 type: Planeswalker, itemId: 20 type: Dragon]</input>
        <expectedOutput>
            [ Part Added, Part Added – Become Full ]
        </expectedOutput>
        <output>[ Part Added, Part Added – Become Full ]</output>
    </test>
</tests>
                                                                                21
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.
> Nest 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).
                                                                                       22
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.
                                                                                    23
Ivo Neskovic   http://twitter.com/trumpets
CITY College   ivo.neskovic@gmail.com

More Related Content

What's hot

System verilog control flow
System verilog control flowSystem verilog control flow
System verilog control flowPushpa Yakkala
 
Fu agile#2 unit_testing
Fu agile#2 unit_testingFu agile#2 unit_testing
Fu agile#2 unit_testingNguyen Anh
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummaryAmal Khailtash
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomizationNirav Desai
 
A techis guide to combating bugs & poor performance in production
A techis guide to combating bugs & poor performance in productionA techis guide to combating bugs & poor performance in production
A techis guide to combating bugs & poor performance in productionTarun Arora
 
System Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSystem Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSubash John
 
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
 
SystemVerilog Assertions verification with SVAUnit - DVCon US 2016 Tutorial
SystemVerilog Assertions verification with SVAUnit - DVCon US 2016 TutorialSystemVerilog Assertions verification with SVAUnit - DVCon US 2016 Tutorial
SystemVerilog Assertions verification with SVAUnit - DVCon US 2016 TutorialAmiq Consulting
 
Abap function module help
Abap function module helpAbap function module help
Abap function module helpKranthi Kumar
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statementsapdocs. info
 
An integrated approach for designing and testing specific processors
An integrated approach for designing and testing specific processorsAn integrated approach for designing and testing specific processors
An integrated approach for designing and testing specific processorsVLSICS Design
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test frameworkAbner Chih Yi Huang
 
In search of JavaScript code quality: unit testing
In search of JavaScript code quality: unit testingIn search of JavaScript code quality: unit testing
In search of JavaScript code quality: unit testingAnna Khabibullina
 
Uvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academyUvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academyRaghavendra Kamath
 
Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4JAMK
 

What's hot (20)

System verilog control flow
System verilog control flowSystem verilog control flow
System verilog control flow
 
Fu agile#2 unit_testing
Fu agile#2 unit_testingFu agile#2 unit_testing
Fu agile#2 unit_testing
 
SystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features SummarySystemVerilog OOP Ovm Features Summary
SystemVerilog OOP Ovm Features Summary
 
Session 6 sv_randomization
Session 6 sv_randomizationSession 6 sv_randomization
Session 6 sv_randomization
 
A techis guide to combating bugs & poor performance in production
A techis guide to combating bugs & poor performance in productionA techis guide to combating bugs & poor performance in production
A techis guide to combating bugs & poor performance in production
 
System Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancementsSystem Verilog 2009 & 2012 enhancements
System Verilog 2009 & 2012 enhancements
 
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)
 
SystemVerilog Assertions verification with SVAUnit - DVCon US 2016 Tutorial
SystemVerilog Assertions verification with SVAUnit - DVCon US 2016 TutorialSystemVerilog Assertions verification with SVAUnit - DVCon US 2016 Tutorial
SystemVerilog Assertions verification with SVAUnit - DVCon US 2016 Tutorial
 
Abap function module help
Abap function module helpAbap function module help
Abap function module help
 
Modularization & Catch Statement
Modularization & Catch StatementModularization & Catch Statement
Modularization & Catch Statement
 
Good Practices On Test Automation
Good Practices On Test AutomationGood Practices On Test Automation
Good Practices On Test Automation
 
Ch 6 randomization
Ch 6 randomizationCh 6 randomization
Ch 6 randomization
 
An integrated approach for designing and testing specific processors
An integrated approach for designing and testing specific processorsAn integrated approach for designing and testing specific processors
An integrated approach for designing and testing specific processors
 
Trabajo
TrabajoTrabajo
Trabajo
 
Junit 4.0
Junit 4.0Junit 4.0
Junit 4.0
 
An introduction to Google test framework
An introduction to Google test frameworkAn introduction to Google test framework
An introduction to Google test framework
 
In search of JavaScript code quality: unit testing
In search of JavaScript code quality: unit testingIn search of JavaScript code quality: unit testing
In search of JavaScript code quality: unit testing
 
Uvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academyUvm cookbook-systemverilog-guidelines-verification-academy
Uvm cookbook-systemverilog-guidelines-verification-academy
 
Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4Unit testingandcontinousintegrationfreenest1dot4
Unit testingandcontinousintegrationfreenest1dot4
 
Jonathan bromley doulos
Jonathan bromley doulosJonathan bromley doulos
Jonathan bromley doulos
 

Viewers also liked

Autonomic Computing: Vision or Reality
Autonomic Computing: Vision or RealityAutonomic Computing: Vision or Reality
Autonomic Computing: Vision or RealityIvo Neskovic
 
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
 
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
 
2011 p5-math-sa1-mgs
2011 p5-math-sa1-mgs2011 p5-math-sa1-mgs
2011 p5-math-sa1-mgsAnna Lee
 
Russian revolutions 2014 (wiki)
Russian revolutions 2014 (wiki)Russian revolutions 2014 (wiki)
Russian revolutions 2014 (wiki)Lauren Rivard
 

Viewers also liked (8)

Autonomic Computing: Vision or Reality
Autonomic Computing: Vision or RealityAutonomic Computing: Vision or Reality
Autonomic Computing: Vision or Reality
 
Web 2.0 tools Isabella Craig
Web 2.0 tools Isabella CraigWeb 2.0 tools Isabella Craig
Web 2.0 tools Isabella Craig
 
El docente de hoy
El docente de hoyEl docente de hoy
El docente de hoy
 
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
 
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
 
2011 p5-math-sa1-mgs
2011 p5-math-sa1-mgs2011 p5-math-sa1-mgs
2011 p5-math-sa1-mgs
 
Russian revolutions 2014 (wiki)
Russian revolutions 2014 (wiki)Russian revolutions 2014 (wiki)
Russian revolutions 2014 (wiki)
 

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

Testware Hierarchy for Test Automation
Testware Hierarchy for Test AutomationTestware Hierarchy for Test Automation
Testware Hierarchy for Test AutomationGregory Solovey
 
Lecture (Software Testing).pptx
Lecture (Software Testing).pptxLecture (Software Testing).pptx
Lecture (Software Testing).pptxskknowledge
 
Oh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to MutationOh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to MutationPaul Blundell
 
Software Development Life Cycle Testingtypes
Software Development Life Cycle TestingtypesSoftware Development Life Cycle Testingtypes
Software Development Life Cycle Testingtypesvladimir zaremba
 
Android Unit Test
Android Unit TestAndroid Unit Test
Android Unit TestPhuoc Bui
 
[xp2013] Narrow Down What to Test
[xp2013] Narrow Down What to Test[xp2013] Narrow Down What to Test
[xp2013] Narrow Down What to TestZsolt Fabok
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profilerIhor Bobak
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG Greg.Helton
 
Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...
Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...
Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...MITRE ATT&CK
 
Coldbox developer training – session 4
Coldbox developer training – session 4Coldbox developer training – session 4
Coldbox developer training – session 4Billie Berzinskas
 
Terraform Modules Restructured
Terraform Modules RestructuredTerraform Modules Restructured
Terraform Modules RestructuredDoiT International
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructuredAmi Mahloof
 
Supporting Change in Product Lines within the Context of Use Case-driven Deve...
Supporting Change in Product Lines within the Context of Use Case-driven Deve...Supporting Change in Product Lines within the Context of Use Case-driven Deve...
Supporting Change in Product Lines within the Context of Use Case-driven Deve...Lionel Briand
 
Testing the frontend
Testing the frontendTesting the frontend
Testing the frontendHeiko Hardt
 

Similar to Project FoX: A Tool That Offers Automated Testing Using a Formal Approach (20)

Testware Hierarchy for Test Automation
Testware Hierarchy for Test AutomationTestware Hierarchy for Test Automation
Testware Hierarchy for Test Automation
 
Gallio Crafting A Toolchain
Gallio Crafting A ToolchainGallio Crafting A Toolchain
Gallio Crafting A Toolchain
 
Lecture (Software Testing).pptx
Lecture (Software Testing).pptxLecture (Software Testing).pptx
Lecture (Software Testing).pptx
 
Oh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to MutationOh so you test? - A guide to testing on Android from Unit to Mutation
Oh so you test? - A guide to testing on Android from Unit to Mutation
 
Software Development Life Cycle Testingtypes
Software Development Life Cycle TestingtypesSoftware Development Life Cycle Testingtypes
Software Development Life Cycle Testingtypes
 
Android Unit Test
Android Unit TestAndroid Unit Test
Android Unit Test
 
[xp2013] Narrow Down What to Test
[xp2013] Narrow Down What to Test[xp2013] Narrow Down What to Test
[xp2013] Narrow Down What to Test
 
Hadoop cluster performance profiler
Hadoop cluster performance profilerHadoop cluster performance profiler
Hadoop cluster performance profiler
 
RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG RPG Program for Unit Testing RPG
RPG Program for Unit Testing RPG
 
Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...
Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...
Detection as Code, Automation, and Testing: The Key to Unlocking the Power of...
 
Junit_.pptx
Junit_.pptxJunit_.pptx
Junit_.pptx
 
Unit tests and TDD
Unit tests and TDDUnit tests and TDD
Unit tests and TDD
 
Coldbox developer training – session 4
Coldbox developer training – session 4Coldbox developer training – session 4
Coldbox developer training – session 4
 
Terraform Modules Restructured
Terraform Modules RestructuredTerraform Modules Restructured
Terraform Modules Restructured
 
Terraform modules restructured
Terraform modules restructuredTerraform modules restructured
Terraform modules restructured
 
Beyond Unit Testing
Beyond Unit TestingBeyond Unit Testing
Beyond Unit Testing
 
Supporting Change in Product Lines within the Context of Use Case-driven Deve...
Supporting Change in Product Lines within the Context of Use Case-driven Deve...Supporting Change in Product Lines within the Context of Use Case-driven Deve...
Supporting Change in Product Lines within the Context of Use Case-driven Deve...
 
Modern Python Testing
Modern Python TestingModern Python Testing
Modern Python Testing
 
Testing the frontend
Testing the frontendTesting the frontend
Testing the frontend
 
UPC Testing talk 2
UPC Testing talk 2UPC Testing talk 2
UPC Testing talk 2
 

Recently uploaded

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
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdfhans926745
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationMichael W. Hawkins
 
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
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfEnterprise Knowledge
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEarley Information Science
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Paola De la Torre
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Allon Mureinik
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountPuma Security, LLC
 
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
 
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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxKatpro Technologies
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure servicePooja Nehwal
 
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
 
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
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsEnterprise Knowledge
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking MenDelhi Call girls
 

Recently uploaded (20)

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
 
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
 
[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf[2024]Digital Global Overview Report 2024 Meltwater.pdf
[2024]Digital Global Overview Report 2024 Meltwater.pdf
 
GenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day PresentationGenCyber Cyber Security Day Presentation
GenCyber Cyber Security Day Presentation
 
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
 
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
 
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdfThe Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
The Role of Taxonomy and Ontology in Semantic Layers - Heather Hedden.pdf
 
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
 
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptxEIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
EIS-Webinar-Prompt-Knowledge-Eng-2024-04-08.pptx
 
Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101Salesforce Community Group Quito, Salesforce 101
Salesforce Community Group Quito, Salesforce 101
 
Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)Injustice - Developers Among Us (SciFiDevCon 2024)
Injustice - Developers Among Us (SciFiDevCon 2024)
 
Breaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path MountBreaking the Kubernetes Kill Chain: Host Path Mount
Breaking the Kubernetes Kill Chain: Host Path Mount
 
A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 2024)A Domino Admins Adventures (Engage 2024)
A Domino Admins Adventures (Engage 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
 
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptxFactors to Consider When Choosing Accounts Payable Services Providers.pptx
Factors to Consider When Choosing Accounts Payable Services Providers.pptx
 
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure serviceWhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
WhatsApp 9892124323 ✓Call Girls In Kalyan ( Mumbai ) secure service
 
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...
 
Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024Finology Group – Insurtech Innovation Award 2024
Finology Group – Insurtech Innovation Award 2024
 
IAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI SolutionsIAC 2024 - IA Fast Track to Search Focused AI Solutions
IAC 2024 - IA Fast Track to Search Focused AI Solutions
 
08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men08448380779 Call Girls In Civil Lines Women Seeking Men
08448380779 Call Girls In Civil Lines Women Seeking Men
 

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 CITY College Thessaloniki, an International Faculty of the University of Sheffield 462
  • 2. AGENDA > SOFTWARE ENGINEERING: WHAT COULD GO WRONG? > FORMAL METHODS > PROJECT FOX > CASE STUDY: THE BUFFER SYSTEM > CONCLUSIONS AND FUTURE WORK > BIBLIOGRAPHY 2
  • 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. 3
  • 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 4
  • 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. 5
  • 6. INCORPORATING FORMAL METHODS IN THE DEVELOPMENT CYCLE 6
  • 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. 7
  • 8. USING PROJECT FOX > Two artefacts necessary: – Formal specification of the system. – The system's implementation. 8
  • 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 an item is removed first. 9
  • 10. BUFFER CASE STUDY – FORMAL SPECIFICATION > Modeled as a Generalized State Machine (stream X-Machine). > A theoretical model of computing, pioneered by Samuel Eilenberg in 1974 (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 modeled as an infinite memory. > Able to model both static (data) and dynamic (control) parts of a system. 10
  • 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 > 11
  • 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 > 12
  • 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 > 13
  • 14. BUFFER CASE STUDY – FORMAL SPECIFICATION (cont.) > Supports adding and removing items. < functions >     < function name = " add_part " >         < guard >             !buffer. contains ( part ) && buffer . size () + 1 < capacity . value ()         </ guard >         < body > buffer . add ( part ) ; </ body >         < output > Part Added </ output >     </ function >     ... </ functions > < transitions >     < transition >         < startingState > empty </ startingState >         < appliedFunction > add_part </ appliedFunction >         < endingState > non_empty </ endingState >     </ transition >     ... 14 </ transitions>
  • 15. BUFFER CASE STUDY – IMPLEMENTATION public class ItemType {     private String type;     public ItemType(String type) {         this.type = type;     } } public class BufferObject {     private int itemId;     private ItemType type;     public BufferObject(int itemId, ItemType type) {         this.itemId = itemId;         this.type = type;     } 15 }
  • 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)",     "integer: 20, ItemType: (string:Dragon)",     "integer: 17, ItemType: (string:Planeswalker)",     "integer: 187, ItemType: (string:Nekrataal)",     "integer: 23, ItemType: (string:Michael Jordan)" }) 16 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; } 17
  • 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");     } } 18
  • 19. BUFFER CASE STUDY – EXECUTING FOX 19
  • 20. BUFFER CASE STUDY – EXECUTING FOX (implanted error) if (!buffer.contains(part) && buffer.size() + 1 <            capacity) {     buffer.add(part);     capacity++;     reportOutcome("Part Added"); } 20
  • 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=”1”>         <input>[ itemId: 187 type: Nekrataal ]</input>         <expectedOutput>[ Part Added ]</expectedOutput>         <output>[ Part Added ]</output>     </test>     <test testID=”2”>         <input>[ itemId: 17 type: Planeswalker, itemId: 20 type: Dragon]</input>         <expectedOutput>             [ Part Added, Part Added – Become Full ]         </expectedOutput>         <output>[ Part Added, Part Added – Become Full ]</output>     </test> </tests> 21
  • 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. > Nest 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). 22
  • 23. 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. 23
  • 24. Ivo Neskovic http://twitter.com/trumpets CITY College ivo.neskovic@gmail.com