about summary refs log tree commit diff
path: root/usth/ICT2.7/P4L5 Software Refactoring Subtitles/19 - Cost of Refactoring - lang_en_vs4.srt
blob: e09868d5a8f0bd6a6234e47eae6b46285e633e65 (plain) (blame)
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
1
00:00:00,080 --> 00:00:03,800
Let's also talk about the cost of refactoring. Refactoring might be

2
00:00:03,800 --> 00:00:06,750
free or almost free if you're using a tool to do refactoring

3
00:00:06,750 --> 00:00:08,570
as we did in our demo. But that's not always the

4
00:00:08,570 --> 00:00:12,530
case. In many cases, refactoring involves quite a bit of manual work

5
00:00:12,530 --> 00:00:16,309
if you're doing some manual refactoring. And how much that costs

6
00:00:16,309 --> 00:00:19,460
depends on how well the operations on the source code are supported.

7
00:00:19,460 --> 00:00:22,379
You might have partial support from an ID. You might have complete

8
00:00:22,379 --> 00:00:25,017
support, in which case it's greater. Or you might have no support,

9
00:00:25,017 --> 00:00:26,879
in which case you have to be very careful about

10
00:00:26,879 --> 00:00:28,888
how you change your code and how you check that you

11
00:00:28,888 --> 00:00:32,030
didn't change the behavior of the code. There's also an additional

12
00:00:32,030 --> 00:00:34,460
cost associated with refactoring. Remember

13
00:00:34,460 --> 00:00:36,990
that refactoring relies heavily on testing

14
00:00:36,990 --> 00:00:39,808
after each small step of refactoring. So you might have

15
00:00:39,808 --> 00:00:43,451
to develop test cases, specifically to check your refactoring. And even

16
00:00:43,451 --> 00:00:47,163
if you have an existing test because, for example, you're working

17
00:00:47,163 --> 00:00:50,235
some agile context and therefore you develop a lot of UNIX

18
00:00:50,235 --> 00:00:53,550
test cases before writing your code. And therefore you have a good

19
00:00:53,550 --> 00:00:56,635
regression test with it you can use every time you modify your code.

20
00:00:56,635 --> 00:00:59,550
Nevertheless, when you refactor and you change your code, you might need

21
00:00:59,550 --> 00:01:03,255
to update your test so it's not only the development of the test

22
00:01:03,255 --> 00:01:05,379
cases but also it's maintaining the test cases. And if you have

23
00:01:05,379 --> 00:01:07,970
a lot of test cases, you have to maintain more test cases. So

24
00:01:07,970 --> 00:01:12,460
that's a cost that is not directly visible but can affect quite

25
00:01:12,460 --> 00:01:15,800
a bit the overall cost of refactoring and the overall cost of system

26
00:01:15,800 --> 00:01:18,342
development therefore. And finally, you should not

27
00:01:18,342 --> 00:01:21,191
under estimate the cost of documentation maintenance.

28
00:01:21,191 --> 00:01:24,241
Applying refactoring may involve changes in interfaces,

29
00:01:24,241 --> 00:01:26,528
names, for example, names of classes. And

30
00:01:26,528 --> 00:01:29,384
when you make this kind of changes, you might need to update the documentation,

31
00:01:29,384 --> 00:01:30,890
and that's also cost. It's something that

32
00:01:30,890 --> 00:01:32,900
takes effort and therefore should be considered.