Project Informatique
2A - 2018/2019

Mickael Lecoq

C'est le dernier cours ...
Petit bilan


Text
Construire une application
Comment construire une application ?
Travailler en équipe
- Travailler de façon agile
- Équipes auto-organisées
- Focus : définissons un objectif commun
- Engagement : on réalise ce que l'on a décidé en équipe
- Courage : oser échouer pour progresser. On procède par itération (on essaie, on teste, on corrige)
- Respect : on écoute les opinions de tout le monde
- Ouverture : on partage son travail, échange sur nos problèmes
S'aider d'outils
- Google doc
- Dropbox
- Share Latex
- Trello
- Slack
- ....
Faire une conception
- Diagramme de cas d'utilisation -> quelles fonctionnalités
- Diagramme d'activités -> comment se déroulent-elles
- Diagramme de package -> comment est organisé le code
- Diagramme de classes -> quel objets métiers
- Diagramme de base de données -> comment on enregistre les informations
- Diagramme de Gantt -> quelles sont nos principales étapes ?
Séparation of concerns
DATA ACCESS LAYER
BUSINESS LAYER

PRESENTATION LAYER

Business
Objects
Import/Export de fichiers
DATA ACCESS LAYER
BUSINESS LAYER
PRESENTATION LAYER
Business
Objects



DATA ACCESS LAYER
BUSINESS LAYER
PRESENTATION LAYER
Business
Objects


CLIENTS
SERVEURS






RESEAU
DATA ACCESS LAYER
BUSINESS LAYER
PRESENTATION LAYER
Business
Objects




@IP : 192.168.1.14:80
@IP : 192.168.1.7:XX
@IP : 192.168.1.12:XX
@IP : 192.168.1.4:XX
Requête
Réponse
- Adresse IP : identifier les interlocuteurs
- Port : canal de communication
Protocole HTTP


GET url (http://....)
<html>
<head/>
<body/>
</html>
API Rest


GET url (http://....)
{
"name": "value"
}
Comment développer à plusieurs ?

Comment s'assurer que le code que j'ajoute/modifie ne casse pas le code existant ?
Tester manuellement
- Prend de plus en plus de temps avec l'ajout de fonctionnalité
- Difficulté de jouer tous les scénarios possibles
- On ne joue que les cas droit / notre utilisation est différent de celle des utilisateurs
Long, fastidieux, répétitif, incomplet
Automatiser les tests

Automatiser les tests
Ecrire les tests une fois et pouvoir les (re)jouer
Écrire des tests :
- Ciblés
- le test doit couvrir un cas (un seul scénario)
- Indépendants
- on doit pouvoir lancer un test sans avoir pour pré-requis un autre test
- Répétable
- on doit pouvoir lancer le test plusieurs fois à la suite et obtenir le même résultat
Automatiser les tests
Différents scénarios :
- cas normal/idéal
- cas d'erreur (mauvais paramètres)
- cas au limite (valeur très grande ou très petite)
Automatiser les tests
Différents types de tests :
- tests unitaires
- tests d'intégration
- tests de bout en bout
Automatiser les tests
PyTest
# content of test_sample.py
def inc(x):
return x + 1
def test_answer():
assert inc(3) == 5
Automatiser les tests

Démo
Gestionnaire de versions
Objectifs
- Mutualiser les développements
- Conserver une trace de chaque changement
- Pouvoir revenir sur une version particulière
Fonctionnement
Dépôt / Repository
Récupération d'une copie locale

Fonctionnement
Envoi des modifications (deltas) de fichiers

DELTAS => COMMITS
Fonctionnement
Récupération des modifications (deltas) de fichiers

DELTAS => COMMITS
Fonctionnement
- Mécanique asynchrone
- Les modifications sont traitées ligne par ligne
- Si 2 développeurs modifient la même ligne => conflit
Fonctionnement
Commit 1
Commit 2
Branches
Fonctionnement
Commit 1
Commit 2
v2.0
Tag
Fonctionnement
Merge
GIT
- Développé par Linus Torvald (1ère version en 2005) pour gérer le noyau Linux
- Facilite la gestion des contributions
- Décentralisé
- Rapidement adopté par les développeurs qui font de l'open source
GIT
Principaux services en ligne
- GitHub (vendu à Microsoft 7.5 milliards de $)
- GitLab
- Bitbucket
GIT
Dépôt / Repository

- Récupère:
- tous les commits
- tous les tags
- toutes les branches
On fait un clone du dépot
GIT
Dépôt distant/ Remote Repository

Dépôt local/ local repository
GIT
Dépôt distant/ Remote Repository

Dépôt local/ local repository
git pull
GIT
Dépôt distant/ Remote Repository

Dépôt local/ local repository
git push
GIT
Modification des fichiers
Unstaged files
git add
Staged files
Staging AREA
Zone de transit
git commit
GIT
- Git init - initialiser un dépôt vide
- Git fetch - consulter le dépôt distant
- Git status - avoir des informations sur l'état de votre branche
- Git log - voir les derniers commits
GIT
Conventions sur les branches :
- develop - en cours de développement
- master - actuellement en prod
- feature branch - correspond à une fonctionnalité

Démo !!!

Questions

ENSAI - Projet Info - Cours 4
By Mickael Lecoq
ENSAI - Projet Info - Cours 4
- 1,349