ISP RAS Java Specification Extension for Automated Test Development Igor B. Bourdonov, Alexei V. Demakov, Andrei A. Jarov, Alexander S. Kossatchev, Victor.

Slides:



Advertisements
Similar presentations
Chapter 13 Abstraction and inheritance. This chapter discusses n Implementing abstraction. u extension u inheritance n Polymorphism/dynamic binding. n.
Advertisements

Semantics Static semantics Dynamic semantics attribute grammars
Model Based Testing in Linux Standard Base Compliance Program A.V.Khoroshilov, A.K.Petrenko { khoroshilov, petrenko ispras.ru MBT Users Conference.
Multi-Paradigm Models as Source for Automatic Test Construction Victor Kuliamin ISP RAS, Moscow.
Theory and Practice of Co-verification Process: UniTesK Story RedVerst group of ISP RAS Alexander K. Petrenko Victor V. Kuliamin
Karolina Muszyńska Based on:
ISBN Chapter 3 Describing Syntax and Semantics.
Automated creation of verification models for C-programs Yury Yusupov Saint-Petersburg State Polytechnic University The Second Spring Young Researchers.
How Can Simple Model Test Complex System Model Based Testing of Large-Scale Software Victor Kuliamin ISP RAS, Moscow.
Testing AJAX functionality with UniTESK Yevgeny Gerlits, a postgraduate student from Lomonosov Moscow State University SYRCoSE 2010.
CSE 331 SOFTWARE DESIGN & IMPLEMENTATION TESTING II Autumn 2011.
1 Specifying Object Interfaces. 2 Major tasks in this stage: --are there any missing attributes or operations? --how can we reduce coupling, make interface.
Static and Dynamic Contract Verifiers For Java Hongming Liu.
Software Engineering, COMP201 Slide 1 Protocol Engineering Protocol Specification using CFSM model Lecture 30.
Feb. 23, 2004CS WPI1 CS 509 Design of Software Systems Lecture #5 Monday, Feb. 23, 2004.
Describing Syntax and Semantics
1 Scenario-based Analysis of UML Design Class Models Lijun Yu October 4th, 2010 Oslo, Norway.
Introduction to Software Design Chapter 1. Chapter 1: Introduction to Software Design2 Chapter Objectives To become familiar with the software challenge.
Formal Methods in Industrial Software Standards Enforcement A. Grinevich, A. Khoroshilov V. Kuliamin, D. Markovtsev A. Petrenko, V. Rubanov ISP RAS, Moscow,
A Survey of Software Refactoring Tom Mens, Tom Tourwé
TEST SUITE DEVELOPMENT FOR CONFORMANCE TESTING OF PROTOCOLS Anastasia Tugaenko Scientific Adviser: Nikolay Pakulin, PhD Institute for System Programming.
Object-Oriented Software Testing. C-S 5462 Object-Oriented Software Testing Research confirms that testing methods proposed for procedural approach are.
INRIA Sophia-Antipolis, Oasis team INRIA Rhône-Alpes, Vasy team Feria–IRIT/LAAS, SVF team Toulouse GET - ENST Paris, LTCI team FIACRE Models and Tools.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Theory and Practice of Co-verification Process: UniTesK Story RedVerst group of ISP RAS Alexander K. Petrenko
Automated Generation of Test Suites from Formal Specifications Alexander K.Petrenko Institute for System Programming of Russian Academy of Sciences (ISP.
Intel Academic Forum. Budapest, September, 2002 ISPRAS Experience in Model Based Testing Alexander K. Petrenko, Institute for System Programming.
Software Verification Academician V.P.Ivannikov, Director of ISPRAS Moscow, November 2008.
Chapter 7 Stacks. © 2004 Pearson Addison-Wesley. All rights reserved 7-2 The Abstract Data Type: Developing an ADT During the Design of a Solution Specifications.
Tammy Dahlgren with Tom Epperly, Scott Kohn, and Gary Kumfert Center for Applied Scientific Computing Common Component Architecture Working Group October.
Software Engineering Research paper presentation Ali Ahmad Formal Approaches to Software Testing Hierarchal GUI Test Case Generation Using Automated Planning.
Theory and Practice of Co-verification Process: UniTesK Story RedVerst group of ISP RAS Alexander K. Petrenko
1 Levi Lúcio © A Test Selection Language for CO-OPN Specifications Levi Lúcio, Luis Pedro and Didier Buchs University of Geneva.
111 Protocols CS 4311 Wirfs Brock et al., Designing Object-Oriented Software, Prentice Hall, (Chapter 8) Meyer, B., Applying design by contract,
ISBN Chapter 3 Describing Semantics -Attribute Grammars -Dynamic Semantics.
Introduction CS 3358 Data Structures. What is Computer Science? Computer Science is the study of algorithms, including their  Formal and mathematical.
Data Structures Using Java1 Chapter 7 Queues. Data Structures Using Java2 Chapter Objectives Learn about queues Examine various queue operations Learn.
Applying Model Based Testing in Different Contexts Alexander Petrenko Victor Kuliamin ISP RAS, Moscow.
CSC 480 Software Engineering Design by Contract. Detail Design Road Map Begin with architectural models  Class model: domain classes  Overall state.
Chapter 3 Part II Describing Syntax and Semantics.
1 CSCD 326 Data Structures I Software Design. 2 The Software Life Cycle 1. Specification 2. Design 3. Risk Analysis 4. Verification 5. Coding 6. Testing.
Using Cycle-Accurate Contract Specifications for Testing Hardware Models Alexander Kamkin Institute for System Programming of RAS
Software Engineering 2 -Prakash Shrestha.
Protocols Software Engineering II Wirfs Brock et al, Designing Object-Oriented Software, Prentice Hall, Mitchell, R., and McKim, Design by Contract,
UniTesK: Model Based Testing in Industrial Practice Victor Kuliamin Alexander Petrenko Alexander Kossatchev Igor Burdonov Institute for System Programming.
Testing OO software. State Based Testing State machine: implementation-independent specification (model) of the dynamic behaviour of the system State:
Extension of Interface Signature Descriptions for Automatic Test Generation Evgeny Chernov Institute for System Programming of RAS SYRCoSE 2008.
UniTesK Test Suite Architecture Igor Bourdonov Alexander Kossatchev Victor Kuliamin Alexander Petrenko.
CPSC 871 John D. McGregor Module 8 Session 1 Testing.
PROGRAMMING TESTING B MODULE 2: SOFTWARE SYSTEMS 22 NOVEMBER 2013.
1 Contractual Consistency Between BON Static and Dynamic Diagrams Ali Taleghani July 30, 2004.
Andrey Karaulov, Alexander Strabykin Institute for System Programming Russian Academy of Sciences SYRCoSE: Spring Young Researchers Colloquium on Software.
Requirement Engineering with URN: Integrating Goals and Scenarios Jean-François Roy Thesis Defense February 16, 2007.
UniTesK Test Suite Architecture Igor Bourdonov Alexander Kossatchev Victor Kuliamin Alexander Petrenko.
CSC3315 (Spring 2009)1 CSC 3315 Languages & Compilers Hamid Harroud School of Science and Engineering, Akhawayn University
Whole Test Suite Generation. Abstract Not all bugs lead to program crashes, and not always is there a formal specification to check the correctness of.
Interpreting the Object Constraint Presented by: Ed Kausmeyer.
Object Design More Design Patterns Object Constraint Language Object Design Specifying Interfaces Review Exam 2 CEN 4010 Class 18 – 11/03.
Study 1 Purpose of the tool. Test architecture.. Testing Target system Test system Testing results results affecting.
 Description of Inheritance  Base Class Object  Subclass, Subtype, and Substitutability  Forms of Inheritance  Modifiers and Inheritance  The Benefits.
Study 1 Purpose of the tool. Test architecture.. Testing Target system Test system Testing results results affecting.
Automated Object’s Statechart Generation and Testing from Class-Method Contracts Atul Gupta PhD Scholar, IIT Kapur, India.
Modern Programming Tools And Techniques-I
Design by Contract Jim Fawcett CSE784 – Software Studio
Design by Contract Jim Fawcett CSE784 – Software Studio
Arab Open University 2nd Semester, M301 Unit 5
Model-Driven Analysis Frameworks for Embedded Systems
Specifying Object Interfaces
V. Kuliamin, A. Petrenko, N.!Pakoulin, I.!Bourdonov, A.!Kossatchev
UNIT-II CHAPTER-4 SOFTWARE REQUIREMENT DEFINITION
Presentation transcript:

ISP RAS Java Specification Extension for Automated Test Development Igor B. Bourdonov, Alexei V. Demakov, Andrei A. Jarov, Alexander S. Kossatchev, Victor V. Kuliamin, Alexander K. Petrenko, Sergei V. Zelenov

Victor Kuliamin ISP RAS 2 Design Goals To preserve and to extend the techniques developed in previous verification projects Automatic generation of test oracles from pre- and postconditions Testing mechanism based of FSM traversal Test coverage metrics definition and tracking Dynamic test optimization for the target coverage To propose a specification based test development process for use in the software industry To provide a specification extension of widely used programming language To simplify the technology

Victor Kuliamin ISP RAS 3 Solutions Proposed Constraint specifications and axioms are both used for functional requirements recording Constraint specifications give rise to test oracles Axioms can be transformed into test scenarios OO architecture is used for specification reuse User should specify branches as the basic test coverage metric based on specifications. Several additional metrics can be extracted automatically. Test sequence can be generated with the help of FSM traversal mechanism. Test scenarios serve as a source for FSM description. Flexible mechanism to bind specification with target component is used

Victor Kuliamin ISP RAS 4 Verification Suite Components Requirements recording AxiomsConstraint SpecificationsTest Coverage MetricsImplementation Test effectiveness measure Test ScenariosFSM Traversal Algorithms Test sequence generation OraclesTest driversTest coverage trackers Handmade componentGenerated componentPrebuilt component DependencyAutomatic derivation Legend

Victor Kuliamin ISP RAS 5 Main Features of State based behavior specifications Object state and invariants Precondition and postcondition of a method Axioms and algebraic specifications Test coverage metrics description Abstraction management Test scenarios executed with the help of FSM based testing machine Flexible OO test suite architecture

Victor Kuliamin ISP RAS 6 Specification of Object State Attributes of class and invariants constitute the specification of state for objects of this class. Example. Specification of a queue with elements having priorities.

Victor Kuliamin ISP RAS 7 Example of Object State Specification public class PriorityQueueSpecification { public List items; // The list of queue elements public List priorities; // The list of elements’ priorities invariant I1() // The lists of elements and priorities have the same sizes { return items.size() == priorities.size(); } invariant I2() // The list of priorities contains only Priority objects { for(int i = 0; i < priorities.size(); i++) if(!(priorities.elementAt(i) instanceof Priority)) return false; return true; } invariant I3() // The values of priorities should not increase { for(int i = 1; i < priorities.size(); i++) if( ((Priority)priorities.elementAt(i)).greater( (Priority)priorities.elementAt(i-1) ) ) return false; return true; }

Victor Kuliamin ISP RAS 8 Method Precondition and Postcondition Method precondition formulates the conditions when this method can be called. Method postcondition gives the criterion of the correct method’s behavior in terms of states of method parameters and other objects before the call and after it. Example. The specifications of enq() method in the queue. The most coarse test coverage is based on branch operators, which make a section of postcondition control flow graph.

Victor Kuliamin ISP RAS 9 Example of Method Behavior Specification specification public synchronized void enq(Object obj) reads obj updates items.? { pre { return obj != null; } // We cannot add null object reference to the queue post { branch “Single branch"; List new_items = means pre-value of new_items.addLastElement(obj); return items.equals(new_items); }

Victor Kuliamin ISP RAS 10 Axioms and Algebraic Specifications Axioms are represented as special methods that return boolean result and can have precondition. Algebraic specifications are represented as special methods with several bodies. They also can have precondition. Example. Axiom and algebraic specification for a stack.

Victor Kuliamin ISP RAS 11 Example of Axiom and Algebraic Specification axiom PushAndSize() { pre { return true; } int oldSize = size(); push(new Object()); return size() == oldSize() + 1; } equivalence Object PushAndPop(Object obj) { pre { return true; } alternative { push(obj); return pop(); } alternative { return obj; } }

Victor Kuliamin ISP RAS 12 Test Coverage Metrics Four predefined test coverage metrics are extracted from the control flow of pre- and postcondition. User can describe his own metrics in addition. Test execution environment keeps track of all the metrics defined and can perform dynamic optimizations for the coverage specified as target. Example. Specification of enq() operation for the queue with additional coverage metrics.

Victor Kuliamin ISP RAS 13 Test Coverage Metrics Example specification public synchronized void enq(Object obj) reads obj updates items.? { pre { return obj != null; } // We cannot add null object reference to the queue post { switch(items.size()) { case 0: mark “Empty queue”; break; case 1: mark “Single element in the queue”; break; default: mark “Several elements in the queue”; break; } branch “Single branch"; List new_items = means pre-value of new_items.addLastElement(obj); return items.equals(new_items); }

Victor Kuliamin ISP RAS 14 Abstraction Management has the following instruments for abstraction management Inheritance of specifications Refinement of specifications Multi-level system of specifications As an example of inheritance we can present specifications of the ordinary queue and the queue with priorities, which has an additional operation enq(Object o) adding an element with minimum priority.

Victor Kuliamin ISP RAS 15 Test Scenarios Test scenarios provide a powerful tool of test design. They are used as a source for test sequence generation. Test scenarios are executed with the help of the FSM traversal mechanism. Example. Test scenario for the queue. It is based of the FSM model of the queue, where different states correspond to different numbers of elements. The test generated from this scenario performs the traversal of the FSM having 10 states and enq() and deq() transitions from every state, except for the initial and last ones. The initial state has only enq() transition, and the last state has only deq() transition.

Victor Kuliamin ISP RAS 16 Example of Test Scenario scenario public class QueueTestScenario { public QueueSpecification queue = new QueueSpecification(); // The object under test public maxNumberOfItems = 10; // The maximum number of elements in // the queue during the test public synchronized AbstractGenState getGenState() // Returns the state object { return new IntGenState(queue.items.size()); // Library class IntGenState is used } scenario public boolean enq() // Subscenario for enq() method { if( queue.items.size() < maxNumberOfItems ) queue.enq(new Object()); return true; } scenario public boolean deq() // Subscenario for deq() method { if( queue.items.size() != 0 ) queue.deq(); return true; }

Victor Kuliamin ISP RAS 17 Test Suite Architecture SpecificationModel Mediator Implementation Test ScenarioTest Engine Oracle Test driver Test coverage trackers Handmade componentGenerated componentPrebuilt component Reference Automatic derivation Test coverage trackers Java Mediator Inheritance Legend

Victor Kuliamin ISP RAS 18 — Based Test Development Framework

Victor Kuliamin ISP RAS 19 References 1. A. K. Petrenko, I. B. Bourdonov, A. S. Kossatchev, V. V. Kuliamin. Experiences in using testing tools and technology in real-life applications. Proceedings of SETT’01, India, Pune, I. B. Bourdonov, A. S. Kossatchev, V. V. Kuliamin. Using Finite State Machines in Program Testing. "Programmirovanije", 2000, No. 2 (in Russian). Programming and Computer Software, Vol. 26, No. 2, 2000, pp (English version) 3. I. Bourdonov, A. Kossatchev, A. Petrenko, and D. Galter. KVEST: Automated Generation of Test Suites from Formal Specifications. Proceedings of World Congress of Formal Methods, Toulouse, France, LNCS, No. 1708, 1999, pp I. B. Bourdonov, A. S. Kossatchev, V. V. Kuliamin, A. V. Maximov. Testing Programs Modeled by Nondeterministic Finite State Machine. (see [6] white papers)

Victor Kuliamin ISP RAS 20 Contacts Victor V. Kuliamin , B. Kommunisticheskaya, 25 Moscow, Russia. Web: Phone: 007 (095) ext 4422 Fax: 007 (095)