SlideShare a Scribd company logo
Automatic Test Generation for Space

       Ulisses Costa              Daniela da Cruz              Pedro Rangel Henriques

            SLATE’12 - Symposium on Languages, Applications and Technologies


                                             June 21, 2012




Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
Context


   Problem
   VST (Visionspace Technologies) provides services related to testing
   for ESA and wants to automate the test generation for the
   Operational Simulator platform.

   This presentation appears in the context of a master’s thesis that
   aims at:
           Generate automatically tests for the Operational Simulator
           Generate unit tests for the Operational Simulator language –
           C++
           Parametrize the size of the generated data structures and be
           able to configure other attributes



  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
Motivation




           Extract UML and OCL from the existing code
           Extract tests from the existing code




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
OCL Inference



   OCL is a language used to describe logic properties about UML
   models, typically in the form of invariants.
   The first step is to extract interesting invariants from the code and
   match them with requirements.
           Generate UML diagrams from the existing code (easy)
           Infer code invariants (hard)
           Relate the discovered invariants with the UML diagrams
           Relate the discovered diagrams with requirements




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
White vs. Black Box Testing




   Types of tests regarding the knowledge about the code
    White Box , there is knowledge about the code, and this
                 knowledge is used to perform the test generation.
       Black Box , there is only knowledge about the requirements and
                 about how each component should behave.




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
Approaches 1/2




   Specification-based Generation Testing , aka Model Based Testing
                consists in testing a program based on the program
                specification or on the program model. Test cases
                can be generated from the specification, without
                consider the code.




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
Approaches 2/2




   Constraint-based Generation Testing , can be used to select test
                cases that meet some variable restrictions. When
                combined with symbolic execution, gathers
                restrictions along the different paths in the CFG. It is
                possible to solve these restrictions and generate test
                cases.




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
Current state




   By now, we studied different approaches and tools, the more
   important to our goal are:
           Korat, is a mature framework to automatically construct
           complex structures for JAVA
           Pex is a White-box testing framework from Microsoft tool
           that tries to give total code coverage




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
Studied Tools - Pex


   1        public class Program {
   2          public static int BSearch ( int x , int n ) {
   3            return BinarySearch (x , 0 , n ) ;
   4          }
   5          static int BinarySearch ( int x , int lo , int hi ) {
   6            while ( lo < hi ) {
   7              int mid = ( lo + hi ) /2;
   8              Debug . Assert ( mid >= lo && mid < hi ) ;
   9              if ( x < mid ) { hi = mid ; } else { lo = mid +1; }
  10            }
  11            return lo ;
  12          }
  13        }

       Result         x             n           result       Output/Exception
                      0              0            0
                      0              1            1
                      0              3            1
                1073741888     1719676992                 TraceAssertionException
                      1              6            2
                     50             96           51




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques       Automatic Test Generation for Space
Studied Tools - Korat

   1     public class LinkedList T  {
   2       public static class LinkedListElement T  {
   3         public T Data ;
   4         public LinkedListElement T  Prev ;
   5         public LinkedListElement T  Next ;
   6       }
   7       private LinkedListElement T  Head ;
   8       private LinkedListElement T  Tail ;
   9       private int size ;
  10     }

   LinkedList class invariants (circular doubly linked list):
                                   ∀ l : l ∈ LinkedList : Head(l) ≡ null ∨ Tail(l) ≡ null ⇔ size(l) ≡ 0     (1)
                                                               ∀ l : l ∈ LinkedList : Tail(l).Next ≡ null   (2)
                                                              ∀ l : l ∈ LinkedList : Head(l).Prev ≡ null    (3)
                                                 ∀ l : l ∈ LinkedList : size(l) ≡ 1 ⇔ Head(l) ≡ Tail(l)     (4)
       ∀ l : l ∈ LinkedList : ∀ e1 , e2 : {e1 , e2 } ⊆ l : ∃ e : e ∈ l : e1 .Next ≡ e ∧ e2 .Prev ≡ e
                                                      ⊆             ∈                                       (5)
                           ∀ l : l ∈ LinkedList : ∀ e1 , e2 : {e1 , e2 } ⊆ l : e1 ≡ e2 ⇒ i(e1 ) ≡ i(e2 )
                                                                          ⊆                                 (6)




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques       Automatic Test Generation for Space
Studied Tools - Pex - LinkedList




                  (a) LinkedList instance                      (b) LinkedList instance
                  generated by Pex to test                     generated by Pex to test
                  the method Remove                            the method Find

    Figure: Examples of instances generated by Pex to the LinkedList class.



  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
