-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.module.js
4360 lines (4336 loc) · 267 KB
/
index.module.js
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
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
/* ______ _
* / ____/___ _(_)___ ___ ____ _____
* / / __/ __ `/ / __ `__ \/ __ `/ __ \
* / /_/ / /_/ / / / / / / / /_/ / / / /
* \____/\__,_/_/_/ /_/ /_/\__,_/_/ /_/
*
* Code generated by Gaiman version 1.0.0-beta.3
* https://gaiman.js.org
*/
var audio = new Audio('lofi.mp3');
function parse_cookies(cookies) {
const result = {};
cookies.split(/\s*;\s*/).forEach(function(pair) {
pair = pair.split(/\s*=\s*/);
var name = decodeURIComponent(pair[0]);
var value = decodeURIComponent(pair.splice(1).join('='));
result[name] = value;
});
return result;
}
function is_function(obj) {
return typeof obj === 'function';
}
function is_promise(obj) {
return obj && is_function(obj.then);
}
function is_node() {
return typeof process !== 'undefined' &&
process.release.name === 'node';
}
// based on https://stackoverflow.com/a/46282334/387194
function extend(object, prototype) {
const descriptors = Object.getOwnPropertyDescriptors(object);
for (const prop in descriptors) {
Object.defineProperty(prototype, prop, descriptors[prop]);
}
}
const loops = {};
const Gaiman = {
_get_time() {
return +new Date;
},
should_break_loop(id) {
if (!loops[id]) {
loops[id] = {
start: this._get_time(),
count: 1
};
return false;
} else {
var now = this._get_time();
const { start } = loops[id];
const count = ++loops[id].count;
if (count > this._config.loop_threshold) {
const stop = now - start > this._config.loop_timeout;
if (stop) {
window.parent.postMessage({
message: 'Infinite Loop detected!',
colno: null,
lineno: null
});
}
return stop;
}
return false;
}
},
exit_loop(id) {
delete loops[id];
},
type(obj) {
if (obj === 'null') {
return 'null';
} else if (Number.isNaN(obj)) {
return 'nan';
} else if (obj instanceof Array) {
return 'array';
} else {
var type = typeof obj;
if (type === 'object') {
// https://tinyurl.com/fixing-typeof
return ({}).toString.call(obj).match(/\s([a-zA-Z]+)/)[1].toLowerCase();
}
return type;
}
},
parse(input) {
return $.terminal.parse_arguments(input);
},
parse_extra(input) {
return $.terminal.split_arguments(input);
},
set_cookie(name, value) {
document.cookie = `${name}=${value}`;
cookie[name] = value;
},
post(url, data = {}) {
return $.post(url, data);
},
post_extra(url, data = {}) {
return $.post(url, data, $.noop, "text");
},
get(url, data) {
if (data) {
return $.get(url, data);
}
return $.get(url);
},
get_extra(url, data) {
if (data) {
return $.get(url, data, $.noop, "text");
}
return $.get(url, $.noop, "text");
},
load(url) {
return $.getScript(url);
},
['async'](fn) {
setTimeout(fn, 0);
},
async rpc(url) {
// TODO: add Open-RPC
return new Proxy({}, {
get(target, name) {
if (name in target) {
return target[name];
}
if (name === 'then') {
return undefined;
}
return (...args) => {
return $.rpc(url, name, args);
};
},
set() {
throw new Error("You can't set properties on rpc object");
}
});
}
};
function to_string(object) {
if (object instanceof Array) {
object = object.map(to_string);
} else {
var type = typeof object;
if (type === 'number') {
object = String(object);
} else if (type !== 'string') {
if (object) {
object = JSON.stringify(object, null, 2);
} else {
object = String(object);
}
}
}
return object;
}
class WebAdapter {
constructor(config = {}) {
this._config = $.extend({
newline: true,
loop_threshold: 500,
loop_timeout: 200
}, config);
var root = $('#term');
var options = root.css('--options');
if (typeof options === 'undefined') {
options = {};
} else {
try {
options = JSON.parse(options);
} catch(e) {
console.warn('Gaiman: Invalid --option CSS variable');
options = {};
}
}
var playground = window.parent?.__GAIMAN_PLAYGROUND__;
if (playground) {
options.enabled = false;
}
this._term = root.terminal($.noop, $.extend({
greetings: false,
exit: false,
keydown: () => {
if (this._animation) {
return false;
}
},
exceptionHandler(e) {
if (is_iframe) {
window.parent.postMessage({
message: 'Internal: ' + e.message,
colno: null,
lineno: null
});
} else {
throw e;
}
}
}, options));
}
config(name, value) {
if (typeof name === 'string') {
this._config[name] = value;
} else {
const { completion, ...rest } = name;
this._term.settings().completion = completion;
$.extend(rest, name);
}
}
store(name, ...args) {
try {
if (args.length === 0) {
return JSON.parse(localStorage.getItem(name));
} else {
const [ value ] = args;
localStorage.setItem(name, JSON.stringify(value));
}
} catch(e) {
// ignore errors that may happen in Incognito mode
}
}
sleep(timeout, visible = false) {
this._term.pause(visible);
return new Promise(resolve => {
setTimeout(() => {
this._term.resume();
resolve();
}, Number(timeout));
});
}
sleep_extra(timeout) {
return this.sleep(timeout, true);
}
mask(char) {
if (arguments.length === 0) {
return this._term.cmd().mask();
}
this._term.set_mask(char);
}
error(e) {
var message;
if (e.statusText) {
message = `Failed to fetch: ${e.url}\n${e.statusText}`;
} else {
message = e.message || e;
}
this._term.error(message);
}
echo(arg = "") {
if (typeof arg !== 'function') {
arg = to_string(arg);
}
this._term.echo(arg, { newline: this._config.newline });
}
echo_extra(string, delay) {
return this._term.echo(string, { typing: true, delay });
}
enter(string) {
return this._term.enter(string);
}
enter_extra(string, delay) {
return this._term.enter(string, { typing: true, delay });
}
ask(message, validator = () => true) {
return new Promise(resolve => {
this._term.push(result => {
return Promise.resolve().then(async () => {
if (typeof validator !== 'function') {
throw new Error('ask validator needs to be a function');
}
if (await validator(result)) {
this._term.pop();
resolve(result);
}
});
}, {
prompt: message
});
});
}
ask_extra(message, delay, validator = () => true) {
return new Promise(resolve => {
const prompt = this._term.get_prompt();
this._term.push(result => {
return Promise.resolve().then(async () => {
if (typeof validator !== 'function') {
throw new Error('ask* validator needs to be a function');
}
if (await validator(result)) {
this._term.pop().set_prompt(prompt);
resolve(result);
} else {
this._term.set_prompt(message, {
typing: true,
delay
});
}
})
}).set_prompt(message, {
typing: true,
delay
});
});
}
update(index, string) {
this._term.update(index, string);
}
prompt(string) {
this._term.set_prompt(string);
}
prompt_extra(string, delay) {
return this._term.set_prompt(string, { typing: true, delay });
}
input(string) {
return this._term.exec(string);
}
input_extra(string, delay) {
return this._term.exec(string, { typing: true, delay });
}
exec(command) {
return this._term.exec(command);
}
exec_extra(command, delay) {
return this._term.exec(command, { typing: true, delay });
}
async animate(fn) {
this._animation = true;
await fn();
this._animation = false;
}
clear() {
this._term.clear();
}
}
$.ajaxSetup({
beforeSend: function(jqXHR, settings) {
jqXHR.url = settings.url;
}
});
extend(Gaiman, WebAdapter.prototype);
class GaimanArray extends Array {
map(...args) {
function call(arr) {
return new GaimanArray(...arr);
}
const arr = super.map.apply(this, args);
const some = super.some;
const has_promise = some.call(arr, is_promise);
if (has_promise) {
return Promise.all(arr).then(call);
} else {
return call(arr);
}
}
forEach(...args) {
return this.map(...args);
}
filter(fn, ctx) {
const filter = super.filter;
function call(arr) {
return new GaimanArray(...filter.call(arr, x => x));
}
const items = this.map(fn, ctx);
if (is_promise(items)) {
return items.then(arr => {
return call(arr);
});
} else {
return call(items);
}
}
reduce(fn, init) {
return new GaimanArray(...super.reduce.call(this, function(acc, ...args) {
if (is_promise(acc)) {
return acc.then(acc => {
return fn(acc, ...args);
});
} else {
return fn(acc, ...args);
}
}, init));
}
sort(fn = defaultSortFn) {
return mergeSort(this, fn);
}
some(fn, ctx) {
const some = super.some;
return this.mapWithCallback(fn, (arr) => {
return some.call(arr, x => x);
}, ctx);
}
every(fn, ctx) {
const every = super.every;
return this.mapWithCallback(fn, (arr) => {
return every.call(arr, x => x);
}, ctx);
}
find(fn, ctx) {
return this.mapWithCallback(fn, (arr) => {
const index = arr.findIndex(x => x);
return this[index];
}, ctx);
}
flatMap(fn, ...args) {
return this.map(...args).flat();
}
mapWithCallback(fn, callback, ctx) {
const items = this.map(fn, ctx);
if (is_promise(items)) {
return items.then(arr => {
return callback(arr);
});
} else {
return callback(items);
}
}
}
function defaultSortFn(a, b) {
if (typeof a !== 'string') {
a = String(a);
}
if (typeof b !== 'string') {
b = String(b);
}
if (a < b) {
return -1;
}
if (a > b) {
return 1;
}
return 0;
}
// based on: https://rosettacode.org/wiki/Sorting_algorithms/Merge_sort#JavaScript
async function mergeSort(array, fn = defaultSortFn) {
if (array.length <= 1) {
return array;
}
const mid = Math.floor(array.length / 2),
left = array.slice(0, mid), right = array.slice(mid);
await mergeSort(left, fn);
await mergeSort(right, fn);
let ia = 0, il = 0, ir = 0;
while (il < left.length && ir < right.length) {
array[ia++] = (await fn(left[il], right[ir]) <= 0) ? left[il++] : right[ir++];
}
while (il < left.length) {
array[ia++] = left[il++];
}
while (ir < right.length) {
array[ia++] = right[ir++];
}
return array;
}
// STD library
function $_ord(x) {
const type = typeof x;
if (type !== 'string') {
throw new Error(`ord: Invalid argument, expected string got ${type}`);
}
const len = [...x].length;
if (len > 1) {
throw new Error('ord: argument need to be string of length 1');
}
return x.codePointAt(0);
}
function $_chr(x) {
const type = typeof x;
if (type !== 'number') {
throw new Error(`chr: Invalid argument, expected number got ${type}`);
}
return String.fromCodePoint(x);
}
function $_range(start, stop, step) {
if (!stop) {
stop = start;
start = 0;
}
if (!step) {
if (start > stop) {
step = -1;
} else {
step = 1;
}
}
if (start > stop && step > 0) {
return new GaimanArray();
}
let result = new GaimanArray();
function run() {
result.push(start);
start += step;
}
if (start > stop) {
while (start > stop) {
run();
}
} else {
while (start < stop) {
run();
}
}
return result;
}
let $_abs = Math.abs;
let $_acos = Math.acos;
let $_acosh = Math.acosh;
let $_asin = Math.asin;
let $_asinh = Math.asinh;
let $_atan = Math.atan;
let $_atanh = Math.atanh;
let $_atan2 = Math.atan2;
let $_ceil = Math.ceil;
let $_cbrt = Math.cbrt;
let $_expm1 = Math.expm1;
let $_clz32 = Math.clz32;
let $_cos = Math.cos;
let $_cosh = Math.cosh;
let $_exp = Math.exp;
let $_floor = Math.floor;
let $_fround = Math.fround;
let $_hypot = Math.hypot;
let $_imul = Math.imul;
let $_log = Math.log;
let $_log1p = Math.log1p;
let $_log2 = Math.log2;
let $_log10 = Math.log10;
let $_max = Math.max;
let $_min = Math.min;
let $_pow = Math.pow;
let $_random = Math.random;
let $_round = Math.round;
let $_sign = Math.sign;
let $_sin = Math.sin;
let $_sinh = Math.sinh;
let $_sqrt = Math.sqrt;
let $_tan = Math.tan;
let $_tanh = Math.tanh;
let $_trunc = Math.trunc;
let $_E = Math.E;
let $_LN10 = Math.LN10;
let $_LN2 = Math.LN2;
let $_LOG10E = Math.LOG10E;
let $_LOG2E = Math.LOG2E;
let $_PI = Math.PI;
let $_SQRT1_2 = Math.SQRT1_2;
let $_SQRT2 = Math.SQRT2;
let $_to_base64 = btoa;
let $_from_base64 = atob;
let $_sprintf = sprintf;
let $_cols = function() {
return gaiman._term.cols();
};
let $_rows = function() {
return gaiman._term.rows();
};
let $_delay = function(time) {
return new Promise(resolve => setTimeout(resolve, time));
};
// Fisher-Yates (aka Knuth) Shuffle
// ref: https://stackoverflow.com/a/2450976/387194
function $_shuffle(array) {
let currentIndex = array.length, randomIndex;
// While there remain elements to shuffle.
while (currentIndex != 0) {
// Pick a remaining element.
randomIndex = Math.floor(Math.random() * currentIndex);
currentIndex--;
// And swap it with the current element.
[array[currentIndex], array[randomIndex]] = [
array[randomIndex], array[currentIndex]];
}
return array;
}
var cookie, argv, gaiman, $$__m;
try {
if (is_node()) {
argv = process.argv;
} else {
cookie = parse_cookies(document.cookie);
gaiman = new WebAdapter();
}
main();
} catch (e) {
window.parent.postMessage({
message: e.message,
colno: null,
lineno: null
});
throw e;
}
async function main() {
try {
let $_istqbuster_a_score = 0;
async function $_istqbuster_a_1() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #1]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which one of the following answers describes a test condition?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) A distinguishing characteristic of a component or system`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) A testable aspect of a component or system identified as a basis for testing`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) The degree to which a software product provides functions which meet stated and implied needs when the software is used under specified conditions`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) Test cases designed to execute combinations of conditions and actions resulting from them`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
await $_istqbuster_a_2();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_2();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_2();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_2();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_1();
}
}
async function $_istqbuster_a_2() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #2]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which of the following statements is a valid objective for testing?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) The test should start as late as possible so that development had enough time to create a good product`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) To validate whether the test object works as expected by the users and other stakeholders`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) To prove that all possible defects are identified`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) To prove that any remaining defects will not cause any failures`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
await $_istqbuster_a_3();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_3();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_3();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_3();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_2();
}
}
async function $_istqbuster_a_3() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #3]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which of the following statements correctly describes the difference between testing and debugging?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) Testing identifies the source of defects; debugging analyzes the defects and proposes prevention activities`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) Dynamic testing shows failures caused by defects; debugging eliminates the defects, which are the source of failures`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) Testing removes faults; but debugging removes defects that cause the faults`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) Dynamic testing prevents the causes of failures; debugging removes the failures`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
await $_istqbuster_a_4();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_4();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_4();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_4();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_3();
}
}
async function $_istqbuster_a_4() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #4]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which one of the statements below describes the most common situation for a failure discovered during testing or in production?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) The product crashed when the user selected an option in a dialog box`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) The wrong version of a compiled source code file was included in the build`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) The computation algorithm used the wrong input variables`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) The developer misinterpreted the requirement for the algorithm`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_5();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
await $_istqbuster_a_5();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_5();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_5();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_4();
}
}
async function $_istqbuster_a_5() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #5]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Mr. Test has been testing software applications on mobile devices for a period of 5 years. He has a wealth of experience in testing mobile applications and achieves better results in a shorter time than others. Over several months, Mr. Test did not modify the existing automated test cases and did not create any new test cases. This leads to fewer and fewer defects being found by executing the tests. What principle of testing did Mr. Test not observe?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) Testing depends on the environment`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) Exhaustive testing is not possible`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) Repeating of same tests will not find new defects`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) Defects cluster together`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
await $_istqbuster_a_6();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
await $_istqbuster_a_6();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_6();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_6();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_5();
}
}
async function $_istqbuster_a_6() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #6]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]In what way can testing be part of Quality Assurance?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) It ensures that requirements are detailed enough`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) Testing reduces the risk of poor software quality`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) It ensures that standards in the organization are followed`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) It measures the quality of software in terms of number of executed test cases`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
await $_istqbuster_a_7();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_7();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_7();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_7();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_6();
}
}
async function $_istqbuster_a_7() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #7]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which of the following activities is part of the main activity (test analysis) in the test process?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) Identifying any required infrastructure and tools`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) Creating test suites from test scripts`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) Analyzing lessons learned for process improvement`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) Evaluating the test basis for testability`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
await $_istqbuster_a_8();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
await $_istqbuster_a_8();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_8();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_8();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_7();
}
}
async function $_istqbuster_a_8() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #8]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Match the following test work products (1-4) with the right description (A-D):]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#94E2D5;]1]) Test suite`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]2]) Test case`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]3]) Test script`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]4]) Test charter`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#A6E3A1;]A]) A set of test scripts to be executed in a specific test run`, 35);
await gaiman.echo_extra(`[[;#A6E3A1;]B]) A set of instructions for the execution of a test`, 35);
await gaiman.echo_extra(`[[;#A6E3A1;]C]) Contains expected results`, 35);
await gaiman.echo_extra(`[[;#A6E3A1;]D]) Documentation of test activities in session-based exploratory testing`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) 1A, 2C, 3B, 4D`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) 1D, 2B, 3A, 4C`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) 1A, 2C, 3D, 4B`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) 1D, 2C, 3B, 4A`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_9();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
await $_istqbuster_a_9();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_9();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_9();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_8();
}
}
async function $_istqbuster_a_9() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #9]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]How can white-box testing be applied during user acceptance testing?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) To check if large volumes of data can be transferred between integrated systems`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) To check if all code statements and code decision paths have been executed`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) To check if all work process flows have been covered`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) To cover all web page navigations`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
await $_istqbuster_a_10();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
await $_istqbuster_a_10();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_10();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_10();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_9();
}
}
async function $_istqbuster_a_10() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #10]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which of the following statements comparing component testing and system testing is TRUE?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) Component testing verifies the functionality of software modules, program objects, and classes that are separately testable, whereas system testing verifies interfaces between components and interactions between different parts of the system`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) To check if all code statements and code decision paths have been executed`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) To check if all work process flows have been covered`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) To cover all web page navigations`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
await $_istqbuster_a_11();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_11();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_11();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_11();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_10();
}
}
async function $_istqbuster_a_11() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #11]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which one of the following is TRUE?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) Component testing verifies the functionality of software modules, program objects, and classes that are separately testable, whereas system testing verifies interfaces between components and interactions between different parts of the system`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) To check if all code statements and code decision paths have been executed`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) To check if all work process flows have been covered`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) To cover all web page navigations`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
await $_istqbuster_a_12();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
await $_istqbuster_a_12();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_12();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_12();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_11();
}
}
async function $_istqbuster_a_12() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #12]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which one of the following is the BEST definition of an incremental development model?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) Defining requirements, designing software and testing are done in phases where in each phase a piece of the system is added`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) A phase in the development process should begin when the previous phase is complete`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) Testing is viewed as a separate phase which takes place after development has been completed`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) Testing is added to development as an increment`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_13();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
await $_istqbuster_a_13();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_13();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_13();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_12();
}
}
async function $_istqbuster_a_13() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #13]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which of the following should NOT be a trigger for maintenance testing?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) Decision to test the maintainability of the software`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) Decision to test the system after migration to a new operating platform`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) Decision to test if archived data is possible to be retrieved`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) Decision to test after hot fixes`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_14();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
await $_istqbuster_a_14();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_14();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
await $_istqbuster_a_14();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_13();
}
}
async function $_istqbuster_a_14() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #14]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which of the following options are roles in a formal review?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) Developer, Moderator, Review leader, Reviewer, Tester`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) Author, Moderator, Manager, Reviewer, Developer`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) Author, Manager, Review leader, Reviewer, Designer`, 35);
await gaiman.echo_extra(`[[;#F5C2E7;]d]) Author, Moderator, Review leader, Reviewer, Scribe`, 35);
gaiman.echo(``);
let $_answer = await gaiman.ask(`[[;#94E2D5;]Select ONE option.] `);
gaiman.prompt(`Answer> `);
if ($$__m = String($_answer).match(/a/i), !!$$__m) {
await $_istqbuster_a_15();
} else if ($$__m = String($_answer).match(/b/i), !!$$__m) {
await $_istqbuster_a_15();
} else if ($$__m = String($_answer).match(/c/i), !!$$__m) {
await $_istqbuster_a_15();
} else if ($$__m = String($_answer).match(/d/i), !!$$__m) {
$_istqbuster_a_score += 1;
await $_istqbuster_a_15();
} else {
await gaiman.echo_extra(`[[;#F5C2E7;]Looks like you typed an incorrect letter or word...]`, 30);
await $_istqbuster_a_14();
}
}
async function $_istqbuster_a_15() {
gaiman.echo(``);
await gaiman.echo_extra(`[[;#FFC773;]Question #15]`, 35);
await gaiman.echo_extra(`[[;#F9E2AF;]Which activities are carried out within the planning of a formal review?]`, 35);
gaiman.echo(``);
await gaiman.echo_extra(`[[;#F38BA8;]a]) Collection of metrics for the evaluation of the effectiveness of the review`, 35);
await gaiman.echo_extra(`[[;#94E2D5;]b]) Answer any questions the participants may have`, 35);
await gaiman.echo_extra(`[[;#89B4FA;]c]) Definition and Verification of fulfillment of entry criteria for the review`, 35);