Exemple de Régression Naturelle

La régression naturelle et l'approche Code & Fix

Day 1
Day 2
Day 3
Day 4
1
class User:
2
3
def message_list():
4
return DataSource().message_list(user_id=self.id)
Copied!
1
class User:
2
3
def message_list():
4
5
if os.environ.ENV == "stage":
6
data_source = DataSource(host="10.45.23.10")
7
else:
8
data_source = DataSource()
9
10
return data_source.message_list(user_id=self.id)
Copied!
1
class User:
2
3
def message_list():
4
5
if os.environ.ENV in ["stage", "STAYGE"]:
6
data_source = DataSource(host="10.45.23.10")
7
else if int(os.environ.HOST_NAME[-1]) % 2:
8
data_source = DataSource(host="10.33.35.15")
9
else:
10
data_source = DataSource()
11
12
return data_source.message_list(user_id=self.id)
Copied!
1
class User:
2
3
def message_list():
4
5
if os.environ.ENV in ["stage", "STAYGE"]:
6
data_source = DataSource(host="10.45.23.10")
7
else if os.environ.HOST_NAME[-1] % 2:
8
data_source = DataSource(host="10.33.35.15")
9
else:
10
data_source = DataSource()
11
12
if self.id.startswith("xft"):
13
if self.country == "FR":
14
if self.partner_id.startswith("RT")
15
self.xrb = 43
16
else:
17
self.xbe = 56
18
19
return data_source.message_list(user_id=self.id, xrb=self.xrb, xbe=self.xbe)
Copied!
Copy link