Studied Tools - Korat - LinkedList




                         (a) LinkedList                           (b) LinkedList
                         instance with 2                          instance with 5
                         elements                                 elements



  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
Studied Tools - Summary




   Summary
   Pex uses static analysis and is very efficient in discovering all the
   possible execution paths in C# methods. Pex can also be used to
   generate classes testcases, but the generated instances does not
   keep the invariants of data structures.
   On the other hand, Korat is the ideal tool to generate data
   structures that meet the invariants.




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
Conclusion and Future work




           Pex has proved to be a powerful tool regarding full coverage.
           Korat is a very useful tool to generate complex data
           structures.
   A mix between the static analysis of Pex with Korat’s capability to
   generate useful data structures is the path we will follow.
   The study of pre- pos conditions inference using static analysis
   [Moy 2009] will be useful to infer OCL rules.




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space
Korat repOK method for LinkedList

   1     public boolean repOK () {
   2       if ( Head == null || Tail == null )
   3          return size == 0;
   4       if ( size == 1) return Head == Tail ;
   5       if ( Head . Prev != null ) return false ;
   6       if ( Tail . Next != null ) return false ;
   7       LinkedListElement T  last = Head ;
   8       Set visited = new HashSet () ;
   9       LinkedList workList = new LinkedList () ;
  10       visited . add ( Head ) ;
  11       workList . add ( Head ) ;
  12       while (! workList . isEmpty () ) {
  13          LinkedListElement T  current = ( LinkedListElement T ) workList .
                      removeFirst () ;
  14          if ( current . Next != null ) {
  15             if (! visited . add ( current . Next ) )
  16          return false ;
  17             workList . add ( current . Next ) ;
  18             if ( current . Next . Prev != current ) return false ;
  19             last = current . Next ;
  20          }
  21       }
  22       if ( last != Tail )
  23          return false ;
  24       return ( visited . size () == size ) ;
  25     }




  Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques   Automatic Test Generation for Space

More Related Content

What's hot

Scala eXchange opening
Scala eXchange openingScala eXchange opening
Scala eXchange opening
Martin Odersky
 
ScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin OderskyScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin Odersky
Typesafe
 
Elm talk bayhac2015
Elm talk bayhac2015Elm talk bayhac2015
Elm talk bayhac2015
Sergei Winitzki
 
Temporal logic and functional reactive programming
Temporal logic and functional reactive programmingTemporal logic and functional reactive programming
Temporal logic and functional reactive programming
Sergei Winitzki
 
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMEREVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
Andrey Karpov
 
Beauty and the beast - Haskell on JVM
Beauty and the beast  - Haskell on JVMBeauty and the beast  - Haskell on JVM
Beauty and the beast - Haskell on JVM
Jarek Ratajski
 
Eta
EtaEta
Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...
Chris Richardson
 
Locality-sensitive hashing for search in metric space
Locality-sensitive hashing for search in metric space Locality-sensitive hashing for search in metric space
Locality-sensitive hashing for search in metric space
Eliezer Silva
 
Mining Adaptively Frequent Closed Unlabeled Rooted Trees in Data Streams
Mining Adaptively Frequent Closed Unlabeled Rooted Trees in Data StreamsMining Adaptively Frequent Closed Unlabeled Rooted Trees in Data Streams
Mining Adaptively Frequent Closed Unlabeled Rooted Trees in Data Streams
Albert Bifet
 
