-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
699 lines (631 loc) · 31.3 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
<!DOCTYPE html>
<html prefix="og: http://ogp.me/ns#">
<head>
<title>From Traces To (Formal) Models - William Durand</title>
<link rel="stylesheet" href="css/reveal-no-icons.min.css">
<link rel="stylesheet" href="reveal.js/css/theme/serif.css" id="theme">
<link rel="stylesheet" href="reveal.js/lib/css/zenburn.css">
<link rel="stylesheet" href="font-awesome/css/font-awesome.min.css">
<link rel="stylesheet" href="css/custom.css">
<script>
document.write('<link rel="stylesheet" href="reveal.js/css/print/' +
(window.location.search.match(/print-pdf/gi) ? 'pdf' : 'paper') +
'.css" type="text/css" media="print">'
);
</script>
<meta property="og:title" content="From Traces To (Formal) Models - William Durand">
<meta property="og:description" content="">
<meta property="og:image" content="">
</head>
<body>
<div class="reveal">
<div class="slides">
<section>
<h1 class="title">From Traces To (Formal) Models</h1>
<em>William Durand - February 13, 2014</em>
</section>
<section>
<section data-markdown>
<script type="text/template">
## About Me
<br>
* PhD student at Michelin / LIMOS
* Graduated from IUT and ISIMA
* I <i class="icon-heart"></i> Open Source
<img src="images/clermontech.png" class="clermontech-badge" />
</script>
</section>
<section data-markdown>
<script type="text/template">
## PhD Topic
<br>
Automated **Test** Generation for applications and production machines in a
**Model-based Testing** approach.
</script>
</section>
</section>
<section data-markdown>
<script type="text/template">
## Agenda
<br>
* Introduction
* Model-based Testing
* Current Research
* Conclusion
</script>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Software Testing
<p class="fragment">
<br>
**Software testing** is the process of **analyzing a software**
<br>item **to detect the differences between existing and
<br>required conditions** (that is, bugs) and to evaluate the
<br>features of the software item.
</p>
<p class="fragment">
<br>
It is a **Verification** and **Validation** process.
</p>
<p class="fragment">
<br>
**Validation** → "Are we building the right software?"
<br>
<br>
**Verification** → "Are we building the software right?"
</p>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Why?
<br>
<ul>
<li>To find **faults** (G. Myers, The Art of Software Testing)</li>
<br>
<li>To provide **confidence** of reliability, correctness,<br>and absence of particular faults</li>
</ul>
<br>
<br>
<i class="icon-warning-sign"></i> This does **not** mean that the software is completely
free of defects. Rather, it must be good enough for its intended use.
</script>
</section>
<section data-markdown>
<script type="text/template">
## How?
</script>
</section>
<section data-markdown>
<script type="text/template">
## Industry
<br>
**Unit** Testing, **Integration** Testing, **Functional** Testing, System Testing,
Stress Testing, Performance Testing, Usability Testing, Acceptance Testing,
Regression Testing, Beta Testing, <Whatever You Want> Testing
<br><br>
<p class="fragment left">
<i class="icon-thumbs-up"></i> People now understand the need for testing things
</p>
<p class="fragment left">
<i class="icon-thumbs-down"></i> They mostly do testing by hand...
</p>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Academia
<p class="fragment">
<br>
One approach is to...
<br>
![](images/automate_all_the_things.jpeg)
</p>
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Model-based Testing
</script>
</section>
<section data-markdown>
<script type="text/template">
## Definition
<br>
**Model-based Testing** (MbT) is **application of Model-based design** for designing and
optionally also executing artifacts<br>**to perform software testing**.
<br>
**Models** can be used to represent the **desired behavior<br>of an SUT**, or to represent
**testing strategies** and a **test environement**.
<br>
<small>
<a href="http://en.wikipedia.org/wiki/Model-based_testing">http://en.wikipedia.org/wiki/Model-based_testing</a>
</small>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Why?
<br>
* To bring the benefits of automation to new parts of the test cycle
(test cases creation for instance)
* To provide testers more effective tools
* To reduce cost and cycle time
* To leverage formal methods
</script>
</section>
<section data-markdown>
<script type="text/template">
## Models
<br>
A **Model** is a description of a system that helps you understand and predict its behavior.
<br>
<br>
It does **not need to completely describe it** to be effective.
<br>
<br>
<p class="left">
**Behavior/Control oriented**: Finite Automata (FSM, LTS), Petri Nets,
Synchronous Languages (Lustre, Scade)
<br>
<br>
**Data oriented** (pre/post): JML, Spec#, OCL, B-Method, Praspel
</p>
</script>
</section>
<section data-markdown>
<script type="text/template">
## The Big Picture
![](images/mbt.png)
</script>
</section>
<section data-markdown>
<script type="text/template">
## Three Stages
<br>
1. Formally modelling the requirements (specification);
2. Generating test cases from the model;
3. Running these test cases against an actual SUT and evaluating the results.
<br>
<i class="icon-info-sign"></i> Combining 2. and 3. leads to **On-The-Fly Testing**.
</script>
</section>
<section data-markdown>
<script type="text/template">
## Test Generation
<br>
* Based on Finite State Machines
* Based on Symbolic Transition Systems
* Based on Labelled Transition Systems
</script>
</section>
<section>
<h2>Labelled Transition Systems</h2>
<br>
<p class="float-left">
<img src="images/lts.png" />
</p>
<p class="float-right">
<br>
$$ L = (S, Act, \rightarrow) $$
<br>
with
<br>
$$ S = \lbrace s_{1}, s_{2}, s_{3}, s_{4} \rbrace $$
<br>
and
<br>
$$ Act = \lbrace COFFEE, TEA, BUTTON \rbrace $$
</p>
</section>
<section>
<h2>Traces</h2>
<p>
<br>
$$
\begin{align}
traces(s_{3}) =
& \lbrace \\
& BUTTON, \\
& BUTTON \cdot TEA \cdot BUTTON, \\
& \dots \rbrace = traces(s_{1}) = traces(s_{4}) \\
\\
traces(s_{2}) =
& \lbrace \\
& TEA, \\
& COFFEE, \\
& TEA \cdot BUTTON \cdot TEA, \\
& \dots \rbrace
\end{align}
$$
</p>
</section>
<section>
<h2>Input/Output LTS</h2>
<br>
<p class="float-left">
<img src="images/iolts.png" />
</p>
<p class="float-right">
<br>
<br>
<br>
$$
\begin{align}
Act_{I} = & \lbrace BUTTON?, COFFEE?, TEA? \rbrace \\
Act_{U} = & \lbrace COFFEE!, TEA! \rbrace
\end{align}
$$
</p>
</section>
<section data-markdown>
<script type="text/template">
## Automated Generation Of Specification Models
<br>
* By leveraging the API documentation
* By **instrumenting** the code (tracing)
* By leveraging the logs
* By **monitoring** the system
</script>
</section>
</section>
<section>
<section data-markdown>
<script type="text/template">
## Current Research
</script>
</section>
<section data-markdown>
<script type="text/template">
## Challenge
<br>
Based on a software, running in a<br>production environment, would it possible to:
<br>
<br>
1. extract a **knowledge base**
2. that can be formalized by a **model**
3. that can be used to **generate tests** and/or **specifications**?
</script>
</section>
<section>
<h2>Context (1/2)</h2>
<br>
<p>
Michelin relies on a method close to the <strong>C</strong>omputer <strong>I</strong>ntegrated <strong>M</strong>anufacturing
(CIM) approach to control its production:
</p>
<div class="float-left" style="width: 65%">
<ul style="margin-top: 5%">
<li>L4: Business Software</li>
<li>L3: Virtual level as it is not that used (Factory Management)</li>
<li><strong>L2: Supervision / Workshop Management</strong></li>
<li>L1: Automata</li>
</ul>
</div>
<div class="float-right" style="width: 60%">
<img src="images/levels.png" />
</div>
<p>These levels can exchange data among them.</p>
</section>
<section data-markdown>
<script type="text/template">
## Context (2/2)
<br>
Focus on **Level 2** applications but, then again,
<br>there are a lot of differences between them, such as:
* Programming Language
* Framework
* Design
* Version
</script>
</section>
<section data-markdown>
<script type="text/template">
## Hypotheses
<br>
1. Applications deployed in production behave as expected
2. Don't consider (existing) specifications
</script>
</section>
<section data-markdown>
<script type="text/template">
## The Big Picture
![](images/autofunk_1.png)
</script>
</section>
<section data-markdown>
<script type="text/template">
## Traces
<br>
A sequence of observable actions produced by an application.
<br>
**Raw** traces are collected from various sources,
including the **production environment** thanks to a
monitor.
<br>
<br>
<em>
<i class="icon-info-sign"></i> Traces in the context of web applications are HTTP requests and responses.
</em>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Domain Expert
<br>
A (human) domain expert can deduce the meaning of an application
execution by reading these **traces**.
<p class="fragment">
<br>
<i class="icon-lightbulb"></i> What about doing the same, **programmatically**?
</p>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Expert System
<br>
In Artificial Intelligence, an **expert system** is a computer system that
**emulates the decision-making ability of a human expert**.
<br>
<br>
Designed to **solve complex problems by reasoning about knowledge**, and **not** by
following the procedure of a developer as is the case in conventional programming.
<br>
<br>
<em>
<i class="icon-info-sign"></i> Java [JBoss Drools Expert](https://www.jboss.org/drools/drools-expert.html)
engine is a powerful expert system.
</em>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Rules
<br>
First-Order Predicate Calculus
IF condition
THEN
action
ENDIF
</script>
</section>
<section data-markdown>
<script type="text/template">
## Layer 1 - Filtering
<br>
Cleans up the trace set given as input, removing **noise**,<br>a.k.a. **irrelevant** traces.
<br>
<br>
The resulting structured trace set is given to the next layer.
<br>
<br>
<em>
<i class="icon-info-sign"></i> In the context of web applications, HTTP requests/responses
related to assets (CSS files, JavaScript files, images) are meaningless.
</em>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Layer 2 - IOSTS Transformation
<br>
Based on a the previous **structured trace set**, this layer performs a IOSTS transformation,
by **translating valued actions of a trace into IOSTS transitions**.
<br>
<br>
This first model is re-generated each time new traces are received, and then passed to the next layer.
</script>
</section>
<section data-markdown>
<script type="text/template">
## Layer 2 - Example
![](images/gh-2-1.png)
</script>
</section>
<section data-markdown>
<script type="text/template">
## Layer 2 - Minimisation
<br>
The previous IOSTS is reduced in term of location size by applying a bisimulation
minimisation technique.
<br>
<br>
GET("https://github.com/")
GET("https://github.com/login")
POST("https://github.com/session")
GET("https://github.com/")
GET("https://github.com/willdurand")
GET("https://github.com/willdurand/Geocoder")
POST("https://github.com/logout")
GET("https://github.com/")
</script>
</section>
<section data-markdown>
<script type="text/template">
## Layer 3 to N - Abstraction
<br>
Composed of rules that emulate the ability of a human expert to **simplify transitions**,
to **analyze transition syntax** in order to deduce more meaningful information related to
the targeted application, and to **construct more abstract models**.
<br>
<br>
Each layer takes an **IOSTS given by the direct lower** one. It represents the current **base of facts**.
<br>
<br>
Layer 3 contains low level, generic rules that can be reused against different applications.
</script>
</section>
<section data-markdown>
<script type="text/template">
## Layer 3 - Example
<br>
rule "Identify Login Page"
when
$t: Transition(
Action == GET,
Guard.response.content contains('login-form')
)
then
modify ($t) { Assign.add("isLoginPage := true") }
end
</script>
</section>
<section data-markdown>
<script type="text/template">
## Layer 3 - Example
<br>
![](images/gh-2-2.png)
</script>
</section>
<section data-markdown>
<script type="text/template">
## Layer 4 - Example
![](images/gh-2-3.png)
</script>
</section>
<section data-markdown>
<script type="text/template">
## Layer 5 - Example
![](images/gh-2-4.png)
</script>
</section>
<section data-markdown>
<script type="text/template">
## Framework
![](images/autofunk_2.png)
</script>
</section>
<section data-markdown>
<script type="text/template">
## The Explorer
<br>
**The more traces, the better model in term of expressiveness.**
<br>
<br>
A **robot explorer** is used to **increase the amount of traces**<br>that are sent to the
model generator (i.e. the component that embeds the Expert System).
<br>
<br>
<i class="icon-warning-sign"></i> It can only be applied on event-driven applications.
</script>
</section>
<section data-markdown>
<script type="text/template">
## Strategies
<br>
Our **robot explorer** uses intelligent crawling guided by strategies, rather than blind
exploration.
<br>
<br>
Strategies are defined by **rules** that define how to find new states to visit. This is an
**orthogonal layer**.
<br>
<br>
<em>
<i class="icon-info-sign"></i> BFS and DFS are common strategies to explore a web application.
</em>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Recap'
![](images/se.png)
</script>
</section>
<section data-markdown>
<script type="text/template">
## **Auto**matic **Funk**tional Testing Tool
<br>
Written in Java, PHP, Node.JS, and JavaScript.
<br>
Distributed system thanks to RabbitMQ.
<br>
Service Oriented Architecture FTW!
<br>
<em>
<i class="icon-warning-sign"></i> This tool has been built for web applications.
<br>Michelin will get its own internal tool.
</em>
</script>
</section>
<section data-markdown>
<script type="text/template">
## So, What?
<br>
The **final model** gathers useful information which allow to:
1. generate test cases;
2. detect potential issues;
3. perform security testing.
</script>
</section>
</section>
<section data-markdown>
<script type="text/template">
## Conclusion
<br>
<p style="text-align: left">
<i class="icon-smile"></i> Once rules are written, it is quite **easy to construct models**.
<br>
<i class="icon-frown"></i> However, rules tend to be **hard to write**, and to maintain.
</p>
</script>
</section>
<section data-markdown>
<script type="text/template">
## Thank You.
### Questions?
<br><br>
<br><br>
<ul class="me">
<li>
<i class="icon-globe"></i> <a href="http://williamdurand.fr" title="website">williamdurand.fr</a>
</li>
<li>
<i class="icon-github"></i> <a href="https://github/willdurand" title="github">github.com/willdurand</a>
</li>
<li>
<i class="icon-twitter"></i> <a href="https://twitter.com/couac" title="twitter">twitter.com/couac</a>
</li>
</ul>
</script>
</section>
</div>
</div>
<script type="text/javascript" src="reveal.js/lib/js/head.min.js"></script>
<script type="text/javascript" src="reveal.js/js/reveal.min.js"></script>
<script type="text/javascript">
Reveal.initialize({
controls: true,
progress: true,
history: true,
center: true,
theme: Reveal.getQueryHash().theme,
transition: Reveal.getQueryHash().transition || 'concave',
// Optional libraries used to extend on reveal.js
dependencies: [
{ src: 'reveal.js/lib/js/classList.js', condition: function() { return !document.body.classList; } },
{ src: 'reveal.js/plugin/markdown/marked.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/markdown/markdown.js', condition: function() { return !!document.querySelector( '[data-markdown]' ); } },
{ src: 'reveal.js/plugin/highlight/highlight.js', async: true, callback: function() { hljs.initHighlightingOnLoad(); } },
{ src: 'js/pageNumbers.js' },
{ src: 'reveal.js/plugin/math/math.js', async: true },
]
});
</script>
<script type="text/x-mathjax-config">
MathJax.Hub.Register.StartupHook("TeX Jax Ready",function () {
MathJax.Hub.Insert(MathJax.InputJax.TeX.Definitions.macros,{
cancel: ["Extension","cancel"],
bcancel: ["Extension","cancel"],
xcancel: ["Extension","cancel"],
cancelto: ["Extension","cancel"]
});
});
</script>
</body>
</html>