13.07.2015 Views

Laboratoire de Programmation - Institut d'Informatique

Laboratoire de Programmation - Institut d'Informatique

Laboratoire de Programmation - Institut d'Informatique

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

BAC 2 EN SCIENCES INFORMATIQUES<strong>Laboratoire</strong> <strong>de</strong><strong>Programmation</strong>Système <strong>de</strong> renseignements automatiques pourvoyageurs <strong>de</strong> la SNCBThomas Desart03/05/2012Chapitre 3 – Tests et fonction principale<strong>Laboratoire</strong> <strong>de</strong> <strong>Programmation</strong> Page 1 sur 5


Tests White-BoxFonction 20 (cvlntrains)aLe chemin ab est couvert dans tous les cas.ba<strong>Laboratoire</strong> <strong>de</strong> <strong>Programmation</strong> Page 2 sur 5


Fonction 27 (clpassages)Le prédicat pour le chemin abc<strong>de</strong>fghijbqr est :2≥length(e) ^ not change ^ e[2] ≠ ‘ ’ ^ change ^ e[i+1]≠ ‘ ’ ^ 48≤ord(e[i])≤57 ^ 0≤length(e)<strong>Laboratoire</strong> <strong>de</strong> <strong>Programmation</strong> Page 3 sur 5


Arc R6 R5 R4 R3 R2 R1RQBJi≥length(e)i≥length(e)i≥length(e)I i+1≥length(e) not change ^ e[i+1] ≠ ‘ ’H i+1≥length(e) not change ^ e[i+1] ≠ ‘ ’G i+1≥length(e) not change ^ e[i+1] ≠ ‘ ’ changeF i+1≥length(e) not change ^ e[i+1] ≠ ‘ ’ changeE i+2≥length(e) not change ^ e[i+2] ≠ ‘ ’ change e[i+1]≠ ‘ ’D i+2≥length(e) not change ^ e[i+2] ≠ ‘ ’ change e[i+1]≠ ‘ ’ 48≤ord(e[i])≤57C i+2≥length(e) not change ^ e[i+2] ≠ ‘ ’ change e[i+1]≠ ‘ ’ 48≤ord(e[i])≤57 i≤length(e)B i+2≥length(e) not change ^ e[i+2] ≠ ‘ ’ change e[i+1]≠ ‘ ’ 48≤ord(e[i])≤57 i≤length(e)A 2≥length(e) not change ^ e[2] ≠ ‘ ’ change e[i+1]≠ ‘ ’ 48≤ord(e[i])≤57 0≤length(e)<strong>Laboratoire</strong> <strong>de</strong> <strong>Programmation</strong> Page 4 sur 5


Test Black-BoxFonction 59 (sgare)Préconditions :n ,g , lg, li initialisesPostconditions :Supprime la gare <strong>de</strong> nom g <strong>de</strong> la liaison <strong>de</strong> nom n, met a jour la liste <strong>de</strong>s gares lg et la liste<strong>de</strong>s liaisons li, met a jour les fichiers gares.txt et liaisons.txt1 jeu avec une gare g sur une liaison et les listes lg et li non nulles1 jeu avec une gare g qui ne se trouve pas sur la liaison n2 jeux avec une seule <strong>de</strong> liste lg ou li nulle1 jeu avec les listes li et lg nulles1 jeu avec la gare g qui ne se trouve pas dans la liste lg1 jeu avec la liaison n qui ne se trouve pas dans la liste li2 jeux avec la gare g ou la liaison n inexistante2 jeux avec un <strong>de</strong>s fichiers gares.txt ou liaisons.txt vi<strong>de</strong>s1 jeu avec les fichiers gares.txt liaisons.txt vi<strong>de</strong>s1 jeu avec la gare g qui ne se trouve pas dans le fichier gares.txt1 jeu avec la liaison n qui ne se trouve pas dans le fichier liaisons.txt<strong>Laboratoire</strong> <strong>de</strong> <strong>Programmation</strong> Page 5 sur 5

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!