A Signature Scheme as Secure as the Diffie Hellman Problem
A Signature Scheme as Secure as the Diffie Hellman ProblemA Signature Scheme as Secure as the Diffie Hellman Problem
A Signature Scheme as Secure as the Diffie Hellman Problem
vsubhashini
 
Sets, maps and hash tables (Java Collections)
Sets, maps and hash tables (Java Collections)Sets, maps and hash tables (Java Collections)
Sets, maps and hash tables (Java Collections)
Fulvio Corno
 

What's hot (12)

Scala eXchange opening
Scala eXchange openingScala eXchange opening
Scala eXchange opening
 
ScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin OderskyScalaDays 2013 Keynote Speech by Martin Odersky
ScalaDays 2013 Keynote Speech by Martin Odersky
 
Elm talk bayhac2015
Elm talk bayhac2015Elm talk bayhac2015
Elm talk bayhac2015
 
Temporal logic and functional reactive programming
Temporal logic and functional reactive programmingTemporal logic and functional reactive programming
Temporal logic and functional reactive programming
 
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMEREVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
EVERYTHING ABOUT STATIC CODE ANALYSIS FOR A JAVA PROGRAMMER
 
Beauty and the beast - Haskell on JVM
Beauty and the beast  - Haskell on JVMBeauty and the beast  - Haskell on JVM
Beauty and the beast - Haskell on JVM
 
Eta
EtaEta
Eta
 
Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...Polyglot persistence for Java developers - moving out of the relational comfo...
Polyglot persistence for Java developers - moving out of the relational comfo...
 
Locality-sensitive hashing for search in metric space
Locality-sensitive hashing for search in metric space Locality-sensitive hashing for search in metric space
Locality-sensitive hashing for search in metric space
 
Mining Adaptively Frequent Closed Unlabeled Rooted Trees in Data Streams
Mining Adaptively Frequent Closed Unlabeled Rooted Trees in Data StreamsMining Adaptively Frequent Closed Unlabeled Rooted Trees in Data Streams
Mining Adaptively Frequent Closed Unlabeled Rooted Trees in Data Streams
 
A Signature Scheme as Secure as the Diffie Hellman Problem
A Signature Scheme as Secure as the Diffie Hellman ProblemA Signature Scheme as Secure as the Diffie Hellman Problem
A Signature Scheme as Secure as the Diffie Hellman Problem
 
Sets, maps and hash tables (Java Collections)
Sets, maps and hash tables (Java Collections)Sets, maps and hash tables (Java Collections)
Sets, maps and hash tables (Java Collections)
 

Similar to Automatic Test Generation for Space

Relaxation methods for the matrix exponential on large networks
Relaxation methods for the matrix exponential on large networksRelaxation methods for the matrix exponential on large networks
Relaxation methods for the matrix exponential on large networks
David Gleich
 
A Distributed Architecture System for Recognizing Textual Entailment
A Distributed Architecture System for Recognizing Textual EntailmentA Distributed Architecture System for Recognizing Textual Entailment
A Distributed Architecture System for Recognizing Textual EntailmentFaculty of Computer Science
 
Deep Learning through Examples
Deep Learning through ExamplesDeep Learning through Examples
Deep Learning through Examples
Sri Ambati
 
H2O.ai's Distributed Deep Learning by Arno Candel 04/03/14
H2O.ai's Distributed Deep Learning by Arno Candel 04/03/14H2O.ai's Distributed Deep Learning by Arno Candel 04/03/14
H2O.ai's Distributed Deep Learning by Arno Candel 04/03/14
Sri Ambati
 
Dcn 20170823 yjy
Dcn 20170823 yjyDcn 20170823 yjy
Dcn 20170823 yjy
재연 윤
 
Lecture 5: Functional Programming
Lecture 5: Functional ProgrammingLecture 5: Functional Programming
Lecture 5: Functional ProgrammingEelco Visser
 
Log Analytics in Datacenter with Apache Spark and Machine Learning
Log Analytics in Datacenter with Apache Spark and Machine LearningLog Analytics in Datacenter with Apache Spark and Machine Learning
Log Analytics in Datacenter with Apache Spark and Machine Learning
Agnieszka Potulska
 
