

Áp dụng Tests với iOS
Presentation
•
Professional Development
•
Professional Development
•
Easy
Đào Royce
Used 3+ times
FREE Resource
91 Slides • 6 Questions
1
Áp dụng Tests với iOS
By Đào FnB
2
The test pyramid
Some text here about the topic of discussion
3
"A measure to check if the code meets the defined specifications."
Test
4
Multiple Choice
What is a test?
A measure to increase code coverage
A measure to check if the code meets the defined specifications
A measure to check if the code is visually beautiful
A measure to check if the code contains security vulnerabilities?
5
Multiple Choice
What is the most basic type of developer level test?
Integration Test
Basic Test
Unit Test
UI Test
6
The Art of Unit Testing
" A unit test is a piece of code that invokes a unit of work and checks one specific end result of that unit of work.”
7
Unit Test Structure
func testArraySorting() {
let input = [1, 7, 6, 3, 10]
let output = input.sorted()
XCTAssertEqual(output, [1, 3, 6, 7, 10])
}
Run the code
Prepare Input
Output
8
Testable code
9
Characteristic of Testable code
Control over inputs
Visibility into outputs
No hidden state
10
Multiple Choice
Testable code?
YES
NO
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
Testability Techniques
Protocols and parameterization
Separating logic and effects
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
Reduce references to shared instances
Accept parameterized input
Introduce a protocol Create a testing implementation
Protocols and Parameterization
59
Separating Logic and Effects
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
Extract algorithms
Functional style with value types
Thin layer on top to execute effects
Separating Logic and Effects
90
Testability Techniques
Protocols and parameterization
Separating logic and effects
91
Fill in the Blanks
Type answer...
92
Test driven development
Red: Writing a failing test.
Green: Writing just enough code to make the test pass.
Refactor: Cleaning up and optimizing your code.
93
Multiple Choice
____: Writing just enough code to make the test pass
Refactor
GREEN
RED
94
Demo
95
5:00 a.m.--11:59 a.m.
Good morning.
12:00 p.m.--4:59 p.m.
Good afternoon.
5:00 p.m.--4:59 a.m.
Good evening.
Time-of-Day Greeter
96
Multiple Choice
Which of the following is not a stage in TDD?
RED
GREEN
COMMIT
REFACTOR
97
Áp dụng Tests với iOS
By Đào FnB
Show answer
Auto Play
Slide 1 / 97
SLIDE
Similar Resources on Wayground
85 questions
Present Tenses
Presentation
•
University
91 questions
7NS Review
Presentation
•
KG - University
86 questions
RUMAH PENDIDIKAN
Presentation
•
Professional Development
89 questions
EPF: Module 2 (25-26)
Presentation
•
12th Grade
86 questions
固定污染源許可證教育訓練
Presentation
•
KG - University
88 questions
untitled
Presentation
•
KG - University
88 questions
untitled
Presentation
•
KG - University
94 questions
Les institutions de l’UE au soutien de la transformation numér
Presentation
•
University
Popular Resources on Wayground
10 questions
Factors 4th grade
Quiz
•
4th Grade
10 questions
Cinco de Mayo Trivia Questions
Interactive video
•
3rd - 5th Grade
13 questions
Cinco de mayo
Interactive video
•
6th - 8th Grade
20 questions
Math Review
Quiz
•
3rd Grade
20 questions
Main Idea and Details
Quiz
•
5th Grade
20 questions
Context Clues
Quiz
•
6th Grade
20 questions
Inferences
Quiz
•
4th Grade
19 questions
Classifying Quadrilaterals
Quiz
•
3rd Grade
Discover more resources for Professional Development
20 questions
Block Buster Movies
Quiz
•
10th Grade - Professi...
20 questions
90s Cartoons
Quiz
•
Professional Development
15 questions
Trivia
Quiz
•
Professional Development
10 questions
Imperfect Subjunctive
Quiz
•
12th Grade - Professi...
34 questions
US National Parks
Quiz
•
Professional Development
20 questions
Disney characters
Quiz
•
KG - Professional Dev...
20 questions
car logos
Quiz
•
KG - Professional Dev...
20 questions
Sports trivia
Quiz
•
Professional Development