testing with filmstrips
DESCRIPTION
Testing with Filmstrips. Tony Clark School of Computing Thames Valley University [email protected] http://itcentre.tvu.ac.uk/~clark/. Overview. Model Driven Testing Testing with Filmstrips Two new features: filmstrips and snapshots A Case Study Filmstrips as Extended Use Cases - PowerPoint PPT PresentationTRANSCRIPT
![Page 1: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/1.jpg)
1
Testing with Filmstrips
Tony ClarkSchool of Computing
Thames Valley University
[email protected]://itcentre.tvu.ac.uk/~clark/
![Page 2: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/2.jpg)
2
Overview
• Model Driven Testing• Testing with Filmstrips• Two new features: filmstrips and snapshots• A Case Study• Filmstrips as Extended Use Cases• An Approach to Language Design• Defining the Extension: syntax and semantics• Practical Experimentation: demo• Review and further work
![Page 3: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/3.jpg)
3
Model Driven Testing• Model the system.• Generate tests from models.• Can:
– Test the model.– Test the implementation.
• Most existing work uses behaviour models:– State machines– Collaboration diagrams– Sequence diagrams
![Page 4: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/4.jpg)
4
Testing with Filmstrips
![Page 5: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/5.jpg)
5
Features: Snapshots and Filmstrips• Snapshots are system state descriptions.• Snapshot patterns denote sets of state descriptions.
(Model Based Functional Testing using Pattern Directed Filmstrips. Tony Clark. AST 09, ICSE 09.)
• Filmstrip patterns are sequences of snapshot patterns.
• This talk about filmstrips and filmstrip patterns.
• EOPPEs (http://www.ansa.co.uk/ANSATech/93/Primary/10100002.pdf)
![Page 6: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/6.jpg)
6
A Case Study
![Page 7: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/7.jpg)
7
Basic Use Cases
![Page 8: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/8.jpg)
8
UML Meta Model for Use Cases
![Page 9: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/9.jpg)
9
Proposed Extension
![Page 10: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/10.jpg)
10
Extended Use Case Model
![Page 11: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/11.jpg)
11
An Approach to DSL Design
![Page 12: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/12.jpg)
12
Filmstrip Semantic Domain
context Filmstrip inv: steps = children->iterate(c s = Seq{} | s + c.steps)
context Filmstrip inv: steps->asBag = merged->iterate(c s = Seq{} | s + c.steps)->asBag
![Page 13: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/13.jpg)
13
Basic Semantic Mapping
context BasicSatisfaction inv: spec.inv->forAll(c | filmstrip.steps->forAll(s | c.satisfiedBy(s.before,env) and c.satisfiedBy(s.after,env)))
context BasicSatisfaction inv: spec.pre->forAll(c | c.satisfiedBy(filmstrip.steps->first.before,env)) and spec.post->forAll(c | c.satisfiedBy(filmstrip.steps->last.before,env))
![Page 14: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/14.jpg)
14
Sequenced Behaviour
context SeqSatisfaction inv: filmstrip.children = children.filmstrip and children.spec = spec.children
![Page 15: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/15.jpg)
15
Alternative Behaviour
context AltSatisfaction inv: children->exists(r | r.filmstrip = filmstrip)
![Page 16: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/16.jpg)
16
Parallel Behaviour
context ParSatisfaction inv: children->filmstrip = filmstrip.merged and par.children = children.spec
![Page 17: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/17.jpg)
17
Behaviour Repetition
context StarSatisfaction inv: filmstrip.children->forAll(c | c = basicSatisfaction.filmstrip)
![Page 18: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/18.jpg)
18
Practical Issues
• Generating Sequences
• Language Design
• System Architecture
• Demo
![Page 19: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/19.jpg)
19
Generating Sequences
F ::= Filmstrip Specs
F then F
| F or F
| F par F
| F*
| epsilon
| O
O ::= Operation Specs
![Page 20: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/20.jpg)
20
Sequences[| f then g |] = { p + q | p in [| f |], q in [| g |] }
[| f or g |] = [| f |] union [| g |]
[| f par g |] = { p + q + p’ + q’ |
r in [| f |],
s in [| g |],
(p,p’) in split(r),
(q,q’) in split(s) }
split(s) = { (take(s,i),drop(s,i)) | i in 0..len(s) }
[| f* |] = [| epsilon or (f then f*) |]
[| epsilon |] = { [] }
[| o |] = { [o] }
![Page 21: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/21.jpg)
21
A Language for Testing Java@Filmstrip(hotel.BookingSystem,"C:/project") name = {"hotel1","hotel2"} address = {"Leeds"}in seq op hotelId = addHotel(name,address ,3,100.0)
pre not self.getHotels()->exists(hotel | hotel.getName() = hotelName)
post self.getHotels()->exists(hotel | hotel.getName() = hotelName and hotel.getAddress() = hotelAddress and hotel.getRooms()->size = 3) end ... more filmstrip...do ... action ...end
![Page 22: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/22.jpg)
22
Connecting to Java
Java Application
FilmstripSpecification
FilmstripEngine
Report
Use CaseModel
![Page 23: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/23.jpg)
Demo
23
![Page 24: Testing with Filmstrips](https://reader036.vdocuments.us/reader036/viewer/2022062517/56813e42550346895da82b51/html5/thumbnails/24.jpg)
Review
• Adding snapshot patterns.
• Controlling choices.
• Integration with OMG testing profile.
• Correspondence with UML behaviour.
24