The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)
Pierre Schaus
 
Anti-differentiating Approximation Algorithms: PageRank and MinCut
Anti-differentiating Approximation Algorithms: PageRank and MinCutAnti-differentiating Approximation Algorithms: PageRank and MinCut
Anti-differentiating Approximation Algorithms: PageRank and MinCut
David Gleich
 
San Francisco Hadoop User Group Meetup Deep Learning
San Francisco Hadoop User Group Meetup Deep LearningSan Francisco Hadoop User Group Meetup Deep Learning
San Francisco Hadoop User Group Meetup Deep Learning
Sri Ambati
 
Language Technology Enhanced Learning
Language Technology Enhanced LearningLanguage Technology Enhanced Learning
Language Technology Enhanced Learning
telss09
 
H2O Distributed Deep Learning by Arno Candel 071614
H2O Distributed Deep Learning by Arno Candel 071614H2O Distributed Deep Learning by Arno Candel 071614
H2O Distributed Deep Learning by Arno Candel 071614
Sri Ambati
 
Introduction to conventional machine learning techniques
Introduction to conventional machine learning techniquesIntroduction to conventional machine learning techniques
Introduction to conventional machine learning techniques
Xavier Rafael Palou
 
Abductive commonsense reasoning
Abductive commonsense reasoningAbductive commonsense reasoning
Abductive commonsense reasoning
San Kim
 
Lambda? You Keep Using that Letter
Lambda? You Keep Using that LetterLambda? You Keep Using that Letter
Lambda? You Keep Using that Letter
Kevlin Henney
 
Class 22: Stateful Evaluation Rules
Class 22: Stateful Evaluation RulesClass 22: Stateful Evaluation Rules
Class 22: Stateful Evaluation Rules
David Evans
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled Datasets
Sung Kim
 
A package system for maintaining large model distributions in vle software
A package system for maintaining large model distributions in vle softwareA package system for maintaining large model distributions in vle software
A package system for maintaining large model distributions in vle software
Daniele Gianni
 
A preliminary study of diversity in ELM ensembles (HAIS 2018)
A preliminary study of diversity in ELM ensembles (HAIS 2018)A preliminary study of diversity in ELM ensembles (HAIS 2018)
A preliminary study of diversity in ELM ensembles (HAIS 2018)
Carlos Perales
 
Functional Programming You Already Know
Functional Programming You Already KnowFunctional Programming You Already Know
Functional Programming You Already Know
Kevlin Henney
 

Similar to Automatic Test Generation for Space (20)

Relaxation methods for the matrix exponential on large networks
Relaxation methods for the matrix exponential on large networksRelaxation methods for the matrix exponential on large networks
Relaxation methods for the matrix exponential on large networks
 
A Distributed Architecture System for Recognizing Textual Entailment
A Distributed Architecture System for Recognizing Textual EntailmentA Distributed Architecture System for Recognizing Textual Entailment
A Distributed Architecture System for Recognizing Textual Entailment
 
Deep Learning through Examples
Deep Learning through ExamplesDeep Learning through Examples
Deep Learning through Examples
 
H2O.ai's Distributed Deep Learning by Arno Candel 04/03/14
H2O.ai's Distributed Deep Learning by Arno Candel 04/03/14H2O.ai's Distributed Deep Learning by Arno Candel 04/03/14
H2O.ai's Distributed Deep Learning by Arno Candel 04/03/14
 
Dcn 20170823 yjy
Dcn 20170823 yjyDcn 20170823 yjy
Dcn 20170823 yjy
 
Lecture 5: Functional Programming
Lecture 5: Functional ProgrammingLecture 5: Functional Programming
Lecture 5: Functional Programming
 
Log Analytics in Datacenter with Apache Spark and Machine Learning
Log Analytics in Datacenter with Apache Spark and Machine LearningLog Analytics in Datacenter with Apache Spark and Machine Learning
Log Analytics in Datacenter with Apache Spark and Machine Learning
 
The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)The Concurrent Constraint Programming Research Programmes -- Redux (part2)
The Concurrent Constraint Programming Research Programmes -- Redux (part2)
 
Anti-differentiating Approximation Algorithms: PageRank and MinCut
Anti-differentiating Approximation Algorithms: PageRank and MinCutAnti-differentiating Approximation Algorithms: PageRank and MinCut
Anti-differentiating Approximation Algorithms: PageRank and MinCut
 
San Francisco Hadoop User Group Meetup Deep Learning
San Francisco Hadoop User Group Meetup Deep LearningSan Francisco Hadoop User Group Meetup Deep Learning
San Francisco Hadoop User Group Meetup Deep Learning
 
Language Technology Enhanced Learning
Language Technology Enhanced LearningLanguage Technology Enhanced Learning
Language Technology Enhanced Learning
 
H2O Distributed Deep Learning by Arno Candel 071614
H2O Distributed Deep Learning by Arno Candel 071614H2O Distributed Deep Learning by Arno Candel 071614
H2O Distributed Deep Learning by Arno Candel 071614
 
Introduction to conventional machine learning techniques
Introduction to conventional machine learning techniquesIntroduction to conventional machine learning techniques
Introduction to conventional machine learning techniques
 
Abductive commonsense reasoning
Abductive commonsense reasoningAbductive commonsense reasoning
Abductive commonsense reasoning
 
Lambda? You Keep Using that Letter
Lambda? You Keep Using that LetterLambda? You Keep Using that Letter
Lambda? You Keep Using that Letter
 
Class 22: Stateful Evaluation Rules
Class 22: Stateful Evaluation RulesClass 22: Stateful Evaluation Rules
Class 22: Stateful Evaluation Rules
 
Software Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled DatasetsSoftware Defect Prediction on Unlabeled Datasets
Software Defect Prediction on Unlabeled Datasets
 
A package system for maintaining large model distributions in vle software
A package system for maintaining large model distributions in vle softwareA package system for maintaining large model distributions in vle software
A package system for maintaining large model distributions in vle software
 
A preliminary study of diversity in ELM ensembles (HAIS 2018)
A preliminary study of diversity in ELM ensembles (HAIS 2018)A preliminary study of diversity in ELM ensembles (HAIS 2018)
A preliminary study of diversity in ELM ensembles (HAIS 2018)
 
Functional Programming You Already Know
Functional Programming You Already KnowFunctional Programming You Already Know
Functional Programming You Already Know
 

More from Ulisses Costa

Automatic Test Generation for Space
Automatic Test Generation for SpaceAutomatic Test Generation for Space
Automatic Test Generation for Space
Ulisses Costa
 
Static Code Analyzer - Part IV
Static Code Analyzer - Part IVStatic Code Analyzer - Part IV
Static Code Analyzer - Part IVUlisses Costa
 
Specifying and Implementing SNOW3G with Cryptol
Specifying and Implementing SNOW3G with CryptolSpecifying and Implementing SNOW3G with Cryptol
Specifying and Implementing SNOW3G with CryptolUlisses Costa
 
Static Code Analyzer - Part III
Static Code Analyzer - Part IIIStatic Code Analyzer - Part III
Static Code Analyzer - Part IIIUlisses Costa
 
Static Code Analyzer - Part II
Static Code Analyzer - Part IIStatic Code Analyzer - Part II
Static Code Analyzer - Part IIUlisses Costa
 
Static Code Analyzer - Part I
Static Code Analyzer - Part IStatic Code Analyzer - Part I
Static Code Analyzer - Part IUlisses Costa
 
logCesium01
logCesium01logCesium01
logCesium01
Ulisses Costa
 
Cesium Log ed2
Cesium Log ed2Cesium Log ed2
Cesium Log ed2
Ulisses Costa
 
GD::Graph - Graph Plotting Module
GD::Graph - Graph Plotting ModuleGD::Graph - Graph Plotting Module
GD::Graph - Graph Plotting ModuleUlisses Costa
 
Captura de Informação em Rede
Captura de Informação em RedeCaptura de Informação em Rede
Captura de Informação em RedeUlisses Costa
 
Cryptol experience
Cryptol experienceCryptol experience
Cryptol experience
Ulisses Costa
 
Correct sorting with Frama-C
Correct sorting with Frama-CCorrect sorting with Frama-C
Correct sorting with Frama-C
Ulisses Costa
 
The Cryptol Epilogue: Swift and Bulletproof VHDL
The Cryptol Epilogue: Swift and Bulletproof VHDLThe Cryptol Epilogue: Swift and Bulletproof VHDL
The Cryptol Epilogue: Swift and Bulletproof VHDL
Ulisses Costa
 
Splint the C code static checker
Splint the C code static checkerSplint the C code static checker
Splint the C code static checker
Ulisses Costa
 
Exploring the Cryptol Toolset
Exploring the Cryptol ToolsetExploring the Cryptol Toolset
Exploring the Cryptol Toolset
Ulisses Costa
 
Specification of SNOW 3G in Cryptol
Specification of SNOW 3G in CryptolSpecification of SNOW 3G in Cryptol
Specification of SNOW 3G in CryptolUlisses Costa
 
Snort - capturar e dissecar o tráfego da rede
Snort - capturar e dissecar o tráfego da redeSnort - capturar e dissecar o tráfego da rede
Snort - capturar e dissecar o tráfego da redeUlisses Costa
 
LDAP em VDM++
LDAP em VDM++LDAP em VDM++
LDAP em VDM++
Ulisses Costa
 
Uso de Honeypots com Honeyd
Uso de Honeypots com HoneydUso de Honeypots com Honeyd
Uso de Honeypots com Honeyd
Ulisses Costa
 

More from Ulisses Costa (20)

Automatic Test Generation for Space
Automatic Test Generation for SpaceAutomatic Test Generation for Space
Automatic Test Generation for Space
 
Static Code Analyzer - Part IV
Static Code Analyzer - Part IVStatic Code Analyzer - Part IV
Static Code Analyzer - Part IV
 
Specifying and Implementing SNOW3G with Cryptol
Specifying and Implementing SNOW3G with CryptolSpecifying and Implementing SNOW3G with Cryptol
Specifying and Implementing SNOW3G with Cryptol
 
Static Code Analyzer - Part III
Static Code Analyzer - Part IIIStatic Code Analyzer - Part III
Static Code Analyzer - Part III
 
Static Code Analyzer - Part II
Static Code Analyzer - Part IIStatic Code Analyzer - Part II
Static Code Analyzer - Part II
 
Static Code Analyzer - Part I
Static Code Analyzer - Part IStatic Code Analyzer - Part I
Static Code Analyzer - Part I
 
logCesium01
logCesium01logCesium01
logCesium01
 
Cesium Log ed2
Cesium Log ed2Cesium Log ed2
Cesium Log ed2
 
GD::Graph - Graph Plotting Module
GD::Graph - Graph Plotting ModuleGD::Graph - Graph Plotting Module
GD::Graph - Graph Plotting Module
 
Captura de Informação em Rede
Captura de Informação em RedeCaptura de Informação em Rede
Captura de Informação em Rede
 
Cryptol experience
Cryptol experienceCryptol experience
Cryptol experience
 
Correct sorting with Frama-C
Correct sorting with Frama-CCorrect sorting with Frama-C
Correct sorting with Frama-C
 
The Cryptol Epilogue: Swift and Bulletproof VHDL
The Cryptol Epilogue: Swift and Bulletproof VHDLThe Cryptol Epilogue: Swift and Bulletproof VHDL
The Cryptol Epilogue: Swift and Bulletproof VHDL
 
Splint the C code static checker
Splint the C code static checkerSplint the C code static checker
Splint the C code static checker
 
Exploring the Cryptol Toolset
Exploring the Cryptol ToolsetExploring the Cryptol Toolset
Exploring the Cryptol Toolset
 
Specification of SNOW 3G in Cryptol
Specification of SNOW 3G in CryptolSpecification of SNOW 3G in Cryptol
Specification of SNOW 3G in Cryptol
 
Snort - capturar e dissecar o tráfego da rede
Snort - capturar e dissecar o tráfego da redeSnort - capturar e dissecar o tráfego da rede
Snort - capturar e dissecar o tráfego da rede
 
LDAP em VDM++
LDAP em VDM++LDAP em VDM++
LDAP em VDM++
 
Uso de Honeypots com Honeyd
Uso de Honeypots com HoneydUso de Honeypots com Honeyd
Uso de Honeypots com Honeyd
 
Apresentacao JML
Apresentacao JMLApresentacao JML
Apresentacao JML
 

Recently uploaded

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
RinaMondal9
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
Uni Systems S.M.S.A.
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
ThomasParaiso2
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
Alex Pruden
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
名前 です男
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
Alan Dix
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
nkrafacyberclub
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
sonjaschweigert1
 

Recently uploaded (20)

Free Complete Python - A step towards Data Science
Free Complete Python - A step towards Data ScienceFree Complete Python - A step towards Data Science
Free Complete Python - A step towards Data Science
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Microsoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdfMicrosoft - Power Platform_G.Aspiotis.pdf
Microsoft - Power Platform_G.Aspiotis.pdf
 
GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...GridMate - End to end testing is a critical piece to ensure quality and avoid...
GridMate - End to end testing is a critical piece to ensure quality and avoid...
 
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex ProofszkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
zkStudyClub - Reef: Fast Succinct Non-Interactive Zero-Knowledge Regex Proofs
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
みなさんこんにちはこれ何文字まで入るの?40文字以下不可とか本当に意味わからないけどこれ限界文字数書いてないからマジでやばい文字数いけるんじゃないの?えこ...
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Epistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI supportEpistemic Interaction - tuning interfaces to provide information for AI support
Epistemic Interaction - tuning interfaces to provide information for AI support
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptxSecstrike : Reverse Engineering & Pwnable tools for CTF.pptx
Secstrike : Reverse Engineering & Pwnable tools for CTF.pptx
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...A tale of scale & speed: How the US Navy is enabling software delivery from l...
A tale of scale & speed: How the US Navy is enabling software delivery from l...
 

Automatic Test Generation for Space

  • 1. Automatic Test Generation for Space Ulisses Costa Daniela da Cruz Pedro Rangel Henriques SLATE’12 - Symposium on Languages, Applications and Technologies June 21, 2012 Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 2. Context Problem VST (Visionspace Technologies) provides services related to testing for ESA and wants to automate the test generation for the Operational Simulator platform. This presentation appears in the context of a master’s thesis that aims at: Generate automatically tests for the Operational Simulator Generate unit tests for the Operational Simulator language – C++ Parametrize the size of the generated data structures and be able to configure other attributes Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 3. Motivation Extract UML and OCL from the existing code Extract tests from the existing code Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 4. OCL Inference OCL is a language used to describe logic properties about UML models, typically in the form of invariants. The first step is to extract interesting invariants from the code and match them with requirements. Generate UML diagrams from the existing code (easy) Infer code invariants (hard) Relate the discovered invariants with the UML diagrams Relate the discovered diagrams with requirements Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 5. White vs. Black Box Testing Types of tests regarding the knowledge about the code White Box , there is knowledge about the code, and this knowledge is used to perform the test generation. Black Box , there is only knowledge about the requirements and about how each component should behave. Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 6. Approaches 1/2 Specification-based Generation Testing , aka Model Based Testing consists in testing a program based on the program specification or on the program model. Test cases can be generated from the specification, without consider the code. Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 7. Approaches 2/2 Constraint-based Generation Testing , can be used to select test cases that meet some variable restrictions. When combined with symbolic execution, gathers restrictions along the different paths in the CFG. It is possible to solve these restrictions and generate test cases. Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 8. Current state By now, we studied different approaches and tools, the more important to our goal are: Korat, is a mature framework to automatically construct complex structures for JAVA Pex is a White-box testing framework from Microsoft tool that tries to give total code coverage Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 9. Studied Tools - Pex 1 public class Program { 2 public static int BSearch ( int x , int n ) { 3 return BinarySearch (x , 0 , n ) ; 4 } 5 static int BinarySearch ( int x , int lo , int hi ) { 6 while ( lo < hi ) { 7 int mid = ( lo + hi ) /2; 8 Debug . Assert ( mid >= lo && mid < hi ) ; 9 if ( x < mid ) { hi = mid ; } else { lo = mid +1; } 10 } 11 return lo ; 12 } 13 } Result x n result Output/Exception 0 0 0 0 1 1 0 3 1 1073741888 1719676992 TraceAssertionException 1 6 2 50 96 51 Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 10. Studied Tools - Korat 1 public class LinkedList T { 2 public static class LinkedListElement T { 3 public T Data ; 4 public LinkedListElement T Prev ; 5 public LinkedListElement T Next ; 6 } 7 private LinkedListElement T Head ; 8 private LinkedListElement T Tail ; 9 private int size ; 10 } LinkedList class invariants (circular doubly linked list): ∀ l : l ∈ LinkedList : Head(l) ≡ null ∨ Tail(l) ≡ null ⇔ size(l) ≡ 0 (1) ∀ l : l ∈ LinkedList : Tail(l).Next ≡ null (2) ∀ l : l ∈ LinkedList : Head(l).Prev ≡ null (3) ∀ l : l ∈ LinkedList : size(l) ≡ 1 ⇔ Head(l) ≡ Tail(l) (4) ∀ l : l ∈ LinkedList : ∀ e1 , e2 : {e1 , e2 } ⊆ l : ∃ e : e ∈ l : e1 .Next ≡ e ∧ e2 .Prev ≡ e ⊆ ∈ (5) ∀ l : l ∈ LinkedList : ∀ e1 , e2 : {e1 , e2 } ⊆ l : e1 ≡ e2 ⇒ i(e1 ) ≡ i(e2 ) ⊆ (6) Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 11. Studied Tools - Pex - LinkedList (a) LinkedList instance (b) LinkedList instance generated by Pex to test generated by Pex to test the method Remove the method Find Figure: Examples of instances generated by Pex to the LinkedList class. Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 12. Studied Tools - Korat - LinkedList (a) LinkedList (b) LinkedList instance with 2 instance with 5 elements elements Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 13. Studied Tools - Summary Summary Pex uses static analysis and is very efficient in discovering all the possible execution paths in C# methods. Pex can also be used to generate classes testcases, but the generated instances does not keep the invariants of data structures. On the other hand, Korat is the ideal tool to generate data structures that meet the invariants. Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 14. Conclusion and Future work Pex has proved to be a powerful tool regarding full coverage. Korat is a very useful tool to generate complex data structures. A mix between the static analysis of Pex with Korat’s capability to generate useful data structures is the path we will follow. The study of pre- pos conditions inference using static analysis [Moy 2009] will be useful to infer OCL rules. Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space
  • 15. Korat repOK method for LinkedList 1 public boolean repOK () { 2 if ( Head == null || Tail == null ) 3 return size == 0; 4 if ( size == 1) return Head == Tail ; 5 if ( Head . Prev != null ) return false ; 6 if ( Tail . Next != null ) return false ; 7 LinkedListElement T last = Head ; 8 Set visited = new HashSet () ; 9 LinkedList workList = new LinkedList () ; 10 visited . add ( Head ) ; 11 workList . add ( Head ) ; 12 while (! workList . isEmpty () ) { 13 LinkedListElement T current = ( LinkedListElement T ) workList . removeFirst () ; 14 if ( current . Next != null ) { 15 if (! visited . add ( current . Next ) ) 16 return false ; 17 workList . add ( current . Next ) ; 18 if ( current . Next . Prev != current ) return false ; 19 last = current . Next ; 20 } 21 } 22 if ( last != Tail ) 23 return false ; 24 return ( visited . size () == size ) ; 25 } Ulisses Costa, Daniela da Cruz, Pedro Rangel Henriques Automatic Test Generation for Space